Saturday, 15 February 2014

wordpress - No blog excerpt in index.php -



wordpress - No blog excerpt in index.php -

to brief, next tutorial, didn't part of "main content" yet do, jumped ahead , set main content in sidebar. in "php get_sidebar()" have main content , aside. though it's not in it's ideal format, page looks fine. blogs displaying , well. mind you, "php the_excerpt()" in main content still good. part says create home.php page , place main content there bordered php get_header & php get_sidebar should. thought easy plenty cutting , past of main content out of sidebar , home.php (basically copying index.php home.php extraction of main content out of sidebar , placed within home.php)

<?php get_header(); ?> <section> 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 : ?>--> <!-- stuff in here shows if don't have widgets active in zone --> <!--<?php endif; ?>--> </section> <!--end of section--> <?php get_sidebar(); ?> <?php get_footer(); ?>

so problem blog , date displaying when wrong it's in home.php , formatted correctly, php the_date , php the_excerpt not displaying. specs far page shows blogs? , fyi tried in index.php home.php , no dice. if set main content in sidebar well. pointers appreciated.

perhaps i'm missing home.php used for? single post template files called single.php.

also, total posts should using <?php the_content(); ?>.

documentation on the_excerpt() , the_content().

wordpress

No comments:

Post a Comment