• I am trying to add sidebars into the footer and I’ve created the space and the sidebars but none of the content is appearing, what am I missing?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Did you add a call to dynamic_sidebar() in the footer.php template itself?

    https://codex.wordpress.org/Function_Reference/dynamic_sidebar

    Thread Starter starrj7690

    (@starrj7690)

    This is the code I have inside the footer.php template

    <div id=”footer-sidebar” class=”secondary”>
    <div id=”footer-sidebar1″>
    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(2) ) : ?>
    <?php endif; ?>
    </div>

    <div id=”footer-sidebar2″>
    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(3) ) : ?>
    <?php endif; ?>
    </div>

    <div id=”footer-sidebar3″>
    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(4) ) : ?>
    <?php endif; ?>
    </div>

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    What did you use as the name of the sidebar in register_sidebar? Use that string instead of a number.

    and you don’t need all that wrapper code. Just

    dynamic_sidebar( 'sidebar_name' );

    Thread Starter starrj7690

    (@starrj7690)

    I’m not exactly following. Here are the names of the sidebars

    Footer Sidebar 1
    Footer Sidebar 2
    Footer Sidebar 3

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please show your register_sidebar() code. Use pastebin.com or gist.github.com and paste a link to that here.

    Thread Starter starrj7690

    (@starrj7690)

    register_sidebar( array(
    ‘name’ => ‘Footer Sidebar 1’,
    ‘id’ => ‘footer-sidebar-1’,
    ‘description’ => ‘Appears in the footer area’,
    ‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => ‘</aside>’,
    ‘before_title’ => ‘<h3 class=”widget-title”>’,
    ‘after_title’ => ‘</h3>’,
    ) );
    register_sidebar( array(
    ‘name’ => ‘Footer Sidebar 2’,
    ‘id’ => ‘footer-sidebar-2’,
    ‘description’ => ‘Appears in the footer area’,
    ‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => ‘</aside>’,
    ‘before_title’ => ‘<h3 class=”widget-title”>’,
    ‘after_title’ => ‘</h3>’,
    ) );
    register_sidebar( array(
    ‘name’ => ‘Footer Sidebar 3’,
    ‘id’ => ‘footer-sidebar-3’,
    ‘description’ => ‘Appears in the footer area’,
    ‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => ‘</aside>’,
    ‘before_title’ => ‘<h3 class=”widget-title”>’,
    ‘after_title’ => ‘</h3>’,
    ) );

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    So you’d use dynamic_sidebar( 'footer-sidebar-1' );

    If that doesn’t work, put in some debug code to see if that part of footer.php actually gets executed.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Footer Widgets don’t appear on the screen’ is closed to new replies.