WordPress.org

Ready to get started?Download WordPress

Forums

How do I get the sidebar on the post viewing page? (7 posts)

  1. d14posters
    Member
    Posted 6 years ago #

    Hi,

    Maybe I am missing something really easy, but how do I get my sidebar to show up on the "posts" (as apposed to only the home page).
    Thanks in advance!

  2. Alex Cragg
    Member
    Posted 6 years ago #

    if you look in index.php, you will see this somewhere;
    <?php get_sidebar(); ?>
    index.php is used for pages and home page, where as for posts, single.php is used.

    Open up single.php, and insert the same line of code above in the same place as it is in the index.php file.

    so if in index.php, the code comes after <div id="wrap"> for example, put it in the same place.

  3. d14posters
    Member
    Posted 6 years ago #

    Hi,
    Thanks for the quick reply. I tried that but it didn´t work. I think I tried inserting the code on almost every line of the single.php page and it didn´t work... shouldn´t this be really easy singe everyone has a sidebar on there posts page?

    thanks

  4. Alex Cragg
    Member
    Posted 6 years ago #

    hmmm, not sure why that doesn't work.

    I know its simple, but ive made these mistakes before...
    Are you editing the right theme?
    Making sure you save properly?
    Refreshing your browser?

    if we see a link to your site it might help to diagnose.

    it might be that you don't have a conventional sidebar.php, and need a different call. I presume though that you use get_sidebar in index.php?

  5. d14posters
    Member
    Posted 6 years ago #

    Hi,
    Yes, I am editing the right theme because the sidebar does show up... but either as a long bar on top (before) the post of on the bottom (after) the post but not on the right hand side alongside the post. The blog is dinheirooportunidade.com
    Thanks for your help!

  6. Alex Cragg
    Member
    Posted 6 years ago #

    ok, hopefully this should work.

    You are using the K2 theme, which when viewing a page, has a content class of narrowcolumn, but when viewing a post has widecolumn. So why your sidebar is either above or below the post is cause there isnt enough width.

    If you open single.php and look at this line at the top
    <div id="content" class="widecolumn"> , replace widecolumn with narrowcolumn.

    <div id="content" class="narrowcolumn"> is how it should now be in single.php too.

  7. d14posters
    Member
    Posted 6 years ago #

    Thank you! That did the trick!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags