taxonomy list display custom post count

What makes this annoying is that the count is a wp_term_taxonomy table. So the way to do this is a custom query: function wpse340250_term_count( WP_Term $term, $post_type) { $q_args = [ ‘post_type’ => $post_type, ‘nopaging’ => true, // no limit, pagination ‘fields’ => ‘ids’, // only return post id’s instead of full WP_Post objects will … Read more

How to get dynamically custom post type that are under a certain category

I think you may accomplish this by using the following WP builtin features. $wp_taxonomies – global object, it stores all registered taxonomies including default and custom get_post_types() – get all registered post types including default and custom To be simple, the examples for their usage are separated below. You may then combine them to create … Read more

How to sort CPT by custom meta value (date), and return posts month by month

This isn’t complete copy/paste code, but hopefully it’s understandable enough to get you started. First step is to register your post type and add a rewrite rule to handle years/months. This will give you single events at event/post-name/, your post type archive at calendar, and handle incoming requests for calendar/yyyy/mm/. Make sure to visit your … Read more