Query Custom Post Type with certain identifier
-
I have a custom post type called “testimonials” and within that custom post type I have a checkbox called “show_on_page”. What I need to do is call two of those testimonials that have the “show on page” checkbox checked on my homepage.
My query looks like this… but I can’t figure out how to only grab posts that have the “show_on_page” box checked.
$args = array ( 'post_type' => 'testimonials', 'posts_per_page' => 2, 'orderby' => 'RAND' ); $custom_query = new WP_Query( $args ); if ( $custom_query->have_posts() ): while ( $custom_query->have_posts() ) : $custom_query->the_post();
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Query Custom Post Type with certain identifier’ is closed to new replies.