• Hello, I am using a variation of the Kubrick theme. At the moment, the sidebar only shows on the homepage. I would like it to show on the posts and archived pages as well. I have been through this tutorial, but it is not working:

    https://quirm.net/2009/10/03/customising-the-default-wordpress-theme-1/

    Here is the code from my sidebar.php file:

    <div id="sidebar">
    <ul>
    				<?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar(1) ) : ?>
    
    			<?php wp_list_pages('title_li='.__('Pages') ); ?>
    
    			<li class="LargeMenu"><?php _e('Archives'); ?>
    				<ul>
    					<li>
    					<?php get_calendar(); ?>
    					</li>
    				</ul>
    			</li>
    
    			<?php wp_list_categories('title_li='.__('Categories').'&show_count=1&orderby=name&hierarchical=1' ); ?>
    
    			<li><h2><?php _e('Meta'); ?></h2>
    				<ul>
    					<?php wp_register(); ?>
    					<li><?php wp_loginout(); ?></li>
    					<li><a href="https://validator.w3.org/check/referer" title="<?php _e('This page validates as XHTML 1.0 Transitional'); ?>"><?php _e('Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr>'); ?></a></li>
    					<li><a href="https://gmpg.org/xfn/"><?php _e('<abbr title="XHTML Friends Network">XFN</abbr>'); ?></a></li>
    					<?php wp_meta(); ?>
    				</ul>
    			</li>
    
    			<li class="LargeMenu"><?php _e('Search'); ?>
    				<ul>
    					<li><?php include (TEMPLATEPATH . "/searchform.php"); ?>
    					</li>
    				</ul>
    			</li>
    
    			<?php if (function_exists('gengo_list_languages'))
    				{
    				echo '<li>'.__('Languages', GENGO_DOMAIN).'<ul>';
    				echo gengo_list_languages();
    				echo '</ul></li>';
    				}
    			?>
    
    			<?php endif; ?>
    		</ul>
    </div>
    
    <?php if ( !is_single() & !is_page() ) { ?>
    	<div id="SideRight">
                            <ul>
    			<?php if ( !function_exists('dynamic_sidebar')
    				|| !dynamic_sidebar(2) ) : ?>
    				<?php
    				if (get_bloginfo('version')<'2.1')
    					{
    					get_links_list();
    					}
    				else
    					{
    					wp_list_bookmarks('title_li='.__('Bookmarks').'');
    					}
    				?>
    
    			<?php endif; ?>
                            </ul>
    	</div>
    <?php } ?>

    Thank you very much to anyone who might be able to help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Make sure that your single.php and page.php are both calling sidebar (most likely with the get_sidebar() function.

    Eric

    Thread Starter JG99

    (@jg99)

    Yes, they both are, but it’s still not showing the sidebar anywhere but on the homepage:

    Here is the single.php file:

    <?php get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    		<div class="post" id="post-<?php the_ID(); ?>">
    			<h2><a href="<?php echo get_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link:'); ?> <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
    			<div class="entrytext">
    				<?php the_content('<p class="serif">'.__('Read the rest of this entry &raquo;').'</p>'); ?>
    				<?php if (function_exists('gengo_link_pages')) : ?>
    					<?php gengo_link_pages('<p><strong>'.__('Pages:').'</strong> ', '</p>', 'number'); ?>
    				<?php else : ?>
    					<?php link_pages('<p><strong>'.__('Pages:').'</strong> ', '</p>', 'number'); ?>
    				<?php endif; ?>
    
    				<p class="postmetadata alt">
    					<small>
    					<?php printf(__('Filed under %3$s. Follow responses to this entry via the <a href="%4$s">RSS 2.0</a> feed.'), get_the_time(__('l, F jS, Y')), get_the_time(__('g:i a')), get_the_category_list(', '), get_bloginfo_rss('comments_rss2_url')); ?>
    
    						<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    							// Both Comments and Pings are open
    							printf(__('You can <a href="#respond">leave a response</a>, or <a href="%1$s">trackback</a> from your own site. '), trackback_url(false));
    						?>
    						<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    							// Only Pings are Open
    							printf(__('Responses are currently closed, but you can <a href="%1$s">trackback</a> from your own site.'), trackback_url(false));
    						?>
    						<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    							// Comments are open, Pings are not
    							_e('You can skip to the end and leave a response. Pinging is currently not allowed.');
    						?>
    						<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    							// Neither Comments, nor Pings are open
    							_e('Both comments and pings are currently closed.');
    						?>
    					<?php } edit_post_link(__('Edit this entry.'),'',''); ?>
    
    					</small>
    				</p>
    
    			</div>
    		</div>
    
    	<?php comments_template(); ?>
    
    	<?php endwhile; else: ?>
    
    		<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    
    <?php endif; ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    and the page.php file:

    <?php get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    
        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<h2><?php the_title(); ?></h2>
    			<div class="entrytext">
    				<?php the_content('<p class="serif">' . __('Read the rest of this page &raquo;') . '</p>'); ?>
    			<?php if (function_exists('gengo_link_pages')) : ?>
    					<?php gengo_link_pages('<p><strong>' . __('Pages:') . '</strong> ', '</p>', 'number'); ?>
    			<?php else : ?>
    					<?php link_pages('<p><strong>' . __('Pages:') . '</strong> ', '</p>', 'number'); ?>
    			<?php endif; ?>
    			</div>
    		</div>
    	  <?php endwhile; endif; ?>
    	<?php edit_post_link(__('Edit this entry.'), '<p>', '</p>'); ?>
    
    	<?php comments_template(); ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    Hmm, odd. What’s your site’s url?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sidebar not showing on posts – how can I change this?’ is closed to new replies.