WordPress post loop and page template
-
i am strugling with huge problem ?? Whole day i am trying loop to work. I use default wordpress theme. if i put loop on index.php or home.php posts are working fine. And if i put loop in some pate templte for example blog-template.php i get blank screen ?? How loop work on index.php or archive.php or categories.php but not on any page templates???
<?php if ( have_posts() ) : ?> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php twentythirteen_paging_nav(); ?> <?php else : ?> <?php get_template_part( 'content', 'none' ); ?> <?php endif; ?>
As i said with this code on index.php i get graet results along with prev/next page buttons. But if i use on template file i got blank screen? Please help
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘WordPress post loop and page template’ is closed to new replies.