WordPress.org

Ready to get started?Download WordPress

Forums

Double category order (2 posts)

  1. Kovas
    Member
    Posted 3 years ago #

    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).

  2. Kovas
    Member
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic