Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [terms]

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

0
votes
1answer
15 views

What does wp_term_taxonomy.parent reference?

My initial thought was that it referenced another taxonomy (i.e. an FK from wp_term_taxonomy.parent to wp_term_taxonomy.term_taxonomy_id). ORMs like Corcel are built under this assumption. However, I'...
0
votes
1answer
29 views

Ajax is not working in a loop

I am trying to show data associated with selected categories by using ajax. Its working only for the last term selected, not for all the selected terms. Any help would be highly appreciated. var ...
0
votes
1answer
14 views

How to show children terms even if they are empty

First of all im not good at PHP so it might be the problem... So after trying to do what I want without success I want to ask our help. For most of you probably it will be easy as eating breakfast. I'...
0
votes
1answer
28 views

Add custom taxonomy terms to Wordpress menu dynamically & append #slug to url

I have a 2 part question. This is my first post here, so apologies if I am doing it wrong. I have a custom taxonomy (created with WP Toolset) called 'Author Categories'. What I need to have done is ...
0
votes
2answers
34 views

one post per term taxonomy

I need some help, again. I use this query: $tax = get_the_terms($id, 'coupon_category'); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ...
-1
votes
1answer
11 views

How to manage a bookstore

I am planning to make a bookstore website with Wordpress. Can you give me some advice to manage my store? I'm not sure whether to choose Custom Post Type or Custom Taxonomy to manage the authors of ...
-2
votes
1answer
17 views

Taxonomy term RestApi data 10 rows limitions

i have created a pod taxonomy(Products) in Wordpress ... i have 16 item of terms(categories) for product taxonomy ... but after going to this routes : http://...../wp-json/wp/v2/product_categories , ...
0
votes
0answers
25 views

How to show hierarchical term tree from current term down?f

I have a taxonomy, company, wherein companies exist hierarchically. When I'm on the term page for a company, I want to show a list of all companies within its corporate tree, up and down... That is, ...
0
votes
2answers
14 views

get_terms with posts that have a different taxonomy with term x

Here's the situation; I am using get_terms to retrieve all terms from Tax 1 with posts associated with it. Using the following $args = array( 'hide_empty' => 0, '...
0
votes
1answer
18 views

Display the taxonomy name of the current term

I have a hierarchical taxonomy with lots of terms in hierarchical order. No matter what term i'm viewing I'd like to be able to display the custom taxonomy name (as per what i've registered it as ...
0
votes
1answer
31 views

posts_per_page is not working by term

I'm trying to limit the posts, but it does not work. It shows them all. Why posts_per_page does not work here? <?php // Output all Taxonomies names with their respective items $terms = get_terms( ...
0
votes
1answer
26 views

wp_dropdown_categories not showing option as selected

I'm using the below code to list categories as hierarchical. On change of select options it is redirecting to the respective category pages. But it not showing the category as selected.Could any one ...
0
votes
2answers
20 views

Build filter for post-type + multi taxonomies + multi terms

I Need to build an interface with a filter set (a list of checkboxes) that the user can check and click 'filter' to search with in 1 custom post-type for posts with matching terms (there are 3 custom ...
0
votes
1answer
25 views

How to check if a post has at least 2 terms from a custom taxonomy attached?

I have a custom taxonomy with several terms. I need to check if the post has more than 1 of these terms. How can it be done?
0
votes
1answer
66 views

Order get_terms() by hierarchy

I am trying to query a custom taxonomy terms in a way that keeps the hierarchical structure. Here is the code that I am using.. function ev_test_data() { $title = 'Mens Levi\'s Jeans'; $...
0
votes
0answers
22 views

Modify term slug before saving

I had the same problem like in this Question. Terms like 'c', 'c++' and 'c#' are only saved once with 'c' as slug. Based on example #2 from the answer I built some code that works fine when creating a ...
0
votes
0answers
14 views

how to display post of lowest terms - ancestors wise?

I want to achieve 3 post display from each taxonomy terms. But this terms will be passed from lowest of hierarchy in array that is ('munnar','cochin') etc. Europe Asia - India -- Kerala --- Munnar ---...
0
votes
0answers
8 views

How to get terms by posts total comment count?

Is any way to make it? Just calculate posts comments total number and order terms by this. Is it possible? $termArgs = array( 'taxonomy' => 'category', 'hide_empty' => 1, 'orderby'...
1
vote
0answers
28 views

How to show all possible parents and children of a hierarchical taxonomy term?

I have a hierarchical custom taxonomy "company". Companies are hierarchical, they can have both owners and subsidiaries. So, some of my "company" terms have parents and children. Take this real ...
0
votes
2answers
14 views

How to modify custom category field from front end?

I tried: wp_update_term($personid, 'category', array( 'name' => $_POST['nameChange'], 'slug' => $string, '_city' => $...
1
vote
1answer
29 views

Print terms with taxonomy and metabox value

I create metabox serial_language with ACP plugin into custom taxonomy name is serial. And I want to get only terms, in which custom field value is english, arabic. How to get only terms which have ...
0
votes
1answer
17 views

Echo term slug op post on archive page

I want to echo the term slug for each post on an archive page. To get the term slug i'm using the following code: $terms = get_the_terms( get_the_ID(), 'type_kennisbank' ); That returns me the data ...
1
vote
1answer
25 views

Show listings from Impress Listing plugin in random order using taxonomy and terms

I am not able to get the listings to show up. I have verified the slug for the post type and the taxonomy. This code I know works because I have used it for other post types and taxonomy's. Any ...
0
votes
0answers
33 views

Add term to taxonomy programatically

I have a 1000+ terms I need to add to a taxonomy called county. I am trying to use this function wp_insert_term but the term is not being added to the database. I am running this code inside function....
1
vote
2answers
22 views

Wordpress loop: Show only a Custom Post Type Taxononmy TERM

Before I start, I have to say that I have tried to solve my problem in a thousand different ways and I have read several posts without success. I have a CPT called "grouped", a taxonomy for that CPT ...
0
votes
0answers
21 views

How to change custom categories term links?

I have created "Tour Vacation"(tour-vacation) custom taxonomy and added below terms Africa (africa) Canada (canada) Europe (europe) US (us) I want change this terms links. Current link is: https://...
0
votes
0answers
41 views

How to paginate across foreach loop?

I want to paginate a lengthy page, but it is not about paginating a post loop. My site has thousands of posts of type "article". And taxonomies including "company" and "format" - an "article" can be ...
0
votes
0answers
16 views

How do I show a list of terms' posts, grouped by a secondary taxonomy?

Let's say I have custom post type article. I have a custom taxonomy fruit, with terms like apples. And another custom taxonomy company, with terms like juicy-inc and crunchy-co. Both are associated ...
0
votes
1answer
65 views

Pass array of taxonomy terms to wp_query

I am trying to compile an array of taxonomies and terms to pass to wp_query, my array looks like this... Array ( [0] => Array ( [taxonomy] => color [field] =&...
0
votes
1answer
45 views

wp_split_shared_term_batch messing up upgraded ACF 5 data

After upgrading Wordpress and associated plugins to the latest version on a dev server and migrating the source files and database to the production server, the data from ACF is different. prod and ...
0
votes
0answers
29 views

Why is the term of my current page not returning a slug?

Why is the term of my current page (custom taxonomy) not returning a slug? I have managed to get the following returned in my URL: 0, Array, '/{empty space}/ I am trying to pass the custom taxonomy ...
0
votes
0answers
83 views

WP REST API - Add post with taxonomy using term_name

Hi there we have API requests hitting our WP site to import posts into a custom post type. In the JSON for the post type the taxonomy "job_sector" is sent through as a string using the terms name ...
0
votes
2answers
44 views

How can I change the output display of my pagination?

How can I change the output display of my pagination? I have been trying for the past few hours to format the output of my pagination links (1,2,3, etc.) to resemble the below: I have been unable to ...
0
votes
2answers
21 views

taxonomy terms, inverted

I have a taxonomy that will be the brand, and the children’s items the template. I have a code in single.php to show the details. <div class="box2"> <div class="faixa"> ...
2
votes
2answers
41 views

Ordering terms before displaying posts

My question is close to other questions, but I dont' have enough reputation to comment. I'm working for a restaurant and I 'd like, for my menu page, to organise my posts "meal" under terms "...
0
votes
1answer
147 views

How to update incorrect post count in taxonomy?

I have imported a large amount of content using WPAllImport, all to a custom post type called "article" ("Articles") and all organised by a custom taxonomy type called "source" ("Sources"). However, ...
1
vote
1answer
56 views

How to check the terms in single custom post type template

I have custom post type called events it has event_type taxonomy with two terms namely past-events, upcoming-events. I want to check my single post's term whether it's under past-events or upcoming-...
1
vote
1answer
104 views

How to get data about category in category.php

I have to make custom category.php template, but how do I get data about category in category.php? I need these: Category name and id Category's parent name and id All category's items Let's say our ...
0
votes
1answer
53 views

How to return newly added terms when using wp_set_object_terms

I am using wp_set_object_terms to add terms (attributes) to our WooCommerce products: wp_set_object_terms($id, array($migrate_case), 'pa_case'); This gives us the advantage (instead of using ...
0
votes
1answer
53 views

Use get_the_terms to list subcategories of custom taxonomy

Currently I use the following code to output all categories within this custom taxonomy in a custom post type: <?php $args = array( 'post_type' => 'video_cpt', '...
0
votes
1answer
1k views

How to get all attributes with their terms related to specific Woocommerce product category [closed]

As we know, to get terms of specific attribute added to a product we can use: $attr_terms = $product->get_attribute( 'attr_slug' ); OR to get all terms of specific attribute regardless of a ...
1
vote
1answer
27 views

Create / Close Div in Array [closed]

Found several similar questions, couldn't get anything to work. Trying to setup a bootstrap card that is created from array data. I am using the code below to create the divs if the array has data. ...
0
votes
1answer
36 views

Exclude product attributes from taxonomy terms loop

As the title suggests, i want to exclude product attributes from the taxonomy terms loop, but each attribute is a unique taxonomy, so i don't know exactly how to exclude all of them programmatically. ...
0
votes
0answers
14 views

How To Create Taxonomy Term When Creating The Taxonomy Through Custom Plugin

I am trying to add Taxonomy Term pragmatically when creating taxonomy. I tried adding the wp_insert_term( 'A00', // the term 'we_colors' ); to the tax_color_palletes but this is not ...
3
votes
1answer
361 views

When to / not to use wp_get_post_terms vs get_the_terms?

A user contributed a note in the codex saying the only difference is that get_the_terms use cached data, and I already know that wp_get_post_terms let you retrieve data by slug, but I still wonder ...
1
vote
1answer
240 views

WP_Query use for a filter with multiple Taxonomies and Terms

So, what I'm trying to do, is to make an ajax filter, this is the portion of the filter code that builds the $args based on the data that came from the filter form, and afterwards (not in this code) ...
2
votes
2answers
28 views

How to use a Term Meta Field as a link

I created a taxonomy called animal and a term meta field called horse. I created a function in my functios.php file to make it easier to display the data. Here is my code: function ...
0
votes
0answers
103 views

Filter ACF Repeater results by selected Taxonomy term?

Is it possible to filter the repeater by selected Taxonomy term? I have a repeater setup with multiple fields, one of which is a taxonomy field (ie: color). I'm needing to display only specific ...
1
vote
2answers
82 views

How to create a theme template for the taxonomy “root”

I just come up with this issue for a project that uses a lot of taxonomies and I need to list posts using the taxonomies itself, not only the terms. I have a taxonomy called "Colors", so the terms ...
0
votes
0answers
30 views

Exclude taxonomy term in archives, but make it readable on its own

Background: Making an event site that automatically hides expired events. Using WP-Cron and some tinkering, I've made it so my CPT "event" automaticly has an "Active" term in the taxonomy "Status", ...