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
- Remove slug from custom post type post URLs
- How to get post content by calling ajax?
- Get category id from post id of a custom post type
- Limit widget to a specific registered sidebar
- WP_List_Table Inside Metabox Not Working on Submit
- Showing current taxonomy terms
- Newer/Older posts links display same posts on every page
- WordPress Custom Shortcode Conflicting with Media Library
- automatically create taxonomy with same name as post title
- custom sortable column
- saving custom post type data to different table in wordpress
- Display “Post 2 of 4” on single post page?
- Query post types with multiple keys
- How to embed form data within the ‘Add new post’
- When viewing single parent post, display list of children
- Limit Authors to their Own Posts on front-end excluding admins
- Remove Post Page “View Post” Link
- Using shortcodes to parse POST request (containing the data from a front-end form)
- Get all posts WHERE custom_field is LIKE value
- How to make post sticky in the admin page?
- Loop on front-page.php
- Shortcode doesn’t display in custom post type
- Add category attribute to custom shortcode
- How to create custom boxes with text inside?
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- How to make sure content doesn’t display if selection is empty
- Disable block with taxonomies at post page
- Which post does a taxonomy term belongs to?
- Changing custom type name hides the posts
- Add custom field to Posts and sort by it
- Two Custom Post Types Many to Many Relationship
- Problem with displaying posts in the CPT category
- 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?
- No Permission to add new Page, Post or CPT with Admin role
- Update postmeta Parent when post_status child change
- Set up post page like JAMA articles
- Shortcode not working with post counter
- Changing default ‘posts’ parameters with register_post_type_args
- Allow users to create posts without logging in?
- Redirect to another page using contact form 7? [closed]
- Check post on publish for blank title
- Different Limit number of post on different archive page
- How to change “post_class()” for a custom post type?
- Help With Warning on creating new Post types?
- Including link to custom post type in ‘wp_list_pages’ function
- Get an array wich contains the post_name of every post that has the custom post_type “pelicula”
- Custom post types and ‘new WP_Query’
- Showing custom post type categories in the menu
- I can no longer post or even save a draft, getting the error “A post type mismatch has been detected.”
- Shortcode is displaying the content on top of the page [duplicate]
- how to count the current posts terms
- Dynamic pages for linked categories and content
- Separate Content from gallery (custom post type)
- How to set the mainpage of a custom post type?
- displaying content of custom post type
- Looking to Customize YouTube Video Embeds
- Does “Custom Post Type” can have page hierarhy option?
- How set template for “custom post type” individual post
- A sports wordpress website
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Settings -> Reading -> Posts Page ->Blog — is not working in my website
- Is it possible to get the specific content on the search page?
- How to mass get post editor URLs
- SELECT custom post type and its meta in SQL
- How can I use javascript in specific posts without relying on a plugin?
- how to display posts content on the custom css popup by clicking on each title on the sidebar?
- How to show custom post count in archive page
- How to create editable sections in wordpress?
- Instructor can view, edit, delete only theirs courses
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- subtracting the current post form then whole loop, which is generating all CPT titles
- Assign for all post of a post type a specific single-post template
- Widget area for individual posts (custom post type)?
- Shortcode in excerpt
- update a posts of other custom post type
- Show custom post type under last posts configuration
- Custom Post Type used for FAQs Accordion
- Custom Post Type vs Shortcode: Which one is more performant?
- How to Associate Posts with Pages
- delete custom post type using a submit form
- Why are my wp urls showing page not found?
- Post content stays the same but permalink changes ?
- Can I set a CPT title field to a dropdown with preset options if user is of a given type?
- Styling first post using Advanced Custom Fields
- How do I display the index position of a post from a custom post type?
- how to show Author post type count
- Two pagination in one page without AJAX