The first problem is that you’ve got a space in the first argument of has_term()
. If you want to check for any term then you need to pass an empty string, but a space is not an empty string. Then, as documented, the second argument needs to be the taxonomy name.
This should work:
if ( is_single() && has_term( '', 'us_pf_category' ) )
Related Posts:
- Manipulating cookie on specific taxonomy archive page
- Proper WP conditional tag to check for existing taxonomies to list out terms with wp_list_categories?
- Variable Not Working Inside is_author() Array
- Best Method to Switch Between Terms (Custom Taxonomy)
- How to only list the child terms of a taxonomy and not their parents?
- How to use taxonomies on attachments with the new Media Library?
- Hierarchical taxonomy UI
- How to display custom taxonomies in posts?
- Filtering custom taxonomies
- Allowing specific users to only add posts using certain custom taxomy terms
- Edit tags page for hierarchical taxonomy doesn’t show taxonomies at all depths
- I want to load post content by categories using Ajax
- Get only the first term by taxonomy
- Hook to process a new taxonomy tag before it is created?
- Removing taxonomy base using WP rewrite
- get_terms() returns an empty array
- Scheduling posts to update once per day with wp_cron
- How to find taxonomy name using only taxonomy TERM ID (or taxonomy term name)
- Multiple users – only allow them to manage their own terms for custom taxonomy when logged in
- Is it possible to get a Previous/Next Taxonomy term archive URL?
- WP_insert_term how to insert multiple values as taxonomny term?
- How to include parent terms in hierarchical taxonomy URLs?
- How do I display a tag cloud with both post tags AND a custom taxonomy?
- Custom taxonomy term as class?
- How to edit/remove a term that’s in multiple taxonomies?
- Using a loop to display terms associated with a post
- Text and image in taxonomy page
- Custom Taxonomy: Parent still counting deleted Child
- Improving WP_Query performance for multiple taxonomies
- Create Child Taxonomies
- how to create a proper query for getting a list of users with taxonomy related meta key
- How to add custom field to custom taxonomy in 4.4
- Taxonomy page template changing when using query variables
- Get direct children of custom taxonomy
- List subcategory on taxonomy term page
- Operations with custom fields values in a loop
- How to insert an array of terms using wp_insert_term?
- Create Advanced search with taxonomies (not filter list)
- How to get custom post type taxonomy
- remove sanitize_title() for register_taxonomy()
- Redirect all child taxonomy to its parent
- Can I use a Custom Meta Value inside of ‘get_the_terms’?
- has_term if/echo else/echo function
- Tell the difference between a term and page when they have the same ID
- add hirarchy of categories in products grid of visual composer
- How to use multiple archive templates for a taxonomy?
- Hiding taxonomies with no children WP_Query & tax_query
- Custom taxonomy for Media Library
- Clicking Add New button for custom taxonomy only moves element
- How do I return all terms from multiple taxonomies?
- Returning One custom taxonomy term name
- Proper way to update the slug of a taxonomy using register_taxonomy? [duplicate]
- Restrict editing of posts with specific taxonomy to users with a matching meta value?
- Hide terms if they aren’t the same as the current term
- Corrupted nav-menu?
- Hide taxonomy when term is empty
- The best way to display taxonomies
- Dynamically set taxonomy term and show admin notice on post save
- Remove taxonomy widget from “PAGE” post
- WP 4.8 : new taxonomy syntax for get_term_by and get_term_link ?
- Custom rewrite permalink doesn’t work
- Can you hide empty terms using get_term_children?
- Register `product_cat` taxonomy for default post post type
- Don’t display taxonomy if empty
- how to access the $query variable inside taxonomy-xxx.php template file?
- List terms of custom taxonomy if matches other taxonomy
- Order custom taxonomy by date
- Permalink issues with custom taxonomies
- Insert taxonomy slug into loop class
- wp_set_post_terms example?
- Where to find relation of custom post type category with it thubmnail image in wordpress database
- Adding term to a custom taxonomy based on term from product category
- Add taxonomy column with meta field (ACF) content
- Warning: Undefined variable $post in C:\xampp\htdocs\… after PHP upgrade
- How to display taxonomy terms in a dropdown on a user edit page
- How to list custom taxonomy terms alphabetically by last word
- display taxonomy terms with link
- Random order not working correctly when using default loop + $query->set
- Convert post meta to custom taxonomy?
- How to create filter’s for custom taxonomy page
- How to create a non removable taxonomy term?
- Query by multiple custom taxonomies
- get the custom taxonomy name?
- How to add all existing Custom Taxonomy to Admin Menu Creations Interface?
- Modify title of custom taxonomy archive page
- Catchable fatal error: Object of class WP_Error
- WordPress custom taxonomies new/edit post autocomplete
- Templates files for custom post type with custom tags
- Permalink structure not working with Custom Taxonomy (URL like ./taxonomy/category/postname)
- taxonomy query on front page
- Pagination with custom query (not using posts)
- What’s the proper WordPress URL for the template of my custom taxonomy?
- WordPress show posts from children terms of a taxonomy term
- Get Posts with matching lowest taxonomies
- How to randomise a custom taxonomy tag cloud
- query posts returns 10 records
- Remove Tag Cloud Words from Custom Taxonomy
- How to add/enqueue Custom CSS for a custom taxonomy page?
- add_rewrite_rule pagination 404 error on page 4 and above
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post