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(); ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We demoed ACF 6.1 Beta during the most recent session of ACF Chat Fridays, highlighting the new ability to regenerate and clear labels, setting the Admin Menu Parent as a slug, and more. Catch the video replay in our latest summary. https://t.co/rHEpPVas64 pic.twitter.com/hB1XKTexXi— Advanced Custom Fields (@wp_acf) March 23, 2023
© 2023 Advanced Custom Fields.