The is_tag()
conditional tag returns true if fed an existing tag slug or an array of existing tag slugs.
If used without an argument, as you currently are doing, it returns true when on a tag archive page.
I am assuming your above custom loop is not an archive page?!
If so, is_tag()
returns false and your query isn’t run.
Also note that, if this is a secondary loop/query, you should use the WP_Query
class instead. Read why.
Related Posts:
- Searching multiple custom post types and pages
- tag.php doesn’t work with tags on a custom post type post?
- Get page by template?
- Exclude Custom Post Type & Pages From Auto-Tag Function
- Trying to edit the single page from a Custom Post
- Setting a homepage – doesn’t seem to work
- Add custom template ‘sub-page’ to Custom Post type?
- Custom Post Type tag taxonomy “Page Not Found”
- query_post while (have post) get_template_part()?
- Using custom post types within a section of a template
- Trouble with CPT Child 404
- Database to page routing API?
- How to make tag post listing page working?
- Custom taxonomy and custom post type – wrong permalinks and template
- Assign same parrent Page to pages AND custom post types
- Can I override a CPT template on a per post basis with Gutenberg block editor?
- How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
- Allow Static Page Load Dynamic Child Pages
- No Permission to add new Page, Post or CPT with Admin role
- Content vs Template on custom post
- How to use custom template files in deeper directory?
- WordPress Doesn’t Generate Taxonomy Archive
- A case for Hierarchical Custom Posts
- Static page determines as home, but it is not
- Custom taxonomy returns 404
- Show Custom Post Type meta boxes only on Page Edit
- Filter widget outputs
- Cross reference custom post types
- Why does my content disapear when I make a page to match an archive name?
- Adding Page Templates to post but it ignored it
- How to use Custom Page Templates for hierarchical Custom Post Type
- Template for all categories of a custom post type?
- How to get all tags of a custom post type by id
- Migrating a taxonomy’s tags to the native category
- Flush Rewrite Rules when new site is created on network
- Top Level pages in wordpress giving 404, but child pages working fine
- How can I show 1 featured post in a styled element, and the next few below differently styled
- Page for custom post type
- WordPress custom taxonomy template not working
- How can I get this request to use the Custom Post Type page template instead?
- How to specify a template for a path like http://example.com/something?
- Custom templates for a specific category
- Archive for a Taxonomy of a Custom Post type
- Why does not this wp_redirect work in is_single()?
- Why is get_pages() returning a boolean?
- Custom post type pages return 404 page?
- Pros and cons of a custom page vs custom post type template file
- Show all tags on custom post type
- WordPress 3.9 not using custom template
- Best way to specify “article type” in URL
- How to include custom post type posts on a page?
- Tag page only display 10 posts
- data-type=”” … needed post tags stripped of characters
- Template files for Custom Post Type and Taxonomy
- Set templates for custom post types
- How to Create Template File for Parent Page of Custom Post Type
- Dynamically output a class to an anchor tag depending on what tag is chosen
- Custom post_type search pages
- Including link to custom post type in ‘wp_list_pages’ function
- Creating tags via API
- how to remove pages loading with the archive templates
- the_content(); of custom post type treated as an array or object
- Main query not querying any posts in custom taxonomy template
- Custom Empty Results page for my Custom Post Type
- How to display custom post type tags?
- Multiple pages per post (not pagination)
- Custom posts template page
- Display posts with tag for custom post type only
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- Can I change my post type to anything and my site still work?
- How can I use archive-{post_type}.php theme template?
- Meta data (Tags and Categories) for Custom Posts not showing.
- Page listing Custom Posts
- get_the_tag_list() returns bad links
- Display an authors post on a single page only when they are logged in
- Tags not working in my custom post type
- Why are some of my custom posts not showing up on my page?
- How to list tags from custom post type attachments?
- make permalink go to a custom single.php file
- Strip Characters From Tag Name
- Add Previous/Next Buttons to CPT Single Pages Only
- Why does my taxonomy have a category style div id?
- Creating Sections for Post Types
- Custom post types with categories in template
- portfolio custom type tags support
- How can I create an automatic drop down menu with my tags?
- Merge page with custom post type
- Need help deciding on a taxonomy
- Creating separate feeds for custom post types
- display custom taxonomies limited to custom post type?
- Conflict between wp_list_pages and get_posts – list pages not displaying
- Which file/template is in charge of taxonomies for custom post types?
- Hide Status Option From WordPress Publish Metabox and Rename Published on:
- How can I trace inconsistency in loading a template?
- Get Posts by Category, Tag , and CPT Taxonomy
- Is it possible to have “two” sets of tags?
- WordPress admin display post type tags as checkbox
- How to get_term_meta on single custom post?
- The Difference Between Categories and Tags and Taxonomies and Terms
- Show all Tags in each post