Get posts by category name

list all the PAGES that are assigned to particular page(s). I’m assuming you mean “particular term(s).” which would be in your clinical-programs taxonomy. You’ll have to do a bit of coding – you need to start a new WP_Query and structure your query as such: $taxPages = new WP_Query( array( ‘post_type’ => ‘YOUR_POSTTYPE_HERE’, ‘clinical-programs’ => … Read more

Running a custom query inside another cpt single and trying to grab a variable

Does this work? global $post; // make sure the post object is available $slug = $post->post_name; // get the slug // insert the slug into your query $args = array( ‘post_type’ => ‘client_prop’, ‘posts_per_page’ => 10, ‘tax_query’ => array( array( ‘taxonomy’ => ‘prop_neighborhood’, ‘field’ => ‘slug’, ‘terms’ => $slug, ) ) );

Change categories count to include media attachments

You’ve probably solved this, but for anyone else that needs this: $wp_taxonomies[‘category’]->update_count_callback = ‘_update_generic_term_count’; This is significant in the case of attachments. Because an attachment is a type of post, the default _update_post_term_count() will be used. However, this may be undesirable, because this will only count attachments that are actually attached to another post (like … Read more