Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This is my category page code

<--Featured Post start-->

<?php 
$count = 1;
if (have_posts()) : while (have_posts()) : the_post(); if($count == 1) : ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title=""><?php the_title(); ?></a>

<--Featured Post start-->
<?php else : ?>

<--Rest of Posts -->

<a href="<?php the_permalink() ?>" rel="bookmark" title=""><?php the_title(); ?></a>

<?php if (function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
<?php } ?>

i dont want featured post to be display after first page, how to prevent ?

share|improve this question
1  
how are you deciding on the "featured post?" are you grabbing the first post or is there a tag/cat you are looking for? Your code above is a bit confusing. –  BandonRandon Oct 28 '11 at 18:26
    
please have a look here pastebin.com/Xp8kcj6v –  user8503 Nov 1 '11 at 6:11
add comment

1 Answer

up vote 1 down vote accepted
if($count == 1 && !is_paged() ) :

http://codex.wordpress.org/Function_Reference/is_paged

share|improve this answer
    
please explain how to use with this code ? <?php $count = 1; if (have_posts()) : while (have_posts()) : the_post(); if($count == 1) : ?> –  user8503 Nov 1 '11 at 6:35
    
the code is supposed to replace this section: if($count == 1) : –  Michael Nov 1 '11 at 8:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.