I tried all solutions given on this site or other websites but did not find success in sorting posts according to custom field payment package. I tried below code
$args = array( 'meta_key'=>'et_payment_package','meta_key'=>693 );
// Variable to call WP_Query.
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) :
// Start the Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
the_title();
the_excerpt();
// End the Loop
endwhile;
else:
// If no posts match this query, output this text.
_e( 'Sorry, no posts matched your criteria.', 'textdomain' );
endif;
wp_reset_postdata();
It shows
Sorry, no posts matched your criteria.
Your query arguments are wrong. You have
meta_key
twice. Try withAnd try to specify the post type.
For instance:
I don’t have all the details (post type etc), but this is how you’d go about it. Hope it helps.