• How to include another template file after 6th post in home page?

    example
    <?php include (TEMPLATEPATH . '/featured.php'); ?>

    My home.php codes

    <?php get_header(); ?>
    
    	<div id="bigcolumn">
    <?php include (TEMPLATEPATH . '/featured.php'); ?>
    <?php
       if (is_home()) {
          query_posts($query_string . "&cat=-1");
       }
    ?>
    	<?php if (have_posts()) : ?>
    
    <div class="page-all">
    	<div class="page-top">
    	<div class="containerI">
    
    <?php while (have_posts()) : the_post(); $loopcounter++; ?>
    	<div id="post-<?php the_ID(); ?>" class="post item">
    	<h1><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
    	<div class="postinfo"><?php print WRITTEN; ?> <?php print ON_TEXT; ?> <?php the_time('j M, Y'); ?> <?php print AT_TEXT; ?> <?php the_time('G:i'); ?> <?php print IN_TEXT; ?> <b><?php the_category(', ') ?></b> | <?php print VIEWED; ?> <b><?php if(function_exists('the_views')) { the_views(); } ?></b> <?php print TIMES; ?> | <a href="<?php the_permalink(); ?>#comments"><b><?php comments_number(NO_COMMENTS,ONE_COMMENT,MORE_COMMENTS); ?></b></a> <?php edit_post_link(EDIT_ARTICLE, '', ''); ?></div>
    	<div class="post-thumb"><?php show_thumb($options['GTwidth'],$options['GTheight'],$options['crop'],$options['quality']); ?></div>
    	<p><?php print do_excerpt(get_the_excerpt(), 70); ?></p>
    	<div class="clear"></div>
    	</div>
    <?php if ($loopcounter <= 1) { include (TEMPLATEPATH . '/random.php'); } ?>
    		<?php endwhile; ?>
    <div id="pagenavi">
    	<!-- Plugin Navigation -->
    <div class="tools">
    	<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
    </div>
    	<!-- End -->
    </div>
    	</div>
    	</div>
    	</div>
    
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    		<?php get_search_form(); ?>
    
    	<?php endif; ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to include another php file after 6th post in home page’ is closed to new replies.