WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WordPress Widgets (8 posts)

  1. winnopeg
    Member
    Posted 8 years ago #

    I'm back. Basically, I'm trying to widgetize my Red is Nice theme, and I'm having problems. I've done everything the article says, and yet when the code is in place the sidebar and footer dissapear (as seen here). I'm no php genius so I need help.

    P.S. I've tried both the php line from the tutorial page as well as the one used in kubrik.

  2. winnopeg
    Member
    Posted 8 years ago #

    I still can't get it to work.

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    yet when the code is in place the sidebar and footer dissapear

    Well, the sidebar is supposed to disappear. That's sort of the point, you're replacing the sidebar with widgets. Go to the widgets control panel and put some widgets on the sidebar. Admin->Presentation->Sidebar Widgets.

    As for your missing footer, probably you forgot to close the if statement on one of the sidebars.

  4. winnopeg
    Member
    Posted 8 years ago #

    I realize that it's supposed to dissapear. I mean that it's simply a blank space. ;) And as far as putting widgets in the sidebar, those have been selected too (archives, search, links and some others). For whatever reason it just dosn't want to work.

    And I'm pretty sure my code's fine - it validates perfectly, after all.

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    winnopeg: Okay, what is the exact code that you have at the top of the functions.php file (the register_sidebar stuff) and what is the exact code that you have at the top of the sidebar files (the dynamic_sidebar stuff)?

  6. winnopeg
    Member
    Posted 8 years ago #

    functions.php :
    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar();
    ?>

    sidebar.php (at the moment)
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>

    (though I have also tried this) :
    <?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar() ) : ?>

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    The functions.php you have should work fine with the latter bit of code for the dynamic sidebar (not the "at the moment" one). However, with that dynamic_sidebar() call, don't forget to include the endif; line after the rest of the page (but before the /ul).

  8. winnopeg
    Member
    Posted 8 years ago #

    That's what was wrong - I overlooked the other line of code. It works now, though the calendar don't really work. Anyways, thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic