Tagged: , , ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #366992


    I’ve read this article
    and also searched around the forum quite a bit but I’m still wondering if it’s possible to order posts by a custom field.

    For example I could add a ‘priority’ field and add numbers 1,2,3… and order in ascending order. Would that be possible?

    Thanks in advance!


    Hi AlexKK!

    Have you considered using the post types order plugin? https://wordpress.org/plugins/post-types-order/

    You can drag the posts around to create a custom order.

    Best regards,


    Thank you for your answer

    I’ve tried that already and it didn’t work for me because I’ve enabled the next and previous sliders to search within a single category only and this plugin cancels that.



    try this code:

    query_posts('meta_key=your key&meta_value=your value');
    <?php if ( have_posts() ) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php the_title();?>
        <?php endwhile; ?>
         <?php endif; ?>
        <?php wp_reset_query();?>

    Key is what you named the field, the value is what you enter in the field.

    You can use it in a php widget as well as in a page template.
    Also you can use it within the meta div of single.php, so the fields would appear with other meta.

    Best regards,

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.