Your logic looks to me like it boils down to “if union
is selected, then echo a link to union
, else do nothing.” I think your description is much too complicated. It looks like you can effectively ignore paid
completely.
function wpv_check_for_union_func($attr,$content="") {
global $post;
$taxonomy = 'yourtaxslug';
$union = has_term('union', $taxonomy, $post);
if ($union) {
$term_link = get_term_link( 'union', $taxonomy );
if( !is_wp_error( $term_link ) ) {
return '<a href="' . $term_link . '">union</a>';
}
}
}
add_shortcode( 'wpv_check_for_union', 'wpv_check_for_union_func' );
Related Posts:
- Custom columns on edit-tags.php main page
- Is there a way to ‘Lock’ a Taxonomy?
- get_query_var(‘paged’) always returns empty
- Return only the custom sub-term for custom post type, do not echo term-parent
- wp_insert_term is adding a term that has no name
- Get total number of comments from posts in a specific custom taxonomy
- Display one post from each term in a custom taxonomy [closed]
- Is it possible to add taxonomies to user profiles?
- Get terms from multiple taxonomies
- Connect Users and Taxonomies
- WordPress json api taxonomy index method
- get_terms showing link to category even if all posts are drafts
- How to restrict on selecting child taxonomy
- Retrieving custom taxonomy in order, but excluding specific tax IDs
- Sort Custom Taxonomy Terms in admin by custom order
- Is it possible to sort the post based on a custom field?
- How do I get terms as a list for a specific post?
- Change in custom taxonomy permalink causes 404 error for another custom taxonomy
- Display sub-taxonomies based on SELECTED parent-taxonomy
- Checking if a Page has an Associated Term?
- Displaying ACF image field [closed]
- How get custom field from custom taxonomy?
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Get multiple term objects by ids
- How to redirect custom post type archive to first term of associated taxonomy?
- Taxonomy.php issue with search and filters
- Move terms from one taxonomy to another keeping the hierarchy
- How can I get WP to build a feed based on multiple taxonomy terms
- Displaying custom taxonomy terms active trail
- List Recent Post Titles from Custom Taxonomies?
- Get taxonomy parent using child slug (from merged taxonomies)
- Catchable fatal error on custom category post
- One query to get posts and their taxonomy terms
- Conditional display for custom fields/taxonomy
- How do I keep the page I’m on within the URL when running a search on a taxonomy?
- problem in taxonomy-{taxonomy}.php pagination
- wordpress testimonials
- Custom Taxonomies not retaining hierarchy while importing from one site to another
- Query posts from a child taxonomy term id
- get_terms() duplicate first term of a custom taxonomy
- Retrieving only custom post types with two required terms (from diferente custom taxonomies each)?
- Best structure for entering recipes in a WordPress theme?
- Output single post custom taxonomy child terms
- Website loading slowly – Advanced Custom Fields images
- How to check if a post has at least 2 terms from a custom taxonomy attached?
- Removing custom taxonomies from the admin menu
- Custom post type Category Display
- Custom Taxonomy template not display
- Terms Per Page in custom taxonomy Admin
- How to get list of only custom taxonomies?
- pre_get_posts post_meta event
- How can I add a custom permalink to a term?
- Adding Child Terms Programatically – No Warning but No dice either
- Custom taxonomy display name issue
- Variable Not Working Inside is_author() Array
- How can I get Taxonomy Images to work with ‘orderby’ argument?
- How do I hide a term from non-admin users in get_the_term_list?
- Disable a Custom Taxonomies default save mechanism
- Set post terms by term id
- Query Results not being displayed please help
- Can I output a custom taxonomy as a submenu in the site navigation menu?
- Sort taxonomy page alphabetically by meta rather than default post date
- Random category URLs not working
- Listing only custom post types with two required categories?
- Custom taxonomy throw error 404
- using wp_insert_term to create custom terms for a custom taxonomy from frontend form,
- Product custom taxonomy is not found when space in name
- Display term picture of each post in a loop
- Get Terms of custom Taxonomy of products with certain Product Category
- Clean Taxonomy terms in new post type wordpress
- How to exclude the common terms?
- Get tags name under custom taxonomy in wordpress
- Custom dropdown list taxonomy not saved
- WordPress taxonomy terms archive template help
- How to get all the terms from a custom hierarchical taxonomy via REST api?
- Unable to create a new taxonomy
- Code inside conditional is_tax() only working when term has posts
- Remove taxonomy name and add .html extension in the custom taxonomy term URL
- Custom taxonomy shows full articles
- Pagination for Custom Taxonomy
- Can I make a taxonomy meta box into dropdowns for each parent category?
- Post not showing in my custom advanced search
- sort Posts by custom user filed
- Change order custom taxonomy
- WordPress taxonomy radio buttons
- Register custom taxonomy from a Advenced custom field option page
- get_terms returns array starting at 4
- get multiple values from $_GET from multiple checkboxes
- Custom Taxonomy type in nav menu
- Advanced search: roles and multiple taxonomies
- Way to organize content – custom taxonomies or other way?
- Using post type archive page for taxonomy archive
- Custom Fields link to other pages, not search
- Removing fields from category/taxonomy edit form
- Taxonomy archive link from term id
- Remove ‘portfolio’ from URL
- is_tax not working for custom taxonomy
- Custom taxonomy with custom meta value is not sorting correctly (query returns the same value for orderby regardless of sort column click)
- wp_add_object_terms cant recognize a post ID
- Foreach for get_the_terms for hierarchical taxonomy don’t repeat Top Level Terms if contains multiple Second Level Terms