To query for multiple post types you would add an array() of post types instead of just querying for one.
1 2 3 4 5 6 | $args = array( 'post_type' => array( 'testimonial', 'post' ), 'posts_per_page' => 1, ); $query = new WP_Query( $args ); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.