Forums

Help me make my 2nd sidebar dynamic?? (13 posts)

  1. bbelack
    Member
    Posted 3 years ago #

    Ok. Here is my site. benbelack.com/blog I use the Imprezz theme.

    In the control panel, there is only one sidebar. But, there are two sidebars in the theme.

    Can someone please, PLEASE help me make my second sidebar (the one on the right), dynamic?

    I can't figure it out, and I really would like to be able to add widgets with ease.

    I'd be happy to send over code, or if you can point me to a tutorial that worked for you -- I'd greatly appreciate it.

    Thanks!

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Have a look at your 2 sidebar files. One will have the code that adds the dynamic widgets option, the other won't. Once you've located the relevant block of code, you'll need to replicate that in your non-dynamic sidebar with a few extra tweaks. Finally you'll need to edit your functions.php file to, essentially, activate the newly dynamic sidebar.

    If you need help, paste the content of each of the three relevant files in the WordPress specific pastebin at: http://wordpress.pastebin.ca/ then paste the links to those files here.

  3. bbelack
    Member
    Posted 3 years ago #

    Thanks Esmi!!

    I uploaded the index.php file to pastebin here: http://wordpress.pastebin.ca/1386487

    And, the sidebar.php file here:
    http://wordpress.pastebin.ca/1386492

    I'd like the second sidebar in the admin control panel, so I can just add widgets to it right below the twitter emblem and the image that is currently there.

    I think the code referring to that sidebar is "sidebar-right"

    Thanks!

  4. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Actually I need functions.php - not index.php.

    And I need the code for sidebar-right.php

  5. bbelack
    Member
    Posted 3 years ago #

    Thank you so much esmi!

    Ok. Functions.php is here: http://wordpress.pastebin.ca/1387380

    And, all sidebar code is in sidebar.php and index.php.

    There isn't a separate php file for it.

    Let me know if you need anything else.

  6. Justin Tadlock
    Member
    Posted 3 years ago #

    How to create a dynamic sidebar.

    Step 1: Open functions.php and register it.

    register_sidebar( array( 'name' => 'Sidebar Name', 'id' => 'sidebar-id', 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );

    Step 2: Place this where you'd like to show this dynamic sidebar.

    <?php dynamic_sidebar( 'sidebar-id' ); ?>

    Of course, replace Sidebar Name and sidebar-id with something unique.

  7. bbelack
    Member
    Posted 3 years ago #

    Yes, but I have "sidebar left" and sidebar right" right now. I just want to leave the left sidebar alone, and be able to add widgets to the sidebar right underneath the twitter widget and image already in place.

  8. bbelack
    Member
    Posted 3 years ago #

    I got it to work! BUT... How do I align the widgets with the images that are above? Take a look at http://www.benbelack.com/blog

  9. bbelack
    Member
    Posted 3 years ago #

    Actually made a new post... Please take a quick look:

  10. bbelack
    Member
    Posted 3 years ago #

  11. ldexterldesign
    Member
    Posted 3 years ago #


  12. ldexterldesign
    Member
    Posted 3 years ago #

    @greenshady, @bbelack - Hmmm, having a bit of a problem getting this to work guys. Can you offer any help?

    - Does it matter where I drop the functions.php code into the file?

  13. ldexterldesign
    Member
    Posted 3 years ago #

    Sorted*

Topic Closed

This topic has been closed to new replies.

About this Topic