• Hi everyone,

    I am having general trouble with WordPress single posts – in about 80% of themes I have downloaded and applied, the sidebar on the main page appears as it should, but when a single post is clicked, the sidebar (and footer) disappear. I have tried themes without any modifications and they do this same thing straight “out of the box.” TIA!

    Here are two examples (the first with modifications of Titan, the second a simple dummy page using the WordPress default theme):

    http://arch-ive.org/
    http://arch-ive.org/0000test

Viewing 8 replies - 1 through 8 (of 8 total)
  • then perhaps the problem is with your posts or how you call images, etc.

    unclosed <div>'s are a killer

    Thread Starter atomiclauren

    (@inkvisitor)

    I was thinking that, but on the dummy page I used plain text and not a lot of it. The default theme did the same thing in that situation.

    If it is a div issue, which seems plausible, I can’t find where to correct it, especially since I have done nothing to the code to begin with.

    many themes make it a feature not to show sidebar (and footer) in single posts. some do extend the space to show a wider area for the single post, some don’t. look into ‘single.php’ and you will find no ‘get_sidebar’ near the end.

    if you insist in having a sidebar even on single posts, add the lines back into single.php – right at the end:

    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    you might need to change more than that and adjust the style as well.

    Thread Starter atomiclauren

    (@inkvisitor)

    ^Thanks – I checked with the theme creator’s page, and their page with the theme has a sidebar and footer on single posts.

    I also checked the single.php file and the sidebar and footer php statements are there. Here is the code for single.php:

    <?php get_header(); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class=”post single” id=”post-<?php the_ID(); ?>”>
    <div class=”post-header”>
    <div class=”date”> <?php the_time(‘M j’) ?> <span><?php the_time(‘y’) ?></span></div>
    <h1><?php the_title(); ?></h1>
    <div class=”author”>by <?php the_author() ?></div>
    </div><!–end post header–>
    <div class=”entry clear”>
    <?php the_content(‘read more…’); ?>
    <?php edit_post_link(‘Edit This’,'<p>’,'</p>’); ?>
    <?php wp_link_pages(); ?>
    </div><!–end entry–>
    <div class=”meta clear”>
    <p>From <?php the_category(‘, ‘) ?> </p>
    <div class=”tags”><?php the_tags(‘<span>Tags</span> <p>’, ‘, ‘, ‘</p>’); ?></div>

    </div><!–end meta–>
    </div><!–end post–>
    <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
    <?php comments_template(”, true); ?>
    <?php else : ?>
    <?php endif; ?>
    </div><!–end content–>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    the last echo in the html is:

    </div><!--end meta-->
    </div><!--end post-->

    that indicates that the single.php aborts some here:

    <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
    <?php comments_template('', true); ?>
    <?php else : ?>
    <?php endif; ?>
    </div><!--end content-->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    i pass this to the php experts …

    Why don’t you try what samboll hinted at and validate your site?

    Thread Starter atomiclauren

    (@inkvisitor)

    ^Yes, I initially did that and saw the “end tag for “div” omitted, but OMITTAG NO was specified.”

    Problem is, I can’t find any self closed or unclosed div.

    If it is a PHP problem like shown above, I have been unsuccessful in fixing that as well.

    I had the same problem and it drove me nuts. I found this article: http://www.wordpressmax.com/wordpress/add-sidebar

    After I added the “get side bar” in the code, I changed the column size from wide to narrow to allow room for the side bar.
    div id=”content” class=”widecolumn”> to div id=”content” class=”narrowcolumn”>

    This worked for me.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘WordPress sidebar in single posts’ is closed to new replies.