Forums

Post content won't load on single post page (2 posts)

  1. epait
    Member
    Posted 1 year ago #

    I'm trying to create my single post page for my blog, but the content of the post won't display on the page. My comment box, title, and date all show up, but the content doesn't even show up in the page source. Here is my code:

    <?php get_header(); ?>
    
    	<div id="main">
    		<div id="title" style="color:#56A0D3"><h2><?php the_title(); ?></h2></div>
    		<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
     <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
    		<?php $content = get_the_content(); ?>
    		<div class="comments"><?php comments_template();?></div>
    	</div>

    website is http://www.ericpait.com/blog

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    a:
    the code for the loop might be missing;
    http://codex.wordpress.org/The_Loop_in_Action

    b:
    you only assign the content to a variable - without echo this will not get displayed.
    http://php.net/manual/en/function.echo.php

Topic Closed

This topic has been closed to new replies.

About this Topic