Support

Account

Home Forums General Issues Is it possible to sort pages by a field that is within a field group? Reply To: Is it possible to sort pages by a field that is within a field group?

  • Thanks, but I had tried this already and it doesn’t seem to work. It is still ordering child pages by their number order 🙁

    Here is my code if it can help:

    
    $args = array(
        'post_type'      => 'page',
        'posts_per_page' => -1,
        'post_parent'    => '13',
        'order'          => 'ASC',
        'orderby'        => 'meta_key',
        'meta_key'       => 'parameters_location'
    
     );
    
    $parent = new WP_Query( $args );
    
    if ( $parent->have_posts() ) :
    
    while ( $parent->have_posts() ) : $parent->the_post();
    
    # do this and that and display this and that
    
    endwhile;
    endif; wp_reset_postdata();
    
    ?>