WordPress.org

Support

Support » How-To and Troubleshooting » Double category order

Double category order

  • Kovas

    @zerocore

    Hello,

    Let’s say I have multiple posts in category ‘items’ and some of those posts are also in category ‘special’. All of them are sorted by date.

    Is there any way to sort those posts so posts in category ‘special’ would be on top of other ‘items’?

    I’ve tried something like this:

    <?php while (have_posts()) : the_post(); ?>
       <?php if ( in_category('special')) : ?>
          ...
    <?php endif; endwhile; ?>
    <?php while (have_posts()) : the_post(); ?>
       <?php if ( ! in_category('special')) : ?>
          ...
    <?php endif; endwhile; ?>

    But it works weird with WP-PageNavi (‘special items’ go to the last page).

Viewing 1 replies (of 1 total)
  • Kovas

    @zerocore

    So, does anyone know? This can’t be very hard. But i’m just missing something I guess.

Viewing 1 replies (of 1 total)
  • The topic ‘Double category order’ is closed to new replies.
Skip to toolbar