• Resolved amrmosaad

    (@amrmosaad)


    I want to hide the first 6 recent posts in this code because i use a slider in the template an its posts appear in recent posts also so i want recentposts.php to show from the 7th recent post not from the fist one

    <div class="box_inner cat_box recent_bd" >
      <div class="news_box">
        <h3 class="news_box_title2">
          <?php echo $GLOBALS['v']['title']; ?>
        </h3>
        <ul>
          <?php query_posts(array('showposts' => $GLOBALS['bd_total_posts'], 'cat' => implode(',',$GLOBALS['bd_cat_id']) )); ?>
          <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
          <li>
            <div class="inner_post">
              <div class="post_thumbnail">
                <a href="<?php the_permalink();?>" rel="bookmark">
    	            <?php $timthumb = bdayh_get_option('timthumb'); if($timthumb == true) { ?>
    	            	<img src="<?php echo BD_URI ?>/timthumb.php?src=<?php echo bd_post_image('large'); ?>&h=69&w=69&zc=1" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
    	            <?php } else { ?>
    	            <?php
                        $thumb = bd_post_image('large');
                        $ntImage = aq_resize( $thumb, 69, 69, true );
                        if($ntImage == '')
    	                    {
    							$ntImage = BD_IMG .'/default_thumb.png';
    	                    }
                        ?>
    		            <?php if (strpos(bd_post_image(), 'youtube')) { ?>
    		            	<img src="<?php echo bd_post_image('large'); ?>" width="69" height="69" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
    		            <?php } elseif (strpos(bd_post_image(), 'vimeo')) { ?>
    		            	<img src="<?php echo bd_post_image('large'); ?>" width="69" height="69" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
    		            <?php } elseif (strpos(bd_post_image(), 'dailymotion')) {?>
    		            	<img src="<?php echo bd_post_image('large'); ?>" width="69" height="69" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
    		            <?php } else { ?>
    		            	<img src="<?php echo $ntImage; ?>"  alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
    		            <?php } ?>
    	            <?php } ?>
                </a>
              </div><!--//post_thumbnail-->
              <h2>
                <a href="<?php the_permalink();?>" rel="bookmark">
                	<?php the_title();?>
                </a>
              </h2>
              <div class="post_meta">
                <a class="date">
                	<?php the_time(get_option('date_format')); ?>
                </a>
              </div>
            </div>
          </li>
          <?php endwhile; endif;?>
          <?php wp_reset_query(); ?>
        </ul>
      </div>
    </div>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    As far ad I know some plugins(for example Frongpage Category Filter)
    have such functions.

    Best regards,
    Eugene

    Here offset will do the job.

    Add following line before the loop.

    <?php query_posts(array(
    
      'showposts' => $GLOBALS['bd_total_posts'],
      'cat' => implode(',',$GLOBALS['bd_cat_id']),
      'offset' => 6
    
    )); ?>

    offset excludes most recent posts from a loop.In your case it is 6.

    Thread Starter amrmosaad

    (@amrmosaad)

    Gyanendra Giri Thanks very much it worked just fine.

    kalashnikovevg Thank you I will definitely try this plugin.

    You are welcome.
    Make this topic resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to hide the recent 6 posts in recentposts.php ?’ is closed to new replies.