WordPress.org

Forums

Making sidebar different on index vs. post pages (5 posts)

  1. colleenc
    Member
    Posted 8 years ago #

    Hi all,

    Currently my sidebar appears on every single page of my WP blog, and it's the same on each page. I'm wondering if it's possible to have 2 sidebars - one for the "main" page of my blog, and a different one for the post pages. The only thing I've seen so far when I've searched on this topic is how to remove the sidebar completely, and I don't want to do that. I just want to display a few MORE things on my "main" page sidebar that don't need to be on the post pages and such.

    Anyone?

  2. citeewurkor
    Member
    Posted 8 years ago #

    I've never tried it, but in wp/wp-includes/general-template.php
    is the function "get_sidebar"

    I would imagine it's possible to create another function here, and call it "get_sidebar2" or something, only have it point to another sidebar, like sidebar2.php.

    You would have to create the sidebar2.php in your current theme's folder.

    Then wherever you want sidebar2.php to appear call the function you created called "get_sidebar2". Be sure and style it appropriately. Probably the same as the first sidebar.

    Remember, though that you would be hacking core WP files, and it would be advisable to back everything up.

    I'm sure there's an easier way to do it, but that's the first thing that came to mind...

  3. bryan868
    Member
    Posted 8 years ago #

    I'd be interested to know how to properly do this as well.

  4. Pizdin Dim
    Member
    Posted 8 years ago #

    Or just use the is_home() function in your existing sidebar.php file to conditionally output stuff.

  5. obscure
    Member
    Posted 8 years ago #

    There is a solution in this thread from three days ago http://wordpress.org/support/topic/102703?replies=3

Topic Closed

This topic has been closed to new replies.

About this Topic