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
- Get custom post_type’s archive URL
- Hook for post and page load
- Custom Post Types 404 Issue
- How to add custom content template part for a custom post type on main query using a plugin
- How can I include custom post types on a tag page?
- Loading custom page template via plugin
- Templates for Custom Post Types and Custom Taxonomies
- Page as child in custom post type slug?
- Tag list & tag index for custom post type
- Apply template to custom post type
- Page is defaulting to archive page and not designated template
- Undefined property: stdClass::$labels in general-template.php post_type_archive_title()
- Is it proper to create a page just to generate a listing page (eg. for a custom post type)
- How to quickly switch custom post type singular template?
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Display “Post 2 of 4” on single post page?
- How to search from specific post type with tags?
- Make custom post type display as a page
- Turn query string to sub page
- WordPress Template Hierarchy
- Is it possible to make tag archive page specific to Custom Post Type?
- is_page_template not working as expected
- Multiple portfolios with one custom post type?
- ‘Pages’ widget alternative for custom post types?
- Search doesn’t find tags or categories in custom post types
- Navigation menus not showing because of custom post type filter
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- How do I fix permalinks for custom post types that has the same slug as a page?
- How to show the archive / post type description on Single templates
- Set up Custom-Post-Type Author Archive
- search also in taxonomy, tags and custom fields
- Add tag to a custom post type doesn’t change the total of custom post type in backend
- No Permission to add new Page, Post or CPT with Admin role
- Content vs Template on custom post
- WordPress Doesn’t Generate Taxonomy Archive
- Show Custom Post Type meta boxes only on Page Edit
- Filter widget outputs
- Adding Page Templates to post but it ignored it
- WordPress custom taxonomy template not working
- Pros and cons of a custom page vs custom post type template file
- Best way to specify “article type” in URL
- Custom Empty Results page for my Custom Post Type
- Page listing Custom Posts
- Need help deciding on a taxonomy
- How can I trace inconsistency in loading a template?
- Get Posts by Category, Tag , and CPT Taxonomy
- Assigning alternate single-{cpt} template based on blog_id in multisite
- Get template part with CPT and Custom Taxonomy conditionals
- Displaying a list of Contacts
- Custom permalink structure for remote content pages
- wp_dropdown_pages with tax_query clause
- How can I add in post’s the text “No content”
- Custom post type, taxonomy and admin bar
- How to customize `Edit-Post` Screen
- Advanced archive url structure (category, tag and date)
- Does “Custom Post Type” can have page hierarhy option?
- Function to allow single post template based on custom taxonomy?
- Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?
- how to display posts content on the custom css popup by clicking on each title on the sidebar?
- Custom post type defaults to index.php for archive page
- CPT tags not showing when editing post
- Create Custom page with custom domain
- Do not show child pages within a file page
- How to add independent “Tags” to Custom Post Type?
- Custom post types & Pages hierarchy – Error 404
- Question on templates
- Assign for all post of a post type a specific single-post template
- Taxonomy template file not working with a taxonomy that contains a slash
- taxonomy – templates are not loading
- How can I load Template file from wordpress plugin
- Loading a template for a URL pattern
- Custom post tag images not displaying with ACF
- WordPress Custom taxonomy template
- Use one template for different custom post types with the same markup
- Taxonomy count per Post type
- Custom page template not being called
- Pulling Content from Existing Database
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Querying multiple taxonomies in URL leads to wrong taxonomy archive
- WordPress Custom Post Type and sort by Tags
- How to Associate Posts with Pages
- Custom post type pagination, single page issue
- Multisite – Echo admins profile meta
- Custom template support for custom post type?
- Why are my wp urls showing page not found?
- Custom Post Type Slug / Page Slug Conflict – Prevent use of reserved slug on page save?
- Tag-post relationship problem
- Custom Post Type Template Based on Page Slug?
- PHP Button Custom link [closed]
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?