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 ?

  • 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. Oct 28 '11 at 18:26
  • please have a look here pastebin.com/Xp8kcj6v – user8503 Nov 1 '11 at 6:11
1
if($count == 1 && !is_paged() ) :

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

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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