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
16 views

Create new Taxonomy, add extra fields, register terms AND extra fields values?

I need to create a new Taxonomy (nbateam), add extra fields to this taxonomy ('code', 'color', ...) AND register them when the plugin initiate. For now I'm able to do everything except register ...
2
votes
1answer
17 views

Get Bottom Most Level Taxonomy Terms?

How can I get the bottom-most level terms for a custom taxonomy? Taxonomy Hierarchy example, Custom Taxonomy: "product-category" Top Level Terms -> Second Level Terms -> Third Level Terms -&...
0
votes
0answers
25 views

$_GET['title'] in Wordpress

I work on a site developed a few years ago by someone else. An intranet had been developed on this site. A page of this intranet had to list elements does not work. Here are the first lines, I think ...
1
vote
1answer
34 views

Change default ordering of taxonomy terms - pre_get_terms

I wanted to change the default taxonomy terms order by its 'term_order' value instead of 'name' in admin side. So I tried something like below. But it doesn't work and php memory exhaust. function ...
-1
votes
1answer
26 views

Create heirachy of post terms from array & assign post to terms

I have a text string called $location_string which is an address in this format: 1 Victoria Street, Wellington, New Zealand as well as a custom hierarchical taxonomy called location. I am trying to ...
0
votes
1answer
14 views

How can i insert term in a specific language of Polylang?

I have created a plug-in which permits to create a category with slugs. There is the code : wp_insert_term( 'Cat1', 'category', array( 'slug' => 'slug-cat1', )); wp_insert_term( '...
2
votes
1answer
21 views

Append a term to WooCommerce product existing product category terms

I have a form which makes people decide about the sub-categories of their product and the form gets submitted on user post method Im trying to add the parent category to it as well Now I tested ...
0
votes
1answer
110 views

Editing the term_order field

Can I add the term_order field to the terms edit page? I need a text field, not a sorting plugin. Thank.
0
votes
0answers
11 views

Custom Taxonomy 'archive' template name

I have a CPT with a custom taxonomy. So I have archive-projects.php single-projects.php for the CPT. That's fine. For the custom taxonomy I have taxonomy-project-categories.php Which I use to ...
0
votes
0answers
34 views

Restrict retrieved terms by category?

Is there a way to add a layer to the terms to be able to only retrieve the terms based on a category? I have terms attached to multiple different categories, but a lot less in individual categories. ...
0
votes
0answers
13 views

How do I move the “Add New [Term]” column?

On each edit-tags.php page (that is, on each Taxonomy term listing), the left-hand side of the page, left of the actual term list, always has an "Add New [Term]" form. Frankly, I often find it gets ...
0
votes
2answers
33 views

category not display in word press grammatically

I'm trying to create a new category in the taxonomy.php called 'USSERS'. I have followed few examples online and got till this part. function insert_term( $name,$tax,$parent='' ,$slug='') { $...
0
votes
1answer
22 views

List non-empty categories from a custom post type

I have a Custom Post Type that uses the default category, the same as the posts, and some other post types in my site. How can I list all non-empty categories from the custom post type? For instance, ...
2
votes
1answer
97 views

Output the slug and name of a CPT single post taxonomy term

When I'm on a single post for a custom post type, I want to be able to grab the slug and name of the taxonomy term so I can insert them into a link. Below is what I've tried but it doesn't seem to ...
0
votes
1answer
20 views

How to solve/debug get_terms suddenly showing no results?

Up until I just discovered, my taxonomy-company.php theme file was successfully generating an indented list of each "company" taxonomy term's corporate family tree. That is, company is a hierarchical ...
1
vote
1answer
53 views

Get terms ordered by post date

What I'm trying to achieve: get n terms from a custom taxonomy ordered by the newest post in each term. This will be used to display the newest m posts under each term. Is there a better way of doing ...
0
votes
1answer
40 views

Include Parent Term in wp_list_categories

I am using the script below to list the custom taxonomies, but I still need a link to the parent of the current custom taxonomy for an "All" link. Right now the links display as: Shoes Shirt T-...
0
votes
0answers
27 views

Show message if term slug changed

Is there any way to catch changing specific field in custom taxonomy term? For example, i need to show notice in back-end, when slug in custom taxonomies term is changed. I'm reading about edited_term ...
0
votes
2answers
122 views

Parent category / child category posts

Not sure if this is the best approach - so happy to change - but I've set up a number of categories with child categories. Then on my landing page I list the parent categories - I'm using ACF to ...
0
votes
0answers
34 views

Prev / Next Post Same taxonomy Custom Post Type

I have a custom post type "cases" and a custom taxonomy "before-after-gallery". On my single-case.php my prev and next post links are jumping from one category to another. <?php next_post_link(...
1
vote
2answers
16 views

WordPress User Taxonomy Saved Values

I have been following a tutorial on setting up a user taxonomy on Justin Tadlock's site. I got everything working but I wanted to adjust the taxonomy from a single radio selection to a multi checkbox ...
0
votes
1answer
19 views

Get All Taxonomy Terms From Get_terms Array With Specific Array Key

I have below code to extract all terms from multiple taxonomies, $taxonomies = array('ingredients','category','course'); $args = array( 'hide_empty' => 0 ...
0
votes
1answer
26 views

I want to change the slugs of my terms dynamically

I'm looking to change my slugs dynamically so that they are displayed with the names of my terms, for that I created an option in the administrator panel that should allow me to start the process, but ...
0
votes
0answers
45 views

I'm trying to sanitize_title() the terms and display them correctly

Hi i'm looking for a track to make sure that for each terms of taxonomies: that I can make a sanitize_title () of the name of the term and correctly display the name of the term in the slug of each ...
0
votes
1answer
32 views

How to display a custom taxonomy without a link?

I need to display the name of a custom taxonomy term in a page template, and I've tried with the following line: <h2><?php the_terms( 0, 'my_category'); ?></h2> This correctly ...
0
votes
1answer
19 views

Set custom post type terms by id without knowing taxonomy

For a custom post type with multiple taxonomies, is it possible to set the post terms without explicitly knowing which taxonomy the term falls under? I have an array of term ids which may contain a ...
0
votes
1answer
28 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
35 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
38 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
33 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
41 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
17 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
20 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
40 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
37 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
26 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
76 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
181 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
57 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
29 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
2answers
222 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
29 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
18 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
9 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
36 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
17 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
33 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
22 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
56 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
41 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....