WordPress.org

Ready to get started?Download WordPress

Forums

Replacing Sidebar on Single Post Pages (3 posts)

  1. JimLunsford
    Member
    Posted 1 year ago #

    I would like to replace the sidebar that appears on my homepage/archive pages with another, shorter sidebar on single post pages. I do not know how to create a sidebar and have it show in the widgets area or on the pages. Can I copy the sidebar file, rename it and then call it in the loop?

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    review http://codex.wordpress.org/Widgetizing_Themes

    details depend on your currently used theme.

    in single.php you will need to replace (for example) get_sidebar() with get_sidebar('single')
    http://codex.wordpress.org/Function_Reference/get_sidebar

    this will call a file sidebar-single.php;
    you can create this from a copy of sidebar.php, then change the dynamic_sidebar() code to match the sidebar ID used in your register_sidebar() code in functions.php;
    http://codex.wordpress.org/Function_Reference/register_sidebar
    that code should be similar to the existing register_sidebar() code of your theme.

    please post the name and download link of your theme if you need more details.

  3. JimLunsford
    Member
    Posted 1 year ago #

    Thanks for your response. I am reading the documentation now hoping I understand it. I am using PrimePress http://wordpress.org/extend/themes/primepress Now that I think about it it has a unique sidebar that I don't think I can just copy. You can select one column or three colums. We only use the one column option and would do the same on the sidebar-single.php. Does this mean I need to write one from scratch?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags