0
votes

To be brief, following a tutorial, I didn't get to the part of the "main content" yet so like I usually do, i jumped ahead and put the main content in the sidebar. So in my "php get_sidebar()" I have my main content and my aside. Even though it's not in it's ideal format, my page looks fine. Blogs are displaying and all is well. Mind you, my "php the_excerpt()" is in my main content but everything is still good. Then we get to the part where he says to create a home.php page and place my main content there which is bordered by the php get_header & php get_sidebar like it should. I thought easy enough a cut and past of my main content out of my sidebar and into the home.php (Basically copying everything from the index.php into the home.php with the extraction of my main content OUT of my sidebar and placed inside home.php)

<?php get_header(); ?>

<section>
    THIS IS MY TRUNCATED MAIN CONTENT

    <div id="posts" class="regions">
        <?php query_posts("posts_per_page=1"); ?>
        <h4><span>Blog</span> City</h4>
        <div id="post_content">
            <p><?php the_date(); ?></p>
            <img src ="<?php bloginfo('template_directory'); ?     >/images/midpic.jpg" width="200px" height="118px"/> 
            <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
            <p><?php the_excerpt(); ?></p>
        </div>
    </div>


<!--<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Sidebar   Widgets')) : else : ?>-->
    <!-- All this stuff in here only shows up if you DON'T have any widgets active in this zone --> 
<!--<?php endif; ?>-->


</section> <!--End of Section-->

<?php get_sidebar(); ?>

<?php get_footer(); ?> 

So my problem is that the blog and date were displaying when it was incorrect but now that it's in the home.php and formatted correctly, the php the_date and the php the_excerpt is not displaying. Any specs as far as what page shows my blogs? and FYI I tried this in the index.php as well as home.php and no dice. But if I put my main content back in the sidebar all is well. Any pointers will be greatly appreciated.

1

1 Answers

0
votes

Perhaps I'm missing something but what is home.php used for? Usually single post template files are called single.php.

Also, for full posts you should be using <?php the_content(); ?>.

Documentation on the_excerpt() and the_content().