Forums

Getting theme widget ready-- (15 posts)

  1. dominoeffect
    Member
    Posted 4 years ago #

    I'm attempting to get the second sidebar on the Gridfocus theme widget-ready, and studying from this forum post:

    http://wordpress.org/support/topic/114391?replies=42

    and this guide:

    http://automattic.com/code/widgets/themes/

    If anyone can help me clarify exactly where to start / what to do I would really appreciate it!

    One thing I'd like to say: the sidebar I want to widgetise isn't called sidebar.php, it's called second.php, is this a problem?? will I need to rename it and every other reference to it??

    Like I said, I'd really appreciate some guidance on basic points of what I need to do here,

    thanks!

    Edit: link to grid focus theme

    http://5thirtyone.com/grid-focus

  2. moshu
    Member
    Posted 4 years ago #

    If more than one sidebar... take a look at these threads:
    http://wordpress.org/search/multiple+sidebars+widgets?forums=1

  3. dominoeffect
    Member
    Posted 4 years ago #

    Hey moshu, Thanks!

    one question: does that matter if i only want to widgetise one of the sidebars?

  4. moshu
    Member
    Posted 4 years ago #

    Well, in that case you don't have to worry about the code for multiple sidebars.

  5. dominoeffect
    Member
    Posted 4 years ago #

    Cool man thanks.

    ANy help on the original points would also be appreciated. Having no joy with it at all!

  6. moshu
    Member
    Posted 4 years ago #

    You already found all the necessary documentation for widgetizing.

    Apply the widget call code to your sidebar file. Don't forget to close the if statement.
    Add a functions.php file to your theme (can copy from classic).
    If you are using a second sidebar file, e.g. named mysidebar.php -> modify the functions.php code to reflect its name.
    Call that custom sidebar with the proper include line:
    <?php include (TEMPLATEPATH . '/mysidebar.php'); ?>
    That's it.

  7. dominoeffect
    Member
    Posted 4 years ago #

    Ok, so I've added code to the sidebar (second.php) to make it look like this

    <div id="midCol">
    	<?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar() ) : ?>
    
    .....SIDEBAR CONTENT
    
        <?php endif; ?>
    </div>

    And added this to the top of functions.php in the wp-include folder:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '<div class="title">',
            'after_title' => '</div>',
        ));
    ?>

    But in the admin panel it's still not recognising the sidebar, although it looks ok.

    Any ideas people?

  8. moshu
    Member
    Posted 4 years ago #

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar(array('name'=>'second',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '<div class="title">',
            'after_title' => '</div>',
        ));
    ?>
  9. dominoeffect
    Member
    Posted 4 years ago #

    Ahh so I shouldn't be editing functions.php in the wp-include folder, but making a newbie in the actual theme folder, right?

  10. moshu
    Member
    Posted 4 years ago #

    Yes, nobody ever talked about the wp-include folder.
    I explicitely told you:
    Add a functions.php file to your theme (can copy from classic).

  11. dominoeffect
    Member
    Posted 4 years ago #

    I wrote that post before your reply came up, sorry. I stupidly assumed it was the other functions.php file.

  12. moshu
    Member
    Posted 4 years ago #

    Rule of thumb: don't do anything until you are sure you got the latest reply and being sure you understood it :)

  13. dominoeffect
    Member
    Posted 4 years ago #

    Learned :)

  14. dominoeffect
    Member
    Posted 4 years ago #

    Ok the sidebar is now sidebar-conscious, thank you for all your help and understanding Moshu.

    I will probably be back with another mad enquiry + learned patience! Thanks again bro.

  15. gfurst
    Member
    Posted 3 years ago #

    Hello there... i'm with a similar problem....
    Trying to read about but only getting more lost. I tried to read something on that API about widget... but i'm afraid i might die if continued....

    Here is the thing... i did make the first bar widgetized, but my theme has a total of four colums, the first/page content/and the others two.
    And aparently the others two are in obar.php(nao-sapien theme). And now i have no idea what step to take...

    Where i put what??? and about the name thing? Please help me, and be patient. thank you

Topic Closed

This topic has been closed to new replies.

About this Topic