WordPress.org

Ready to get started?Download WordPress

Forums

My Post Order
[resolved] Can't get it to work on posts Page (4 posts)

  1. Okoth1
    Member
    Posted 1 year ago #

    Hi,

    I have a Page with several posts on it that I want to order.
    This is the start of the loop.

    <?php while(have_posts()) : the_post();
    $myposts = get_posts('category_name="produk" &order=ASC');
    foreach($myposts as $post) :
    setup_postdata($post);
    ?>

    I've tried with the query_posts('section_name=productsorder') at the top, but I couldn't get it to work

    Thanks

    http://wordpress.org/extend/plugins/my-posts-order/

  2. Kapil Chugh
    Member
    Plugin Author

    Posted 1 year ago #

    What is the URL?

    Try to deactivate other post order related plugins.

  3. Okoth1
    Member
    Posted 1 year ago #

    Still on XAMPP.

    I don't have other order related plugins.

    When I remove &order=ASC from the code above also no effect.

    To be clear, it's not a Archive Page but a regular Page with posts on it.

  4. Okoth1
    Member
    Posted 1 year ago #

    Fixed it.

    $productorder = array(
       'meta_key' => 'produkorder',
       'orderby' => 'meta_value_num',
       'order' => 'ASC',
       'meta_query' => array(
           array(
               'key' => 'produkorder',
               'value' => array(1, 2, 3, 4),
               'compare' => 'IN',
           )
       )
     );

    Which also mean that I don't need to use your plugin anymore...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.