5
votes
2answers
301 views

Is There a Difference Between Taxonomies and Categories?

I've been reading the codex for WordPress closely and am confused about the vague definitions between what a Taxonomy is and what a Category is. For that matter, term is also a word that is used in ...
0
votes
1answer
23 views

get_adjacent_post_link excluded_terms ignored

I call the function ´get_adjacent_post_link´ using the argument ´$excluded_terms´. But this argument is ignored. This is how I call the function. get_adjacent_post_link( '%link', '<span ...
1
vote
1answer
42 views

Check if a post is in any child category of a parent category

In a site I'm developing, I have the following category structure: * movies (parent) * thriller (child) * comedy (child) * drama (child) The current post is in the comedy category. The ...
0
votes
0answers
53 views

Cannot get the categories of a single custom post

I'm trying to display in a class all the categories each custom post is part of. So for example the wanted output is : <ul> <li><a href="" ...
0
votes
1answer
45 views

Update wordpress post terms programatically

I am currently working with woocommerce for wordpress and making a custom plugin. I would like to update the product categories manually through my own admin panel, here is what I have so far: ...
0
votes
2answers
231 views

Use get_term_children to get the sub category of a parent category for the current post

In my WooCommerce theme I've created a root category: 'Brands' then for each product I've added it's brand as a sub category to the 'Brands' parent category. On the product page I want to display the ...
0
votes
0answers
13 views

Wordpress double post name distinguish by term [duplicate]

I am working on a store locating Wordpress template where I have 5 categories for services. In each category I have 500 cities. I have rewritten my url from: http://www.website.com/post-type/post ...
0
votes
1answer
58 views

Exclude categories by ID

I've searched this site and tried all kinds of ways to exclude categories 1 and 7 from this list, but nothing is working. No errors but doesn't hide the cats either. Categories 1 and 7 are not empty, ...
1
vote
1answer
163 views

Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms

I am using Isotope to filter posts on the fly from my archive pages. I have a Custom Post Type called "art". On the sidebar, I've created links to yearly archives on my sidebar, i.e. 2014, 2013, ...
0
votes
1answer
387 views

Using in 'category_name' in '$query->set();'?

Here's the function I have in my theme's functions.php: function better_editions( $query ) { // Categories act as 'Editions' on my site $get_edition = get_query_var( 'category_name' ); ...
0
votes
3answers
98 views

Get a count of how many times a term or a category is used in posts

I need to find out the number of times a term/tag or category is used in a post in WordPress. I wrote the below SQL query. SELECT t.name , count(*)FROM wp_terms t JOIN wp_term_taxonomy tt ON ...
2
votes
1answer
144 views

When to use 'get_category_by_path' vs. 'get_term_by' to get category object from `get_query_var( 'category_name' )`?

I'd like to retrieve the category object from the category name, using the public query variable category_name, via get_query_var( 'category_name' ): $cat = get_query_var( 'category_name' ); There ...
0
votes
0answers
26 views

How to choose the parent category that shows when using multiple custom categories [duplicate]

When a post is in two or most custom categories, how can I specify the parent category name that I want to show up? An example is the custom post type "tour". It is in the following categories: ...
0
votes
2answers
80 views

Why is my post categories not displaying?

My post categories are empty. When editing or adding a post they are not displayed in the box. On the /wp-admin/edit-tags.php?taxonomy=category page none of the categories are displayed there either. ...
1
vote
1answer
1k views

Order get_terms() By Custom Field

I want to order my categories like I order my pages. I've added an extra field called Order to my taxonomy, but how do I order my terms by this value? Adding and Saving my Order Value: /** Add New ...
0
votes
1answer
36 views

How to store category and tags separatly on wordpress?

I am trying to insert data manually on all tables on the back end. I am facing a problem while inserting data to wp_terms. I can successfully insert category into wp_terms and define relationships in ...
0
votes
1answer
43 views

Wordpress custom taxonomy

I'm using a custom taxonomy called 'product_cat' and post type called 'product', I'm trying to display all parent terms, child terms and grandchild terms within the taxonomy. So I get a list like ...
0
votes
1answer
32 views

Find And Add Category to Posts

My WordPress site is a mess. Previously, it had 80+ categories, with 1-2 sub-categories. After creating blueprint for this site (I'm restructuring the site completely), I have new 6 categories and ...
1
vote
0answers
193 views

Get posts under a category with SQL

How can I retrieve posts under a category with plain SQL with out using WordPress native api's like get_pages? My Wordpress table wp_terms contains a term named Restaurants. I want to list the post ...
2
votes
1answer
139 views

Category page only displaying the posts from a custom type

Situation I have two cpt: Projects Works In these two CPT I share the same taxonomy 'Category', and the same terms: Architecture Landscape Interior Design I have URLs like ...
0
votes
1answer
5k views

List all custom post type posts from a given category?

I have a custom post type myposttype and it's taxonomy is called myposttype_categories. myposttype_categories have multiple terms inside, such as foo and bar. The tricky question is - how do I list ...
3
votes
1answer
121 views

Excluding posts from a category but only if they're not in multiple categories

I am looking to exclude a category in Wordpress. I am referring to the Wordpress Codex page on wp_query but I am having the following problem: I want to exclude posts from category 1, but if a post ...
0
votes
1answer
203 views

Post to inherit custom category background image from parent

I have a custom field on a category where you can add an image. I have it as a background image to show on the category's archive page, like so: archives.php <body style="background:url('<?php ...
1
vote
1answer
224 views

How to Make a Category Always Selected?

I'm trying to write a function to make certain terms of default category always selected. When the user is writing a new post, the term checkbox should be checked and he shouldn't be able to unckeck ...
0
votes
1answer
164 views

wp_delete_term or wp_delete_category?

Hi I need a simple piece of code to delete a category for a custom plugin, but I just found two function references that seems quite the same: Function Reference: wp_delete_term Description: Removes ...
2
votes
1answer
246 views

Glossary with Custom Post Type

I´d like to make a glossary. It should looks like: Index-Nav 0-9 | A B C ... M ... X Y Z B BMW M Mercedes ... ALL entries from index-nav (A-Z, O-9) should be visible in a <ul> and should ...
0
votes
2answers
463 views

How can I get category ID by category name?

I have a few categories with the same name [some of them are sub-categories]. And I want to get an array of ID's for certain cattegory name. I tried this: $term = get_term_by('name', $cat_name, ...
0
votes
1answer
219 views

Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?

I added the code below and successfully changed my CPT slug for the taxonomy terms. My blog permalinks are /article/%postname% in case you wonder, and I'd like to keep it that way, so no clashes with ...
0
votes
1answer
195 views

Get Categories Where Taxonomy Equals 'n'

I have a custom taxonomy(the taxonomy is types) that is basically a selector that tells WordPress which section of the site to place the new post. So for example I create a new post and select ...
2
votes
2answers
483 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 ...
2
votes
1answer
513 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, ...
6
votes
5answers
4k 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 ?
0
votes
1answer
195 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 ...
0
votes
1answer
1k views

Update term count using a callback function

With the wp_update_term_count_now, how can I use the update_count_callback to specify my own count. I need to include counts from another database that the current database category is able to ...
1
vote
2answers
455 views

List Terms in Category

I want to list all terms of a specific taxonomy used in a category. Like I have a taxonomy called 'Manufacturer' and a category 'Shoes'. Each post in this category has a term like 'Nike', 'Adidas' or ...
1
vote
1answer
1k views

Fixing category count

Somehow my post counts are incorrect due to inserting rows via php. I have the following code to update the count, is it correct? global $wpdb; $result = mysql_query("SELECT term_id,term_taxonomy_id ...