First, you can’t enter such expression as second argument in get_term()
. Enter directly the name of your taxonomy…
Are you dealing with simple post categories? If that’s the case, your taxonomy name is 'category'
.
$context['single_term'] = get_term( $user_terms_array[1], 'category' );
Second, ensure that $user_terms_array
contains term IDs as integer.
$user_terms_array = array_map( 'intval', explode( '-', $user_terms ) );
Then, you’re on the good way. Using WP_Term_Query
instead of get_term()
wouldn’t give you any pros if I refer to the supplied info. In this context, I’d stick with get_term()
.
Related Posts:
- Add custom taxonomy fields when creating a new taxonomy
- Remove Category description textarea
- Multi-select field for Taxonomy can’t save the value
- WordPress implode & wp_insert_post question
- Loop through custom taxanomy in post and display custom fields from posts
- Custom field with terms from another taxonomy programmatically
- Dropdown (with onChange) with custom taxonomies
- ACF Custom field not showing in Timber Taxonomy page
- Register custom taxonomy from a Advenced custom field option page
- add custom fields in custom taxonomy meta box in wordpress-3.5.2
- Any way to make custom taxonomy field searchable?
- How do I create a term for every value of a post meta?
- How to add images to taxonomies?
- Can you add the visual editor to the description field for custom taxonomies?
- Check if a post has any term in this custom taxonomy?
- Custom taxonomy hide meta box but show in menu
- Get value in custom field with taxonomy [closed]
- Is there a way to disable a term rather than deleting it?
- Modify Term Update Redirection
- Check if current term is a child of another term
- get_terms() doesn’t return empty terms even though hide_empty is false
- SQL QUERY needed to get POST category (taxonomy) ? – MUST be SQL statement
- Archive template for taxonomy terms
- Custom metabox for menu administration page?
- Custom Fields and performance
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Possible to register multiple custom taxonomies in one function?
- How to get the top most term (top ancestor) of a custom taxonomy child term?
- Automatically assign taxonomy term if custom meta value exists
- Function to limit the number of posts in taxonomy.php
- User role permissions based on taxonomies
- WP Query with custom taxonomy
- How to prevent posts duplicating when viewing a custom taxonomy term
- How to display custom taxonomy in multiple columns?
- Storing data into custom taxonomies VS post custom fields (post meta)
- Custom taxonomies making WP very slow – Way to fix?
- Removing the “Popular Terms” area from the Taxonomy Edit Screen in the Admin Area
- Sorting taxonomy columns by meta value numeric
- Programatically added attribute, set to ‘show on product page’ automatically. Woocommerce [closed]
- ACF vs Taxonomies
- Reverse traversing taxonomy based on term_id
- Get Current Custom Taxonomy ID by Post ID
- Custom fields to taxonomy
- Taxonomy archive showing no results
- I used the Tax-meta-class by bainternet but i still can’t get it to display any of the results.
- Autogenerate Front End Form Field With jQuery
- Styling Taxonomy Terms Individually
- Changing taxonomy term by slug (wp_update_term)
- How to add textarea field to taxonomy (tag)?
- Taxonomies on custom taxonomies
- How to join result of different taxonomies?
- How to add Post Format Taxonomy Archive page in the menu?
- How to Rewrite Taxonomy URL to Include the Post Type as the Second Segment of the URL?
- How to get all taxonomies which can be added in menu?
- WordPress Tag or Custom Taxonomy Return All Posts if has that Word in Post Title
- Replace taxonomy permalinks
- Display value of custom field of custom taxonomy in single post?
- Custom Taxonomy Term Archive Page Template that Filters 2 or more Taxonomies
- Create custom taxonomy and Display in metabox dropdown
- How to create a custom taxonomy using a shortcode?
- Override Taxonomy Template
- how to store values in database at hierarchical view
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- Dropdown taxonomy lists in admin menu
- Taxonomy archive template that shows posts from more than one taxonomy
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- How to get the term description in a taxonomy term archive query?
- How to define %category% for custom taxonomies?
- Create multiple taxonomies with custom fields values on the fly when creating new posts
- new custom filed not showing in taxonomy
- How do I get the correct URL?
- Custom Taxonomies Archive Page 404
- How to replace custom post type with custom taxonmy in permalinks
- Cloning product not copying custom taxonomies
- Create new Taxonomy, add extra fields, register terms AND extra fields values?
- Unregistered taxonomy apears still as emtpy filter list
- Get Highest and Lowest get_term_meta() value from Taxonomy Term
- How to get a terms and posts associated with another term?
- Displaying subcategories and then posts in taxonomy template
- Ignore punctuation marks in taxonomy order by name
- How to use two same taxonomy in same post differently?
- How to Manage and link certain custom taxonomy?
- switch statement for taxonomy content
- How do you search for a post by custom taxonomy?
- Display taxonomy term slugs
- Can I use multi (sub) levels of relation (AND | OR) on custom query?
- Index page of posts tagged with two separate taxonomies
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Avoiding stripping of HTML in Custom Taxonomy Meta Field
- How to permanently delete a taxonomy
- Advanced AND tax_query in sidebar with 2 taxonomies
- create taxonomy
- Alternative for is_taxonomy() to workaround theme’s default sidebar
- What is the current page’s Taxonomy?
- Get custom taxonomy term url on archive page
- Display woocommerce product_cat child terms with thumbnails
- Converting Categories (with ACF fields) to custom taxonomies
- query grandchildren taxonomy terms
- Adding new terms to custom taxonomy
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post