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.

Filter by
Sorted by
Tagged with
0 votes
2 answers
2k views

Missing term_id and term_taxonomy_id when adding a term using wp_insert_term() function

Check the line; list($term_id,$taxonomy_id) = $result in the code snippet below. ( towards the bottom ). Why am I missing the term_id & the $taxonomy_id when I echo their values? Aren't ...
Average Joe's user avatar
  • 1,879
3 votes
2 answers
1k views

Are Categories, Tags and Custom Taxonomies any different in regards to SEO?

Simple question, really. I know pretty much nothing about SEO, and i'm trying to define a good structure for this clients online magazine. I already know i'll be using a few custom taxonomies along ...
moraleida's user avatar
  • 2,245
1 vote
2 answers
834 views

how does get_term_by know which term to return when the same term appears twice in a hierarchical taxonomy?

This is from the codex. <?php get_term_by( $field, $value, $taxonomy, $output, $filter ) ?> Suppose I have a taxonomy system as follows; taxonomy: "healthy foods" and it's a hierarchical ...
Average Joe's user avatar
  • 1,879
2 votes
2 answers
5k views

Importing data from spreadsheet into wordpress DB, along with custom taxonomies and their terms

I am importing a large DB from an Excel spreadsheet into a wordpress DB. I was going to do it manually by creating a new table but decided to import it into the existing wordpress framework as it will ...
JamesG's user avatar
  • 239
18 votes
1 answer
130k views

Get Posts by Custom Post Type ,Taxonomy, and Term

Ok, so i have a Custom Post Type called "Services". This custom post type has a taxonomy called "Areas" and there's 5 terms in that taxonomy. Let's say I have 10 posts on "Services" and there's 5 ...
Rise's user avatar
  • 655
0 votes
1 answer
1k views

How to check if a term is parent to another?

I have made a product page. Wich lists all products site.com/products. At the product page there is a navigation wich lists all the terms in the taxonomy 'kategori'. The taxonomy is set to ...
galengodis's user avatar
0 votes
1 answer
929 views

Get_the_term_list inexplicably adds values in foreach

I'm trying to get three values from all my custom posts, to populate a Google Map with the places where I've been. All is going fairly well, except for an issue I'm having with get_the_term_list. For ...
WouterB's user avatar
  • 357
0 votes
1 answer
520 views

Ordering taxonomy output in this function

I found (googled) this function which performs almost exactly as I need. Creating a link text structure (breadcrumb) of terms for a CPT i.e. Parent Category -> Child Category -> Grand Child Category ...
Rob Oliver's user avatar
1 vote
1 answer
80 views

How do I determine if a certain term is in an array?

I am currently running the below wordpress php and it is creating a list for me. $term = get_term_by( 'id', $ptc, $taxonomy ); echo '<li><a href="'. home_url() .'/taxon/'. $pt->slug .'/' ....
TJ Sherrill's user avatar
2 votes
2 answers
24k views

get_terms of post->id

I need a way to use get_terms and have it only grab the taxonomies of the current page. Example http://sitename.com/genre/hip_hop would only grab the taxonomies that also have the hip hop genre ...
Khey's user avatar
  • 33
0 votes
3 answers
2k views

How to get WordPress term attached to the Post?

How to retrieve all WordPress terms attached to the Post and Other Post type? Assumed I don't know/don't care about the taxonomy, term name/term id etc, the only thing I know is post_id. Thank you.
takien's user avatar
  • 369
0 votes
1 answer
1k views

Taxonomy Checkbox Admin Panel

I have a basic Admin panel allowing Admin to save options using Checkbox. Checkboxes are used as multiple selection is necessary for the option So, Admin Option - Checkbox 1 - Checkbox 2 - Checkbox 3 ...
salocin's user avatar
  • 239
1 vote
1 answer
2k views

get_terms - name__like a number

Using Get Terms with the argument of 'name__like', how do i return all results that start with any number? I've tried: $feats = get_terms( 'movies', array('name__like' => '1', 'name__like' => ...
Carpy's user avatar
  • 310
0 votes
1 answer
82 views

Retrieve all term IDs of post

I have an array of term IDs that I'd like to filter my query with, but most wordpress functions seem to need the 'taxonomy' field entered too. Is there a reason for this? Passing the taxonomy ID ...
mjjwatson's user avatar
  • 147
1 vote
1 answer
236 views

Which post does a taxonomy term belongs to?

I’m having a page which displays all custom taxonomy terms for a particular type which I get from the URL. I use this code to retrieve all the terms: $args = array( 'post_type' => '...
Mestika's user avatar
  • 770
0 votes
1 answer
10k views

How to find taxonomy parent id from child taxonomy page?

This site is in beta at: beta2.dixiestarkhome.com , the page for context is: http://beta2.dixiestarkhome.com/taxon/upholstery/sofas-settees/ my custom taxonomy is "taxon", sofas is a child of ...
TJ Sherrill's user avatar
2 votes
1 answer
4k views

Custom taxonomy term as class?

I'm trying to add a class to a container within a query, ideally I'd like to use the terms from a custom taxonomy I have setup (guide-categories). As an example: <div class="myclass *taxonomy ...
user862153's user avatar
6 votes
3 answers
2k views

Control term order on a per-post basis

I have a taxonomy in which term order matters, but varies from post to post. So I want to be able to set the order that terms are displayed in on a per-post basis: My first post | Tagged: Apples, ...
supertrue's user avatar
  • 3,016
0 votes
1 answer
60 views

Most allowed Taxonomies in Appearance->Menus

I am managing a large list(300) of "places" taxonomies, and I need to create a menu with those places. the WordPress menu system seems like the way to go but when I save the menu I am getting a PHP ...
Mike's user avatar
  • 813
0 votes
2 answers
488 views

Related terms - Terms that feature in post of current term

Not sure how hard this is but i'll try and explain it as simply as possible. I have a custom post type called: "Movies" with an taxonomy term called "Actor" For example purposes suppose were on the ...
Carpy's user avatar
  • 310
1 vote
1 answer
3k views

Displaying terms by first letter

I run a book review blog and I have multiple pages that lists the reviews by different things (rating, book title, and author) I have custom taxonomy for authors and I basically have my code list all ...
Catiebug's user avatar
0 votes
1 answer
526 views

Improving Co-Authors Plus Plugin [closed]

I've been using the Co-Authors Plus plugin for assigning multiple authors to posts. The authors are very particular in the ordering of the names on the public-facing side of the website so I need the ...
kingkool68's user avatar
  • 1,219
1 vote
1 answer
570 views

Changing stylesheet depending on custom taxonomy terms

My client would like the background & header colors to switch depending on terms within the custom taxonomy 'Grades'. These terms are kindergarten, first grade, second grade, etc... (all ...
Kathy's user avatar
  • 43
1 vote
1 answer
1k views

Is it possible to get_terms by author?

I get terms from all my posts with get_terms, $tags = get_terms( 'mytags', '&number=5&orderby=date&order=desc&hide_empty=1' ); foreach ( $tags as $tag ) { echo '<a href="'....
Philip's user avatar
  • 2,019
0 votes
1 answer
542 views

Bug using wp_insert_term with switch_to_blog

I'm running a network of about 80 sites using WP multisite 3.2. I'm experiencing irregularities using switch_to_blog whith wp_insert_term. To test this I have disabled all plugins, and am testing on ...
Erik Stromme's user avatar
11 votes
7 answers
43k views

How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms

I want to export all Wordpress categories (no posts, just categories) from one blog to another. How can I do that ?
chubbyk's user avatar
  • 371
0 votes
1 answer
502 views

Shared terms between taxonomies

Need some help from you. It's a matter of classification. Here is the deal: I've got a custom post type about movies and I set up some custom taxonomies (non hierarchical, so acting like tags) for ...
carletto0282's user avatar
0 votes
1 answer
11k views

Display Child Categories of Current Post ID

I'm starting to love this place more and more, super helpful! Anyway, todays dilemma is as such: I want to display as a list the child terms only, of a specific parent term, of a custom taxonomy, ...
user avatar
4 votes
1 answer
3k views

Is there a filter/action to add content to WP admin metaboxes?

I want to add an instruction into a custom term meta-box. Is there a hook to add this or is it easiest just to use JavaScript?
patnz's user avatar
  • 1,459
1 vote
1 answer
2k views

How to insert an array of terms using wp_insert_term?

WP provides a function to insert terms: <?php wp_insert_term( $term, $taxonomy, $args = array() ); ?> I have 60 $terms, each has its own $args, I want to prepare the 60 terms as an array, ...
Jenny's user avatar
  • 1,757
1 vote
1 answer
311 views

one term two taxonomy's?

Anybody got any solutions for this... I'm building an app where I have two heirchical custom taxnomies acting as custom categories. So i've got cat1 and cat2 taxonomy. What I want to do is copy a ...
Daithí's user avatar
  • 665
0 votes
1 answer
2k views

Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category

I'm trying to get the terms of a taxonomy (kind) and the number of content they have but only for a specific category (get_parent_page_slug() = city name = category slug). This is what I have so far: ...
alzuwaga's user avatar
0 votes
1 answer
5k views

Set post terms by term id

I'm trying to add post to custom terms within a custom taxonomy. Not sure if I'm tackling this right. So far we have the custom taxomony 'warehouse', and the custom term 'Old Stock'. Problem is that ...
Daithí's user avatar
  • 665
1 vote
5 answers
1k views

How to associate an image with a term taxononmy and publish it on frontpage?

I couldn't find the solution anywhere else, so I believe is a valid question for this website. I think my problem is divided in two parts. I created a custom taxonomy called "Type" and within it, I ...
Daniel's user avatar
  • 1,206
0 votes
2 answers
1k views

Taxonomy terms with the same name are updated between separate custom post types

I have 3 custom post types, and they each have a taxonomy labelled location, with some term names shared between them. The problem is, if I update a term name in any of the 3 custom post types, it ...
Andrew's user avatar
  • 1,163
0 votes
1 answer
80 views

Query for specific taxonomy that executes a particular loop depending on volume of posts?

Is it possible to create a special wp query that looks to see how many posts exist in a specific taxonomy, or taxonomy term, and executes a particular loop depending on the volume of posts? My idea ...
Mr.Brown's user avatar
  • 1,025
0 votes
1 answer
429 views

Unsetting post_tag taxonomy breaks term description for other taxonomies

Here's something I can't figure out. I don't need the default post_tag taxonomy, so I'm removing it with this piece of code : function mwm_unregister_taxonomy(){ global $wp_taxonomies; $...
mike23's user avatar
  • 5,981
0 votes
1 answer
163 views

Modify my code - which takes the first sentence of the post and use it as a h2 tag - to work outside the loop

My code takes the first sentence of a post and places it's content inside a variable. The problem is it works only inside the loop. I need help making this code outside the loop, becouse I want to ...
webmasters's user avatar
0 votes
1 answer
300 views

Order taxonomy terms by the frequency of use in the last 30 days

I would like to know how to order the terms in some taxonomy according to their frequency of use in posts in the last 30 days. What I am looking for is the most optimal method how to add "orderby" ...
Ján Bočínec's user avatar
0 votes
1 answer
1k views

how to list parent terms only

I have the following code to list all terms, but I need a code where I can list only "parent terms" as they all have child terms too <?php // output quick links list of countries $terms = ...
rakesh's user avatar
  • 1
1 vote
1 answer
1k views

How to edit/remove a term that's in multiple taxonomies?

Some of the terms on my site appear with the same exact slug, in multiple taxonomies. For example: 'education' appears in both the 'department' taxonomy and the 'topic' taxonomy. Now, I can't seem ...
supertrue's user avatar
  • 3,016
1 vote
1 answer
3k views

tax_query operator woes

I am trying to filter posts by multiple taxonomies. My code below works great, but their is one thing I can't quite figure out. When I filter the posts it seems that they only show the posts that ...
kramdraw85's user avatar
4 votes
1 answer
601 views

Large taxonomy (2000+ terms), causing WordPress to hang

I have a large taxonomy (and about to grow a lot larger) with several thousand terms in it. When I'm editing a post, there is now a significant hang when it goes to load the term list. Has anyone run ...
Jonathan Wold's user avatar
0 votes
1 answer
229 views

Combining these queries? (Same taxonomy term + same category as post)

I´m not to good at coding so I could use some help with this! I have a single page which below the post shows more posts from the same category. Then I have another single page which in a similare ...
Johan Dahl's user avatar
  • 1,343
0 votes
1 answer
98 views

Create Terms on taxonomy by text field

I want to add terms on a my taxonomy dynamically by a text field and button sample taxonomy: place_taxonomy - island_term like: [Textfield] [submit button]
adolfozen's user avatar
6 votes
1 answer
10k views

get_term_by not working when in functions.php

I have an odd issue with get_term_by(). It's working fine when I use it inside a template, but when I use it in functions.php it just returns false. $term = get_term_by('slug', 'some-term', 'some-...
Andrei's user avatar
  • 205
0 votes
1 answer
119 views

Checkboxed term search

Anyone know if I can make a checkbox-list with all terms from a taxonomy, and search for the posts belonging to the checked terms? Listing categories in the checkboxes also would be a bonus!
Johan Dahl's user avatar
  • 1,343
1 vote
1 answer
3k views

List taxonomy terms for post as checkboxes

I'm modifying the plugin Wordpress Frontend User for my custom post type(s). What I need to edit is the custom taxonomy terms. In order to do this, I need to list my terms as labels and have ...
Josh Allen's user avatar
27 votes
4 answers
150k views

get_posts assigned to a specific custom taxonomy term, and not the term's children

Say I have the following taxonomy terms: Term 1 Term 1.1 Term 1.2 Term 2 Term 2.1 How can I get only posts that are assigned to Term 1 and not include those that are assigned to Term 1.1 or ...
robertwbradford's user avatar
0 votes
2 answers
2k views

wp_set_object_terms not working inside loop

I have the following code $genres= array('action', 'comedy', 'horror'); foreach($genres as $genre){ $ret = wp_set_object_terms( $postId, $genre, 'genres'); } But this code associates only ...
Albin Joseph's user avatar