Displaying posts where a certain custom field is equal to a GET variable
-
$args = array( 'post_type' => 'earnings', // use to be stock 'posts_per_page' => 1, 'offset' => $_GET['offset'], ); $the_query = new WP_Query( $args ); while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
I have a section of my website that is suppose to display some posts from post_type “earnings”.
However, I want to show results from posts where the custom field ‘sector’ is equal to a value taken from a GET variable in the URL.
Does anyone know how to modify the above code? I’ve tried a lot of things but have not been successful.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Displaying posts where a certain custom field is equal to a GET variable’ is closed to new replies.