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

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
14 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
4 views

Inversing terms of attribute [migrated]

I got an issue. I got a list of artists as an attribute. I made this code to show it on a page: $terms = get_terms( 'pa_artists' ); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ ...
0
votes
0answers
19 views

Allow user to only assign terms to a CPT he can't edit

This is my first question over here, i hope i'll be posting in the right place and in the right way. THE PROBLEM I would like to allow a user to assign -via quick edit- custom taxonomy terms to a ...
0
votes
0answers
13 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 ...
2
votes
1answer
45 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 ...
0
votes
1answer
23 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
23 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
19 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 ...
-2
votes
0answers
32 views

How to enable child attribute in Woocommerce?

I'm new to this forum. I'm trying to create a child attribute but it seems this feature is not available in Woocommerce. Is there a workaround? What I'm trying to achieve is having products filters ...
1
vote
2answers
68 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
20 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", ...
0
votes
1answer
12 views

Update term_id to new value wherever it exists, to combine the two.

We have two categories in our database, and the second one was created mistakenly and misspelled. The first is spelled correctly (term_id 43), and the second is not (term_id 86). I want to combine the ...
0
votes
0answers
30 views

Conditionally remove a taxonomy from a post

I'm working on a custom post type with some custom fields. Some of these fields are taxonomy selectors, first i select a taxonomy called "type", deppending on the chosen type a second taxonomy ...
1
vote
0answers
44 views

Allow a Taxonomy Term to be Used Only Once Across All Posts

I have a Custom Post Type called Pricebooks. I then have a custom taxonomy for Pricebooks called Zip Codes. Within that taxonomy the terms are the actual zip codes. I want to limit a Zip Code (the tax ...
0
votes
0answers
9 views

Problem view pagination [duplicate]

I have problems ... I try to implement a pagination but it does not work: <?php $post_type = 'automotive'; $slug = 'ford'; /* ferrari, peugeot */ $taxonomies = get_object_taxonomies( ...
2
votes
0answers
35 views

Output the content of a term organised by each of the CPT?

I have four CPT and several shared Custom Taxonomies for all. I need to retrieve and output the content of a term (let's say "environmental-crisis" of the shared taxonomy "Crisis Type", and organise ...
1
vote
2answers
25 views

Term count by user

I am developing a section on the front of our website. Our users submit properties to our directory. we would like to show how many properties they have listed and what types. I have got this code but ...
1
vote
1answer
16 views

how to get the assigned child term of the term's parent

I've read multiple stacks on different ways of doing this, but I've yet to find something that solves my problem. I have a parent term "Web" and a child of that term "Web Development". The current ...
1
vote
1answer
17 views

WPML Translating a term/taxonomy programmatically

I have all terms in English and I am creating/duplicating the same ones for German language by using foreach on english terms and this way i create all terms for German language. The problem is when ...
1
vote
0answers
23 views

wpdb->term_taxonomy count posts from both published and private posts?

I'm trying to understand why this query won't include both private and published posts when counting and sorting the taxonomy terms. $taxonomyTypes = "AND ( tax.taxonomy = '" . ...
0
votes
1answer
48 views

How to display custom taxonomy term meta on custom post type

I am new to custom taxonomies, and created a taxonomy with 3 term meta fields using the generator on wp-hasty.com The taxonomy and new fields show up properly on the back end, and I am able to save ...
0
votes
1answer
41 views

Taxonomy term page going to 404

Why are my hits for a taxonomy term page getting a 404 error? I have taxonomy "source', registered in code through a plugin... <?php /** * Plugin Name: Context Taxonomy for Sources * ...
0
votes
0answers
36 views

wp_term_taxonomy count column is not saving to the requirement

As I'm trying to insert SubCategory into wp_term_taxonomy table. After executing the below lines of code $query_term_taxonomy = $wpdb->insert('wp_term_taxonomy', array( 'term_id' =>...
1
vote
1answer
29 views

Modify automatically generation of slug when term is created

I need modify the sanitize of slug when a term is created. For example I'm creating a term with name 0,5 and the slug automatically generated is 05. I need to add a dash in the position of the comma, ...
0
votes
0answers
25 views

Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies

I have 4 custom taxonomies that are associated with a custom post type "procedure": "vehicle_year", "make", "model", "axel_type". I've built a dropdown that is dynamically populated based on the ...
0
votes
1answer
17 views

Query for post term that matches user ID

I'm trying to set up something to decide wether the current post has a custom taxonomy term that matches the current users ID. So far I set up a variable that stores the taxonomy terms of the given ...
1
vote
0answers
13 views

Custom Status of Custom Post type need to EXCLUDE from Taxonomy pages

I have 400 custom post type posts saved as DRAFT which are no longer in use but it can be in future, So for SEO purpose i want now to have all those posts accessible with direct URL but not showing on ...
0
votes
1answer
73 views

How to change a Wordpress term's slug before saving

We are using WP All Import to import product data from a CSV into WooCommerce. Everything works fine (great plugin!) but we have one problem: Two of our product attributes contain disallowed symbols: ...
1
vote
0answers
43 views

Sort order by slug for looped child terms of custom taxonomy

I have page that displays multiple carousels that contains the posts for each child term of parent taxonomy: projects for the custom taxonomy: portfolio-categories for CPT: portfolios. When Portfolio ...
0
votes
1answer
20 views

outputting taxonomy hierarchy

I have a site where I've listed a list of subcategories for a side navigation. I need to break those subcategories into a more specific hierarchy. It's currently outputting a list from a parent ...
0
votes
1answer
44 views

Search Terms - Querying on either description__like OR name__like in the same Term Query?

In my theme's search.php I have a section set up to show terms that fit the search. I want the term to show up IF the $keyword appears in the term's title or its description. I have it set up to do ...
0
votes
1answer
21 views

taxonomy_edit_form_fields output after term fields

I'm using the following code to create a custom metabox on a custom taxonomy page. $term_filter_name_edit = $type . '_edit_form_fields'; add_action($term_filter_name_edit, 'box_term', 1000, 1 ); ...
0
votes
1answer
130 views

Custom Search | Wrong output & question

UPDATE: What I want to achieve is, that a user put's in XXX into the search text input and selects wether it is buy (meta_key=kauf, meta_value=1) or rent (meta_key=miete, meta_value=1) and then pushes ...
0
votes
0answers
14 views

Retrieve post based on previous random post

Two WP_Query to get post from two different Custom Taxonomies. Like This: <?php $args = array( 'posts_per_page' => 1, 'post_type' => 'ads', 'orderby' => 'rand' ); $the_query = ...
0
votes
0answers
25 views

Custom Post Type / Taxonomy / Term - what template to use to avoid 404-page?

I'm working on a site and am using Custom Post Types, Custom Taxonomies and Custom Terms for the first time. All goes well until I click a custom term. What I'd like to happen is get a page listing ...
0
votes
0answers
31 views

Custom value in term REST API

I try to add custom value (lang from polylang) to tags rest api. Finally i have what I want but I'm not happy for my code. I have: { "id": 290, "count": 0, "name": "112211", "slug": "...
0
votes
0answers
12 views

Get count terms only for certain posts type

I want to show a hierarchival menu for my taxonomies. I have 2 posts types : hotel landing_page Those 2 posts types share same taxonomies : hotel localisation France England ...
0
votes
0answers
18 views

Create product categories and subcategories

I have script which creates product categories for me. I'm migrating a WordPress website to a new one, so I exported the categories in a CSV and write an simple plugin to import that file. The file ...
0
votes
0answers
525 views

Post filter with multiple checkbox taxonomy terms

I'm trying to apply the filter based on the multiple checkbox selected. But the filter is not working the way it should be. Please read the sanario below -- custom post type: cars -- custom taxonomy:...
0
votes
0answers
42 views

Multiple custom post types with a single shared taxonomy

I have one taxonomy that I want to be shared, with all its terms, by three custom post types. By default if I associate a taxonomy of the same name to each of the post types they will all have their ...
0
votes
1answer
28 views

Pages of my taxonomy terms are showing all posts

I have two main taxonomies: 1. Libros 2. Asuntos and multiple taxonomy terms: 1. Al Bujari 2. Muslim 3. La Paciencia 4. La Fe 5. La Caridad and many other taxonomy terms using the custom post type: ...
1
vote
2answers
745 views

Check if term object is in array

I want to check if a term object is in an get_terms array, but i really can't figure out how to do it. $subcat_terms = get_terms([ 'taxonomy' => 'product_cat' ]); $subcat_terms generates an ...
0
votes
0answers
121 views

Why does wp_remove_object_terms not work?

Why does this work to remove a single term? $existingTerms = wp_get_post_terms($postID, 'custom_taxonomy'); $newTerms = array(); foreach($existingTerms as $term) { if ($...
0
votes
0answers
109 views

Sort order using get_the_terms() for multiple taxonomies

I'm using get_the_terms() to echo the term names of multiple taxonomies by passing an array of taxonomy slugs, as follows: $terms = get_the_terms( get_the_ID(), array('tax-1-slug', 'tax-2-slug') ); ...
0
votes
1answer
30 views

get_the_terms() not returning expected result

I have created 3 custom taxonomies to tag my posts with. On my single.php template I am attempting to count the number of terms, using get_the_terms() for each custom taxonomy that is assigned to the ...
0
votes
1answer
57 views

WooCommerce: One term for Many Product Attributes

I am using WooCommerce Product Attributes to show mobile phones specifications. For that I have created woocommerce product attributes like OS, Resolution, Color, Weight, Has Fingerprint, Has Dual ...
3
votes
0answers
35 views

Count argument in get_terms has no effect on ouput/doesn't work

I'm trying to get a count of the categories that are subcategories of a category with the id $categoryId. In the documentation for the term query object, which is the primary argument to get_terms, ...
0
votes
0answers
29 views

Display title of all custom posts from same taxonomy term on a custom post template

I have a custom post and I want to display other custom post data from within the same taxonomy term on the template. Ideally i'd like to use a foreach(); loop as this fits in with the other loops ...
1
vote
1answer
460 views

Check if current term is a child of another term

I'm attempting to make an archive template that will apply only to subcategories of a particular term. My structure looks something like this: Events (main taxonomy) Tradeshow Show subcat 1 Show ...
0
votes
0answers
60 views

next_post_link / previous_post_link $in_same_term with $taxonomy not working for custom post type?

I want to get the next post which is within the same taxonomy term for a custom post type. Page: single-product.php next_post_link('%link', '&laquo; '.__('Next product','textdomain'),true,'','...