WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Sidebar 2 show up in widget (4 posts)

  1. Smithdesign
    Member
    Posted 6 years ago #

    Okay! Here it comes.

    I'm using JustSkins template Twilight which I have modified. That template have only one sidebar. And I wanted two sidebars. I put in following code in index, page, single.php

    <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>

    Then I took existing sidebar and named it sidebar2 and made a duplicate of the CSS sidebars naming them sidebar2, because it should have a different look.

    Everything is working fine, showing up properly on the site exept for one thing. I want it to show up in admin under Design/widgets. But it doesn't. I can only choose that one sidebar.

    In sidebar2.php I changed to number 2 between (). I don't know if that does anything, since I'm not good at programming.

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>

    I think I might forgot to put some output telling it to show up in admin interface. But I don't know where.

    I'll be very greatful if you guys help me out.

    THANKS!
    Lisa

  2. Smithdesign
    Member
    Posted 6 years ago #

    Oh man!

    I just solve the problem myself. In functions.php i replaced following:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'before_widget' => '<li id="%1$s" class="widget %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h2 class="sidebartitle">',
            'after_title' => '</h2>',
        ));
    ?>

    With

    <?php
    if ( function_exists('register_sidebars') )
        register_sidebars(2);
    ?>

    and added a number 2. Now it show up in admin. :-)

    Dancing "happy dance"

  3. Subuntu
    Member
    Posted 5 years ago #

    Thanks!

    Id like to add i needed to put a <?php endif; ?> to display it without parse error.
    Here this is what my sidebar2.php looks like.
    And i added it to my footer.php ...

    <div id="sidebar2">
    
    		<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
    
    		<?php endif; ?>
    	</div>
  4. Jbert
    Member
    Posted 5 years ago #

    LISA,

    Please contact me at

    3jbert@tx.rr.com. I must talk to you about your addition----please

    JIM

Topic Closed

This topic has been closed to new replies.

About this Topic