Tagged: , , ,

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

    Hello!

    I’ve read this article
    http://kriesi.at/documentation/enfold/how-to-add-an-orderorderby-option-to-the-blogpost-sliderportfoliomasonry-grid-element/
    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!

    #367325

    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,
    Elliott

    #367400

    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.

    #367868

    Hi!

    try this code:

    <ul>
    <?php
    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();?>
     </ul>
    

    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,
    Andy

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