0

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 ?

2
  • 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.
    – Brooke.
    Commented Oct 28, 2011 at 18:26
  • please have a look here pastebin.com/Xp8kcj6v
    – user8503
    Commented Nov 1, 2011 at 6:11

1 Answer 1

1
if($count == 1 && !is_paged() ) :

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

2
  • please explain how to use with this code ? <?php $count = 1; if (have_posts()) : while (have_posts()) : the_post(); if($count == 1) : ?>
    – user8503
    Commented Nov 1, 2011 at 6:35
  • the code is supposed to replace this section: if($count == 1) :
    – Michael
    Commented Nov 1, 2011 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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