WordPress.org

Forums

How to make feature post section disappear in next page (4 posts)

  1. michael
    Member
    Posted 6 years ago #

    In my index.php I display a feature post by pulling from the feature category, then shows my latest posts underneath it. But as soon as you hit the "previous posts" link - the feature post stays on top. How do I make this disappear?

    Below is my code:

    <?php include('feature-post.php'); ?>
    <?php get_sidebar();?>
    <div id="content">
    <?php if (have_posts()) : while (have_posts()) : the_post();
      if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
    
    	<div class="postBox">
    	<img src="<?php echo get_post_meta($post->ID, 'thumb', $single = true); ?>" class="thumbs"   />
    	<h4><a href="<?php the_permalink() ?>" title="<?php the_title() ?>"><?php the_title();?></a></h4>
    	<div class="postBox-entry-content">
    	<?php the_excerpt();?>
    
    	</div><!--postBox-entry-content-->
    
    	</div><!--postBox--> 
    
    <?php endwhile; endif; ?>
    	<div class="nav-previous"><?php next_posts_link('&laquo; Next page') ?></div>
    				<div class="nav-next"><?php previous_posts_link('Previous page &raquo;') ?></div>
  2. michael
    Member
    Posted 6 years ago #

    An example of what I'm talking about: In WP-premium's homepage - you see a feature image above the rest of the thumbnails. But as soon as you hit next page, that feature image is not included with the rest of the thumbnail posts. Anyone please shed some light!

  3. michael
    Member
    Posted 6 years ago #

    i plugged in this code but still didn't work:
    <?php if(is_home()){include('feature-post.php');} ?>

    please help

  4. longjorn
    Member
    Posted 6 years ago #

    If you didn't find a solution yet,
    I use this kind of code in index php

    <?php if ( $paged < 2 ) { // Do stuff specific to first page?>
    <?php
     // Include tabs with the lead story
     include(TEMPLATEPATH . '/feature-post.php'); ?>
    <?php } // end specific to first ?>

    my feature post php is in the theme folder...

    please tell us if it works or how you did it now

Topic Closed

This topic has been closed to new replies.

About this Topic