If you are using WP_Query you can search for tags using this code:
$query = new WP_Query( array( 'tag' => 'cooking' ) );
For more tag options see this page: https://developer.wordpress.org/reference/classes/wp_query/#tag-parameters
Related Posts:
- Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?
- wp_query ‘s’ parameter does not work with custom post type
- Filter Custom Post Type by Category with Ajax
- Search results posts_orderby and ID
- Dynamically switch template on click
- What would causes search to return incorrect results?
- search form for custom fields
- Redirecting wordpress search query to archive page
- WordPress search for specific Post Type
- Customize search results to include custom posts and display in a specific template page
- How can i retrive the movies, trailers, news in a single page using search
- Custom Post Title as search term
- Custom Post Types, slug, archive and SEO plugins
- Using single.php from plugin folder instead of default template folder
- how to enable different number of revisions for different blogs when using WPMU?
- Unattaching images from a post
- Post from front-end only by logged in users, form posts as “posted by:
- Load post content into div with ajax
- “Uncaught SyntaxError: Unexpected token
- Allow role to delete posts but block him the wp-admin
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- How can I get all posts data from within a paginated search result?
- Using Custom Posts with Metaboxes and Drop-downs
- how load content as pop-up using ajax
- Load content in a div with ajax
- How to show featured image in custom post type dashboard post page
- How to create a load more post entries like Twitter?
- Private Posts/Pages & Search
- Archive Page for Custom Post Type is not Working
- slideshow is not showing in a post call with ajax
- Posts vs. Pages
- how to set beforsend option in wordpress ajax methods
- Dynamic carousel on individual posts
- Ajax posts filter by date, comments, top views, top likes
- JSON – Permission Error?
- How to add pagination in between post and comments?
- WP_Query with ajax handler returns the same posts
- Print all the tags from a custom post type Please
- Display multiple custom taxonomy values on single custom post types page?
- Show posts by a custom post author
- Custom loop pagination links not working
- wp-cli post create & media import issues
- Getting value from get_post_custom
- custom post template file not shown, instead all the time 404.php
- Set Default Category to Username
- show custom post type category dropdown sorting result on same page
- Custom Post Type Rewrite To Include Parent Page(s)
- How do I insert a post with custom post type and relate it to a custom taxonomy?
- Custom taxonomy archive page problem
- Tell WP to use a specific template file in posts
- Two Custom Post Types with Identical Articles Competing for the same Slug
- Custom Post Type archive
- See if a post has a specified tag
- if in category but only with post meta
- Custom home page with full post for first one only
- After ajax image is outside the “ tag
- Display value of custom field at the beginning of a post
- Can WordPress handle following functionalities?
- Hide parts of the post content after typing it’s name or searching it by category
- search content of pages and list in wp-admin
- Custom post type slideshow background images to insert in a plugin
- Trying to exclude custom posts based on date, while sorting by custom field
- Changing permalink of WordPress
- Hook save_post_cpt not triggered when custom fields are modified
- Search for custom field input of a custom post type in ajax live search
- Alt text attributes not showing over portfolio images
- Adding an option to post editor to show a site disclaimer or message
- Unable to delete attached file from folder programmatically
- Javascript – How do I get specific post fields?
- How to search through “post title” and “tags” using WP_Query?
- WordPress Pods Custom Post Type – separate Media Upload folder for each custom Post Types
- Hide or remove custom post status
- Put page on Archived statut after end of publication date
- post and page and custom post type
- My posts page is missing the page title
- Order result from ajax
- How can change header text in post careate/edit form
- How to get meta data from custom category name
- Ajax the create and edit post form into lightbox and get results
- Add Categories To Custom Post
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- how to redirect page after delete post inside a post page?
- Permalink base only for posts
- Difference between modified post and new post
- Custom author search
- Creating widget – ask for selecting a post in the admin panel
- issue in wordpress auto delete post and redirect to another 1
- Ajax – Post Categories and Load More
- Customizing individual images on posts
- Custom Single Post Type not referring to single-post-type.php File
- Run Jquery Script after delete post in front end
- “Current” class on a singular page menu item with custom post types?
- Successive creation of over 1000 posts causes 404?
- How can I allow users (subscribers) to download selected posts into a single PDF? (RESOLVED)
- Choose options via url
- Custom Post Type Pagination 404 Error (if paged>=2) [duplicate]
- Display ONLY Latest Post From Several Categories
- custom post type single page template not working
- Display post structure in function
- Default post type doesn’t display in url