Stack Exchange Network

Stack Exchange network consists of 175 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.

1
vote
1answer
8 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
19 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
45 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
31 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
25 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
44 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
28 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
8 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
29 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
11 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
22 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
31 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
19 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
32 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
15 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
19 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
34 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
21 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
23 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
43 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
82 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
26 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
27 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
137 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
25 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
17 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
32 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
16 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
32 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
20 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
45 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
38 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
28 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
22 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
46 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
17 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
195 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
55 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
30 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
92 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
52 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
43 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
249 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
58 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-...