I think you would be better off using get_posts
or a new WP_Query
instead of get_term_by
. That would allow you to get posts for your custom post type, and then filter by taxonomy/term name.
If you’re comfortable enough with WP Query you could try something like this: Query posts by taxonomy term name
Related Posts:
- taxonomy list display custom post count
- IF statement in a do_shortcode
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- get_queried_object error How to show post count by month in the taxonomy page
- WP_Query is printing out only one post when posts_per_page is set to multiple
- count_many_users_posts except current logged in user?
- WordPress Count posts within a custom post type
- Display custom post counts for author , not default posts
- How do I find the count of the current post?
- Get queried object for custom post type count
- Display posts from another page on home page in wp-editor
- Hide load more button if no more post in selected category
- Display the progress of post achievement with percentage against target in wordpress dashboard
- Query/list all terms and their custom post count
- Show the same Article Available in Other Categories
- Getting posts under the custom post type ui category
- How to make sure content doesn’t display if selection is empty
- Storing posts from query and accessing later via AJAX call
- If post has custom field then display css-class
- Display only one post each WEEK
- List children on child post
- Restrict custom post type from appearing with ?post_types=
- Show custom post type filtered by category
- Get custom post type list for every category shortcode
- create parent post using wp_insert_post
- Turn on and off custom post type from admin?
- Missing Posts in Custom Taxonomy List
- Display random posts, but omit the post it is on?
- How do I do this with WordPress? Taxonomies?
- Disable block with taxonomies at post page
- I would like to have different styles for my posts based on the content of each post
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Showing posts from different categories and from custom post type
- Get latest 3 posts from multiple CPT in one query
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Which post does a taxonomy term belongs to?
- List custom taxonomy specific to one custom post type
- Post image in WordPress not appearing on home page
- How to add a custom-post-type post within another custom-post-type post edit screen using AJAX?
- Meta query for custom post type ignored in main query
- Changing custom type name hides the posts
- Display Ad on Specific Categories
- Hiding posts by other users and non-logged in
- Update Post Meta for a logged in user
- Add custom field to Posts and sort by it
- Add custom post type settings to wordress default posts
- Get related posts of child term of custom post type
- Two Custom Post Types Many to Many Relationship
- Problem with displaying posts in the CPT category
- Post count by month of taxonmy term
- JS innerhtml changing style when using AJAX
- Show titles, date of all posts on single category page
- Side effects of Script and Iframe in post
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- How to change the post type a theme shows by default?
- How to render a custom post type template with custom fields using shortcode
- Set a checkmark in a category based on a URL-parameter
- Several post types on WP Query by tag and taxonomy
- No Permission to add new Page, Post or CPT with Admin role
- Form action/link to render a plugin in WordPress front-end
- Update postmeta Parent when post_status child change
- Portfolio Page for Classic Posts
- Add post location with mile radius allowing search
- Display Child Pages of Custom Post Type Parent Page
- Get the category from custom post type
- Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?
- Set up post page like JAMA articles
- Custom Post Slug same as Parents Category Slug
- Shortcode not working with post counter
- Shortcode to display Staff post type based on Location post type and Specialty post type
- Changing default ‘posts’ parameters with register_post_type_args
- Admin Column does not populate with data
- How to integrate a form (Ninja Form or Contact Form 7) with Custom Post Types?
- wp_reset_postdata() and wp_reset_query() inside shortcode are not working to reset original page query
- Shortcode for CPT post content in a page
- Prioritize posts in query by meta keys?
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Allow users to create posts without logging in?
- Next Post links not working in custom post type shortcode
- How to get all tags of a custom post type by id
- How to define which register_post_status goes to which register_post_type?
- Foreach inside shortcode not working as planned
- Load Next Posts With AJAX not working with custom post type
- Limit the post for differents custom post type in the same wp_query
- 2 Different Custom Post Types in Submenu
- How to assign classes to all elements?
- How can I show 1 featured post in a styled element, and the next few below differently styled
- Some posts from custom post type to subdomains
- How can i create an custom post template for an specific post category? [closed]
- How to sort posts in a custom post type by title in ascending order by default?
- Redirect to another page using contact form 7? [closed]
- How to display author post count for multiple custom post types?
- WP the_posts() on single-cars.php get category link
- Conditional for a Single Post That Belongs to a Category?
- Can a shortcode included in post content add styles to the ?
- $post not working working in AJAX plugin with custom post type
- How to retrieve category of a post in have_post loop?
- Permalink misbehaving in Custom Post Types
- Check post on publish for blank title
- how to check if custom post title exists or not?