Last active
December 24, 2020 11:14
-
-
Save agragregra/26491e810318080b4744 to your computer and use it in GitHub Desktop.
WordPress WP_Query by term name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$term = $wp_query->queried_object; | |
$args = array( | |
'post_type' => 'specialists', | |
'posts_per_page' => -1, | |
'category_name' => $term->name | |
); | |
$query = new WP_Query( $args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment