In WordPress, terms are itens set to a taxonomy, i.e. when you create new categories or tags you create new terms.

learn more… | top users | synonyms

0
votes
1answer
8 views

Importing custom DB table entries as posts with Categories

I'm using the following code to import all entries within a custom DB table as posts. The function fires from an init hook. All taxonomies are created, and all entries from the DB are imported, ...
0
votes
0answers
20 views

Custom while loop for hierarchical display of a taxonomy

I'm trying to build an automated mega menu that loops through all product-category terms and displays them in a hierarchical underscored list, as well as including post in each term. For example, ...
0
votes
2answers
26 views

How to handle “the_terms” inside loop

I have been searching google but I am really confused. I am trying to display the terms of the taxonomy assigned to the post. I am using the_terms($post->ID, 'locations');. The custom taxonomy is ...
0
votes
1answer
13 views

How to get term by name with parent id?

So I have two menus which has childs with the same name. How to get term by name but from specified parent?
9
votes
2answers
125 views

Explanation of update_post_(meta/term)_cache

I was reading over some best practices from 10up and they mention setting these two flags to false in a WP_Query ( depending on what you're querying ): 'update_post_meta_cache' => false: useful ...
1
vote
0answers
14 views

Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)

As title reads, I am trying to list specific custom tax's terms in a custom post type archive's page. My setup: Custom post type: 'podcast' Custom Taxonomy: 'showname' -> Custom Field for above ...
1
vote
1answer
72 views

wp_insert_term in a multisite installation

i am creating a theme that creates pages and sets some meta values and ext on theme activation. Everything works great but... I need to insert some terms to misc cpt's in a multisite installation. ...
0
votes
1answer
19 views

Post with certain term and without any term

I try to create a plugin to manage user groups with permission to view posts within group and I stopped because of query problem. Example: User belong to group called "Group #1" (slug: group-1). I ...
1
vote
1answer
15 views

Should I be using custom post types for this or terms and taxonomies?

So for the past week or so, I've been developing a plugin that lets users manage a restaurant menu. I've learned a lot about the process of making plugins as far as adding custom post types, creating ...
0
votes
0answers
14 views

Decrement term in for each

So I am catching custom posts in wordpress by for eaching my custom terms. To get a post from the next term in the loop I use $terms[++$key]->name and it all works fine. However when I want to do the ...
1
vote
0answers
15 views

Display Posts Loop for each parent and for each Child

i have a custom query to display relation with posts (post 2 post plugin) my existing code display : foreach terms as terms i need to display for each Parents Display Child then Posts Titles ...
0
votes
1answer
16 views

How to get a post's associated taxonomies and terms in wp api v2

I am using angular to get a list of posts back from the post endpoint for the wp api. These posts have different taxonomies and terms associated with them. I want to use angular's search filters ...
0
votes
1answer
37 views

term_exists() returning NULL on term that exists

It seems that term_exists() is returning NULL for a term that already exists: $name = "כל האזורים" $taxonomy_name = "geographictermsisrael" $args = array("slug" => "everything", "parent" => 0) ...
1
vote
2answers
40 views

Display certain amount of posts on taxonomy archive page

I have a taxonomy archive page where I display everything under the term 'techno' I want to be able to limit this to 20 posts to a page until it paginates. At the moment it displays 10 on one page and ...
0
votes
0answers
26 views

Get template part using a custom taxonomy term

I've been using the following code to get a template part based on the parent term. It was working fine until I updated WordPress to v4.4 earlier today. Since updating if there is also a child term ...
1
vote
1answer
52 views

I want to loop through Woocommerce Product Catogories and show them in dropdown

I want to loop through Woocommerce Product Catogories and show them in dropdown. I have tried almost every piece of code available on internet but seems that they are not working for me. I'm very new ...
0
votes
1answer
36 views

Urls in Custom Post Type work for Terms but not for its Taxonomies

I have created 12 taxonomies for a custom post type and a few terms. On creating new post it looks like this and that is perfect - Taxonomies with terms I have: archive page - url is ...
0
votes
0answers
29 views

Get term link of shared taxonomy between multiple post types

Let's say that we have three custom post types: museum, theater and restaurant that share the same hierarchical taxonomy: location Up till now I have 3 different urls for each of cpt archive pages: ...
0
votes
1answer
52 views

get_term_by works but get_terms doesn't?

I currently have a Multisite with 2 sites. From the secondary site get_term_by() works to retrieve terms from the primary site, but get_terms() does not. I'm using switch_to_blog(1); but I get ...
3
votes
1answer
37 views

Get_term_by only returns one item from array

I am trying to retreive a term id based on the term name using the "get_term_by" function that is build into Wordpress. However, this function only retrieves one item from the array that i get them ...
1
vote
1answer
19 views

Faceted search with WP-API data

I have this site - where I have a post type called listings with a number of custom taxonomies and terms. - http://scd.blaze.wpengine.com/ If you choose a region it then shows you listings that are ...
0
votes
0answers
28 views

how to add custom taxonomy terms to main rss feed?

I'm wondering how to add custom taxonomies and their terms to the main RSS feed in WP 4.4. I've tried: function myfeed_request($qv) { if (isset($qv['feed'])) $qv['taxonomy'] = array( ...
4
votes
0answers
65 views

What is wp_insert_term “alias_of” arg for?

I currently put my hands into WP taxonomy and terms to find solutions for my project. I knew that it's not possible to have same terms slug when creating a term with wp_insert_term in one Custom ...
1
vote
0answers
28 views

Insert term and child term from frontend

I have this taxonomy: "free", and I want to insert new term (ex: Season) and then insert a child to this term (ex: episode) in the same form. Taxonomy "free" Add new term: ex: Season, and then add ex: ...
8
votes
1answer
140 views

Need a simple but complete example of adding metabox to taxonomy

Now that WordPress 4.4 is out, we can start using the new awesome term meta functions! Still, there seems to be no simple tutorial on how to add a basic text field to a Taxonomy. I tried to adapt ...
3
votes
2answers
125 views

wp_insert_term auto unique name

When creating a new term in a custom taxonomy with wp_insert_term, i've noticed that name should be unique. I get a wp error message if it is not : A term with the name provided already exists with ...
1
vote
1answer
69 views

has_term not working

I've been scratching my head all day with this one. I'm trying to use has_term but it just won't work. I do get this notice but I'm not 100% sure it's related. I've also tried is_object_in_term() but ...
1
vote
1answer
61 views

Getting WooCommerce product related child categories

I am completely stuck on what seems to be an easy thing. I hope you can help me with it. Each WooCommerce product will be added to one "car brand" child and one "car model" sub-child category of main ...
0
votes
2answers
68 views

How can I reduce amount of ifs and else ifs in this specific block of code?

I have some code in my loop that will determine the term in my custom taxonomy, if it's a specific term, it will output a specific image. <?php if( has_term('10', 'review-score' ) ) { ?> <a ...
0
votes
0answers
26 views

How can I allow users to set term_order for custom taxonomy in admin?

I am able to sort a list of (custom) taxonomy terms on the front-end calling get_the_terms() with the help of the following filter function: /** * Sort custom taxonomy by term_order * * @param ...
0
votes
0answers
18 views

Is there a way to sort posts by taxonomy terms? [duplicate]

I was wondering if I could sort posts at all by taxonomy terms? I've read that I can't, but I'm not too sure about that? If so, how do I go about doing so? Sorry for the rather short question. I ...
3
votes
1answer
70 views

Is there a way to set singular/plural labels for taxonomy term names?

Let's says I have a taxonomy called Types. I know I can have a singular name when registering the taxonomy... so I could just set the singular label to Type. But is there a way to the same/similar ...
0
votes
1answer
54 views

Invalid argument supplied for foreach() in search.php

I'm using this code on a search.php template to display search results, posts are formatted differently using a template part depending on the post term. This method works great on the index.php but ...
1
vote
0answers
19 views

Show child terms of current term of the taxonomy

I have some taxonomies (such as product, articles &...) and any taxonomy has some terms (Eg for product: mobile, book & ...), and any terms has some child terms (Eg for mobile: iPhone, ...
1
vote
1answer
45 views

get_terms orderby numeric

I am trying to order my terms numeric. But the problem is that nog every term is numeric. So I have the following terms (check image below) which some of them are dimensions and some are others. As ...
0
votes
0answers
15 views

Getting Post Tags From Certain Categories

The site I am working on has about 4 different post categories. I need to output a list (unordered) of tags in that category so that a user can click on them and see posts in THAT category tagged with ...
1
vote
1answer
21 views

Inserting Category programmatically

I am wondering how should i insert the category programmatically and it should insert only 1 time after the theme is activated. I know up to here. function example_insert_category() { ...
0
votes
0answers
20 views

Assigning a post (custom post type) to parent term and children

I'm writing a script to import store listings into WordPress. The taxonomy structure consists of: State (Parent) > Region (Child) > Sub-Region (Child of region) > City (Child of ...
0
votes
1answer
66 views

How can I select a primary category?

I'm looking for a plugin or suggestion on how to select a primary/main (custom taxonomy) term in a custom post type. For example, I'm developing a Wordpress website for Musicians. I have a custom ...
0
votes
0answers
45 views

404 on term taxonomy archive pagination only with some terms

On my site I've created a CPT with a hierarchical custom taxonomy. Here the code: **CPT Args** $args = [ 'labels' => $labels, 'public' => true, ...
-1
votes
1answer
52 views

How to extract one field from wp_get_post_terms objects?

I know I can get an array of term objects with this line: $terms = wp_get_post_terms($post->ID, 'mytaxonomy', array('fields' => 'all')); Or, I can get a simple array of term names with this: ...
0
votes
0answers
89 views

How to get posts ORDERBY a custom taxonomy term's custom field?

I have a custom taxonomy program_taxonomy : /* register a common taxonomy for DRAMAS & reality_shows to get post by terms in PROGRAMS page */ register_taxonomy( 'program_taxonomy', array ...
0
votes
0answers
85 views

Best way to group posts based on custom post type terms

I have been trying to group custom posts based on the taxonomy terms as shown in this article. Here is another similar post: Display all posts in a custom post type, grouped by a custom taxonomy ...
0
votes
2answers
44 views

How to force acceptance of site terms on first login?

I want to force users to accept the terms and conditions of the site when they log in for the first time. I found a couple plugins that would show the terms, but they don't prevent you from ignoring ...
0
votes
1answer
60 views

Looping Through Custom Tax Terms and Displaying All Posts For Each

I'm using the following code to attempt to loop through each of the terms within my custom taxonomy category-film and then output the term name as a heading together with displaying all the custom ...
0
votes
1answer
50 views

Echo taxonomy name - second level

I have the following taxonomy: Location: Province --City ----Suburb Province --City ----Suburb How can I echo the names of "Suburb" (second level) on an archive page? So, for example: Location: ...
0
votes
0answers
25 views

How to display custom taxonomy grandest children in three columns, with first child as column heading?

I have a taxonomy structure thats 4 levels deep, with the name 'services_tax': Parent - Child - - Grandchild - - Grandchild - - - GrandGrandchild I am trying to get the terms selected on a custom ...
1
vote
1answer
189 views

How to get posts from multiple custom post types according to it's custom taxonomy terms?

I have two custom post types and separate taxonomies for each. post type - dramas --------- taxonomy - drama_taxonomy post type - reality_shows -- taxonomy - reality_shows_taxonomy For now I am ...
1
vote
1answer
51 views

Get posts by querying taxonomy and certain terms of the taxonomy?

I have a taxonomy called schedule_day_taxonomy add_action( 'init', 'schedule_day_tax_func' ); function schedule_day_tax_func() { register_taxonomy( 'schedule_day_taxonomy', ...
0
votes
1answer
54 views

Weekdays as terms - How to order taxonomy terms by ID in admin panel?

I created a custom taxonomy using following code. add_action( 'init', 'schedule_day_tax_func' ); function schedule_day_tax_func() { register_taxonomy( 'schedule_day_taxonomy', ...