Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1210302
    gateway978
    Participant

    Hi,

    We’re at http://www.gateway978.com and would like to use our new post filters plugin ABOVE our blog posts on http://www.gateway978.com/blogs. Can somebody please send code for the functions.php to allow us to add a custom widget space please?

    Thanks in advance

    T

    #1210447
    Rahul
    Moderator

    Hi There,

    Please follow the steps below to add a widget.

    1. Add the code below in functions.php of child theme

    register_sidebar( array(
        'id'          => 'page-bottom',
        'name'        => __( 'Page - Bottom','x'),
        'description' => 'This is the bottom section of the page.',
        'before_widget' => '<div id="page-bottom">',
        'after_widget'  => '</div>',
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => '</h2>'
    ) );

    2. Create the file content-page.php in wp-content/themes/x-child-integrity/framework/views/integrity and add the code below.

    <?php
    
    // =============================================================================
    // VIEWS/INTEGRITY/CONTENT-PAGE.PHP
    // -----------------------------------------------------------------------------
    // Standard page output for Integrity.
    // =============================================================================
    
    $disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true );
    
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
      <div class="entry-featured">
        <?php x_featured_image(); ?>
      </div>
      <div class="entry-wrap">
        <?php if ( is_singular() ) : ?>
          <?php if ( $disable_page_title != 'on' ) : ?>
          <header class="entry-header">
            <h1 class="entry-title"><?php the_title(); ?></h1>
          </header>
          <?php endif; ?>
        <?php else : ?>
        <header class="entry-header">
          <h2 class="entry-title">
            <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php x_the_alternate_title(); ?></a>
          </h2>
        </header>
        <?php endif; ?>
        <?php x_get_view( 'global', '_content' ); ?>
      </div>
      <?php x_google_authorship_meta(); ?>
    </article>
    <?php dynamic_sidebar('page-bottom');?>

    3. Go to Appearance > widgets and add contents to your newly added widget called Page Bottom.

    You are welcome to change the name of the widget to anything you like.

    4. You can add custom styles by using the id page-bottom to target the widget.

    Hope that helps.

    Cheers

  • <script> jQuery(function($){ $("#no-reply-1210302 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>