<!-more> tag strips my sidebar
-
When I place a more tag in a post, once clicked, it strips away my sidebar. Why would this be? See it here.
-
Problem with your php template file (which is probably single.php). A different template file is used for your home page and for single post pages. In your single post page, it looks like no
sidebar
is being called, and looks like nofooter
either.Go into your theme editor, and take a look at single.php
Towards the bottom, is there
<?php get_sidebar();?>
and<?php get_footer();?>
?Copy and paste the content of sidebar.php here if you want me to take a look.
– John
Sidebar
<?php /*
This theme works with widgets, a plugin that allows you to easily modify
your sidebar without having to bother with any html. Grab it at:
https://automattic.com/code/widgets/
*/ ?><div id=”sidebar”>
-
<?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar() ) : ?>
<?php wp_list_pages(‘title_li=<h2>’ . __(‘Pages’) . ‘</h2>’ ); ?>
<li id=”archives”>
<h2><?php _e(‘Archives’); ?></h2>-
<?php wp_get_archives(‘type=monthly’); ?>
<?php /* Uncomment for calendar
<li id=”calendar”>
<?php get_calendar(); ?>*/ ?>
<li id=”categories”>
<h2><?php _e(‘Categories’); ?></h2>-
<?php wp_list_cats(); ?>
<?php if (function_exists(‘wp_theme_switcher’)) { ?>
<li id=”themeswitcher”>
<h2><?php _e(‘Themes’); ?></h2>
<?php wp_theme_switcher(); ?><?php } ?>
<?php if ( is_home() ) { get_links_list(); } ?>
<li id=”meta”>
<h2><?php _e(‘Meta’); ?></h2>-
<?php wp_register(); ?>
- <?php wp_loginout(); ?>
- ” title=”<?php _e(‘Syndicate this site using RSS 2.0’); ?>”><?php _e(‘Entries RSS’); ?>
- ” title=”<?php _e(‘The latest comments to all posts in RSS’); ?>”><?php _e(‘Comments RSS’); ?>
- “>WordPress
<?php wp_meta(); ?>
<li id=”search”>
<?php include (TEMPLATEPATH . ‘/searchform.php’); ?><?php endif; ?>
</div>
Single
<?php get_header(); ?>
<?php $showauthor = almostspring_showauthor(); $dateformat = almostspring_dateformat(); ?><div id=”content”>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h2 class=”posttitle”>” rel=”bookmark” title=”<?php _e(‘Permanent link to’); ?> <?php the_title(); ?>”><?php the_title(); ?></h2>
<p class=”postmeta”>
<?php if ($dateformat == ‘default’) {
the_time(get_settings(‘date_format’));
} else {
the_time(‘F j, Y’);
} ?>
<?php _e(‘at’); ?> <?php the_time() ?>
<?php if ($showauthor == ‘true’) {
_e(‘by’); echo ‘ ‘; the_author_posts_link();
} ?>
· <?php _e(‘Filed under’); ?> <?php the_category(‘, ‘) ?>
<?php edit_post_link(__(‘Edit’), ‘ · ‘, ”); ?>
</p><div class=”postentry”>
<?php the_content(__(‘Read the rest of this entry »’)); ?>
<?php wp_link_pages(); ?>
</div><p class=”postfeedback”>
” rel=”bookmark” title=”<?php _e(‘Permanent link to’); ?> <?php the_title(); ?>” class=”permalink”><?php _e(‘Permalink’); ?>
</p></div>
<?php comments_template(); ?>
<div class=”postnav”>
<div class=”prev”><?php previous_post_link(‘« %link’) ?></div>
<div class=”next”><?php next_post_link(‘%link »’) ?></div>
</div><?php endwhile; else : ?>
<h2><?php _e(‘Not Found’); ?></h2>
<p><?php _e(‘Sorry, but the page you requested cannot be found.’); ?></p>
<?php include (TEMPLATEPATH . ‘/searchform.php’); ?><?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Try copy and paste this over your existing single.php content:
<?php get_header(); ?> <?php $showauthor = almostspring_showauthor(); $dateformat = almostspring_dateformat(); ?> <div id="content"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2 class="posttitle"> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent link to <?php the_title(); ?>"><?php the_title(); ?></a></h2> <p class="postmeta"> <?php if ($dateformat == 'default') { the_time(get_settings('date_format')); } else { the_time('F j, Y'); } ?> <?php _e('at'); ?> <?php the_time() ?> <?php if ($showauthor == 'true') { _e('by'); echo ' '; the_author_posts_link(); } ?> · <?php _e('Filed under'); ?> <?php the_category(', ') ?> <?php edit_post_link(__('Edit'), ' · ', ''); ?> </p> <div class="postentry"> <?php the_content(__('Read the rest of this entry »')); ?> <?php wp_link_pages(); ?> </div> <!-- end of div.postentry --> <p class="postfeedback"> " rel="bookmark" title="<?php _e('Permanent link to'); ?> <?php the_title(); ?>" class="permalink"><?php _e('Permalink'); ?> </p> </div> <!-- end of div.post --> <?php comments_template(); ?> <div class="postnav"> <div class="prev"><?php previous_post_link('? %link') ?></div> <div class="next"><?php next_post_link('%link ?') ?></div> </div> <!-- end of div.postnav --> <?php endwhile; else : ?> <h2><?php _e('Not Found'); ?></h2> <p><?php _e('Sorry, but the page you requested cannot be found.'); ?></p> <?php include (TEMPLATEPATH . '/searchform.php'); ?> <?php endif; ?> </div> <!-- end of div#content --> <?php get_sidebar(); ?> <?php get_footer(); ?>
Still doesnt seem to work…
Try fixing line 211 in comments.php….
Fatal error
: Call to undefined function: comment_favicon() in
/home/daniel/public_html/blog/wp-content/themes/almost-spring/comments.php
on line
211
I think this is stopping the parsing of the php a bit early…
What do I change?
Sweet! It works. You are the man (that is if you actually are a man).
AAAARGH! Now it displays ‘” rel=”bookmark” title=”Permanent link to John Safran’s Race Around the World” class=”permalink”>Permalink’ at the end of the post. WTF!?!
Above, where you posted the content of single.php, you will see these lines:
<h2 class="posttitle">" rel="bookmark" title="<?php _e('Permanent link to'); ?> <?php the_title(); ?>"><?php the_title(); ?></h2>
and
<p class="postfeedback"> " rel="bookmark" title="<?php _e('Permanent link to'); ?> <?php the_title(); ?>" class="permalink"><?php _e('Permalink'); ?>
These need a little work…
try replacing the first with:
<h2 class="posttitle"> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
and the second with:
<p class="postfeedback"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent link to <?php the_title(); ?>"><?php the_title(); ?></a></p>
– John (yes I’m a man lol)
(I think you already updated the first, from when I told you to paste over the original single.php earlier, so if you can’t find that code, this is why).
Cheers man, you’ve been a huge help.
You’re welcome, good luck with your site!
– John
- The topic ‘<!-more> tag strips my sidebar’ is closed to new replies.