WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Widgetizing Theme Help (8 posts)

  1. tazboy
    Member
    Posted 7 years ago #

    I've done the steps on Automattic's site on how to widget a theme. I'm using the "blue-curves-15" theme by Priss. I've created the functions.php and sidebar.php. I have the "Sidebar Widget" tab, only the site doesn't show the new widget sidebar. It shows the old one. Though when I do "view source code" through FF's web developer it shows my Event Calendar from my sidebar widget. Go figure.

    Any suggestions? I've tried copying other functions.php and sidebar.php from themes that work. No go there. I've tried multiple suggestions on this site too. Just so you know that I didn't come here begging for help right away. I would appreciate anything. Thanks.

  2. Doodlebee
    Member
    Posted 7 years ago #

    I've created the functions.php and sidebar.php. I have the "Sidebar Widget" tab, only the site doesn't show the new widget sidebar. It shows the old one.

    did you put the widget code into your sidebar.php file?

  3. tazboy
    Member
    Posted 7 years ago #

    I have this code in my sidebar.php file:

    <div id="sidebar">
    <?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar() ) : ?>
    <div class="title">About</div>
    <p>This is my blog.</p>
    <div class="title">Links</div>

    <?php endif; ?>
    </div>

    I have this code in my functions.php:

    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar();
    ?>

  4. Doodlebee
    Member
    Posted 7 years ago #

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

    This looks off to me. It's saying "if the function of dynamic sidebar doesn't exist, then don't show the dynamic sidebar" - which is correct, really. However, it's not telling your site what to do if the function *does* exist.

    <div id="sidebar">
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(1) ) : else : ?>
    place in the code for all the stuff that should show up if your widget sidebar *didn't* exist
    <?php endif; ?>

    Give that a shot and see if it helps.

  5. tazboy
    Member
    Posted 7 years ago #

    That didn't work either. There does need to be a </div> on the end of that, right? Is there another function or code somewhere that I'm missing? I was told this should be fairly simple, relatively that is. Any other suggestions? By the way, thanks for the help so far.

  6. Doodlebee
    Member
    Posted 7 years ago #

    Yeah, there should.

    Have you tried downloading a fresh copy? it could be that the one you have is corrupted. It truly is easy to set widgets up - and it sounds like you've done everything you're supposed to do. The only other thing I could think of is that maybe you got a corrupted download by accident.

  7. tazboy
    Member
    Posted 7 years ago #

    I emailed Otto from here and he got back to me. He informed me that I didn't need a sidebar.php because the sidebar info was in the header.php. So I needed to change the header.php. Here is what he had me change: (the functions.php was already ok)

    Next, I see that there's no sidebar.php file. Looking around, I find
    the sidebar actually in header.php for some odd reason. Weird, but it
    doesn't matter. We'll just edit the sidebar there. You'll open
    header.php and do the following:

    Change this code:
    <!-- S T A R T N A V B A R -->
    <div id="right">
    <div id="righttop"></div>
    <div id="rightcontent">

      <!-- START SEARCH -->

      Into this:

      <!-- S T A R T N A V B A R -->
      <div id="right">
      <div id="righttop"></div>
      <div id="rightcontent">

      <?php if ( !function_exists('dynamic_sidebar')
      || !dynamic_sidebar() ) : ?>
      <!-- START SEARCH -->

      Then find this code:
      <!-- END META -->

    And change it to this:
    <!-- END META -->
    <?php endif; ?>

  8. Doodlebee
    Member
    Posted 7 years ago #

    good - glad you got it sorted!

Topic Closed

This topic has been closed to new replies.

About this Topic