Missing Sidebar – but only sometimes.
-
WordPress theme = Blueberry 2.0.3 by Adam Hunter
I am unable to view my sidebar in posts when accessing posts via their relevant URLs [http://gumdiseaseremedies.com/oramd-ingredients-heres-the-recipe/]. I see no sidebar at all. No images – no text – no links – just a plain white column. (The main post column is normal).
Strangely – this applies to all posts after the first one (date order) The 1st post [http://gumdiseaseremedies.com/] DOES display the sidebar. The 1st post also acts as the home page. Posts #2 onwards do not display the sidebar.
However – the sidebar is visible on ALL posts when viewed from within WP Admin area.
All pages have their sidebar visible at all times – both from within admin and via their URLs – so no problem there. It’s just the posts from #2 onwards.
Does anybody have any help they might offer to resolve this issue please?
Any thoughts gratefully received.
Kind regards
Bill Smith
-
look at index.php of your theme (which shows the latest post and the sidebar) and find the line
<?php get_sidebar(); ?>or something very similar. then compare it with single.php (which shows individual post, and no sidebar) and copy the sidebar code into the corresponding place.Alchymyth – thanks very much for your response.
Tried that in several differentways – but it just seemed to throw everything all over the post – bit like a car crash.
Anyway – I have now restored things to exactly how they were before.
It seems (to my uneducated eye) that there is a ‘what-if’ instruction in ‘single.php’ that refers to ‘blueberry_sidebar’.
Here is the code from single.php
++++++QUOTE+++++++++++
<?php get_header(); ?>
<div id=”content” class=”<?php blueberry_sidebar(); ?>”>
<?php if ( have_posts() ) { while ( have_posts() ) { the_post(); ?>
<div class=”navigation”>
<div class=”alignleft”><?php previous_post_link(‘« %link’) ?></div>
<div class=”alignright”><?php next_post_link(‘%link »’) ?></div>
</div>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h2><?php the_title(); ?></h2>
<div class=”entry”>
<?php
the_content(‘<p>Continue reading ‘ . the_title(”, ”, false) . ‘ »</p>’);
wp_link_pages(
array(‘before’ => ‘<p>Pages: ‘,
‘after’ => ‘</p>’,
‘next_or_number’ => ‘number’
)
);
?>
</div><!– .entry –>
<p class=”postmeta center”>
” title=”<?php the_title(); ?>” rel=”bookmark”>
<?php the_title(); ?> was posted on <?php the_time(‘l, F jS, Y’) ?> at <?php the_time() ?>.
This post is tagged <?php the_tags(”, ‘, ‘, ”); ?> and is filed under <?php the_category(‘, ‘); ?>.
You can follow the replies through the <?php post_comments_feed_link(‘comments feed’); ?>.
<?php blueberry_response(); ?>
</p>
</div><!– .post #post-<?php the_ID(); ?> –><?php } } else { ?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p><?php } ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php comments_template(); ?>
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
</div>
<?php if ( get_option(‘blueberry_sidebar’) ) { get_sidebar(); } ?>
<?php get_footer(); ?>+++++++UNQUOTE+++++++
Does this make a course of action any clearer ??
Many thanks for your help – it’s much appreciated.
Kind regards
Bill Smith
optimal – that means you can set the sidebar from:
admin dashbord -> appearance -> Blueberry options -> then in the top bar it should say ‘enable post sidebar’no programming needed π
Hi Alchymyth
Thanks for sticking with this one !
I did as you described – however – when I got to Blueberry Options the sidebar was already enabled. I disabled it – and the sidebar was gone altogether.
I then enabled it again – and the sidebar returned – but was empty as before.
The plot thickens.
Now I wish I had studied php sometime . . . !
Is there anything else I can check – or should I be thinking about abandoning ship and go find another theme and redo the whole presentation ?
It would be a shame as I really liked the simplicity of this theme.
Kind regards
Bill Smith
And another quick point on this same subject . . .
You see an empty sidebar from the URL:
http://gumdiseaseremedies.com/oramd-ingredients-heres-the-recipe/
But if you view the same page from the archives (which isn’t where people are naturally going to find it):
http://gumdiseaseremedies.com/category/gum-disease/page/2/
the sidebar is populated.
Is there any way to make the URL do the same as the archives ??
Many thanks – again.
Bill Smith
a way to do this:
enable the sidebar from the admin;
and edit single.php (i.e. remove the conditional stuff) – the last few lines should then look like this:
<?php endif; ?> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>hope this works π
Thanks for sticking with this . . . you’ve cracked it !!
It’s all working beautifully now.
I have stopped tearing my hair out and hopefully some will grow back in time for Christmas so I can face my relatives.
Thanks a million . . .
Kind regards
Bill Smith
The topic ‘Missing Sidebar – but only sometimes.’ is closed to new replies.