the_content() in single.php
-
Hi,
I am having issues with the_content() and the_excerpt() and I hope someone may have a solution.
the_content() is not displaying any content when using single.php. I’ve tried all the usual trouble-shooting stuff (disabled plugins etc) to no avail. The post is displayed when switching to twentytwelve however replacing the code in my single.php with the code from the 2012 one does not fix the issue.
<div id="leftcol" class="span8"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <article class="post"> <div class="post_content"> <figure><?php if ( has_post_thumbnail() ) {the_post_thumbnail();} ?></figure> <?php the_content(); ?> </div> </article> <ul class="pager"> <li class="previous disabled"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentytwelve' ) . '</span> %title' ); ?></li> <li class="next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentytwelve' ) . '</span>' ); ?></li> </ul> <?php endwhile; // end of the loop. ?> <?php endif; ?> </div>
Using echo $post->post_content; does work but also causes issues with image captions displaying the html.
My issue with the_excerpt() is in the index.php though I suspect that these 2 issues are related.
Cheers,
Dan
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘the_content() in single.php’ is closed to new replies.