The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
155 views

Get ID and slug from taxonomy object

I have a custom field to select a category (custom taxonomy) and then I will display a list of all of its child-categories. This works fine when I return the custom field as "term_id." HOWEVER. I ...
0
votes
2answers
2k views

Get Taxonmy Term ID For Current Post

If I wanted to get the category ID for the current post, I would use something like this: <?php foreach((get_the_category()) as $category) { echo $category->cat_ID . ' '; } ?> How can I do ...
0
votes
2answers
325 views

How to reduce the database query-es

Hy, i make a slide for news, the question is how can i reduce the dathabase queries...ore how can i compress this code... http://s16.postimage.org/bswe0vrph/queries.jpg <div id="featured" > ...
0
votes
1answer
264 views

Sort query output on taxonomy term archive by post type using pre_get_posts

I'm using pre_get_posts to adjust the main query of the taxonomy term archive. What I would like to accomplish is that the output is listed by post_type. I have a total of 4 post types and I want to ...
0
votes
1answer
1k views

SQL QUERY needed to get POST category (taxonomy) ? - MUST be SQL statement

Working on a tool outside of Wordpress to query the wordpress database by POST_ID and return the Category Name associated. This is for a real estate website, and the Categories are called ...
1
vote
2answers
410 views

Custom taxonomies making WP very slow - Way to fix?

I've set up three custom taxonomies within my theme for attachment post types within Wordpress 3.5.1. One taxonomy is non-hierarchical (i.e. tags) and has about 800 terms in it. (I'm using WP to build ...
0
votes
1answer
133 views

Append custom parameter to taxonomy/term URI

I have a Custom Post Type named "Cars" and 2 Custom Taxonomies "Ferrari" and "Lamborghini". Each taxonomy has 2 Terms: "New" and "Used". These URIs work as expected: http://myhost/ferrari/new ...
6
votes
1answer
5k views

Custom Taxonomy and Tax_Query

I've been having a lot of trouble getting a WP_Query running with a tax_query on my custom taxonomy. I'm 99.9% sure that my register_taxonomy is correct, as I'm able to tag posts with the right term, ...
0
votes
2answers
734 views

Is it possible to get all term items from a custom taxonomy regardless of post attachment status?

Essentially, I build web sites with galleries, for photographers. Up until now, gallery images have all been attached to posts and I've just pulled from the category taxonomy. This is messy if it's ...
0
votes
1answer
234 views

Tax_Query using WP_Query not working

I cannot get this query to work properly. It just renders one post even though I have three posts that are categories in the 'Firm News' and 'Test' categories. Can anyone see a problem with my code? ...
0
votes
1answer
216 views

How to display posttypes and taxonomy in standard posts, not in a separate label?

I want to display some taxonomies directly in "Posts" label, as standard post, not in a separate label like "Books" for exp., but i don't know how. Is there a way to do this? This is the code: class ...
0
votes
2answers
331 views

Get terms in hierarchical taxonomy

I have a hierarchical custom taxonomy ("photos"), with 3 parent terms color location year Each parent term has several children terms. I have associated the "photos" taxonomy with pages and have ...
0
votes
1answer
180 views

Wordpress Taxonomy Menu

I have got the following simple code. <ul id="filter"><?php echo '<li class="active"><a href="#" class="all">All</a></li>'; if ( $count > 0 ) { ...
1
vote
0answers
207 views

Using multiple taxonomies to sort Custom Posts

I have a post type that includes a taxonomy for (1) location and (2) a day of the week. I'm using the first taxonomy to sort the posts into groups. Here's the loop I'm using: <?php $terms = ...
1
vote
2answers
395 views

$wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies

It's easier if I made an example: I have a custom post type MYPOSTTYPE, with 3 taxonomies TAX_1, TAX_2 and TAX_3 If I have 3 terms: 'TERM_TAX_1' in TAX_1, 'TERM_TAX_2' in TAX_2, and 'TERM_TAX_3' in ...
2
votes
1answer
833 views

Exclude from search all custom posts which are NOT in a taxonomy term

I have a custom post with a taxonomy associated to it. That taxonomy only has one term, and posts either belong to it or not, in a boolean fashion. On the search results, I wish to show the custom ...
0
votes
1answer
214 views

CPT archive page - show one post from each taxonomy term

Basic loop question: I have a custom post type with a custom taxonomy and 3 terms. On the archive page (archive-custom_post_type.php), I would like to display one post from each taxonomy term. Is ...
0
votes
2answers
2k views

Custom SQL Query on Custom Post Type. Order by Taxonomy?

I've created a custom post type called 'publications' and a custom taxonomy called 'topics'. I'm also using the standard taxonomy of 'category'. My Custom Query makes sure that it fetches ALL ...
0
votes
1answer
50 views

Getting the correct value for a post

I have a taxonomy called state which lists all the states. When I create a post I want to select the taxonomy, but also have the name of the state automatically captured in a custom field as well. ...
1
vote
0answers
74 views

can these 3 queries be re-written as 1 query?

I am creating a Dentist directory site, and I have a taxonomy archive page which requires particular grouping and sorting (see below). So far I have only been able to achieve this using 3 WP_Querys ...
1
vote
0answers
167 views

Query most popular terms by taxonomy over 2 week period

I have written SQL for a query that pulls the most used taxonomy terms for selected taxonomies that are published, do not have a parent post are not in a comma separated list over the past two weeks ...
1
vote
1answer
1k views

How to Get All Taxonomies AND All Terms For Each Taxonomy With Post Count Zero

Is there an easy way of obtaining every registered taxonomy and for each registered taxonomy, get all the terms for that taxonomy, and for each term, get the post count, without actually fetching all ...
0
votes
2answers
1k views

Use have_posts() with array of post results retrieved by $wpdb->get_results

I don't know if I'm retarded, crazy or just plain genius or not, but I've decided to use tags as a way to link content site-wide (a big ol' many-to-many relationship website for archiving various ...
3
votes
2answers
2k views

wp_get_object_terms() to get a list of all the terms attached to all the posts in the current query

How can I use wp_get_object_terms() to get a list of all the terms attached to all posts in the current query? For example, for the current query I want to get an array of the terms from the "Alfa" ...
0
votes
1answer
577 views

taxonomy query to output slugs instead IDs

So I got a custom search form with three dropdowns containing three different custom taxonomies. The problem is, I'd need the taxonomy slugs in the address for the search to fuction properly, because ...
0
votes
2answers
235 views

Tax Query trouble

I can't seem to figure this out. The following query works: $xxxx = new WP_Query(array( 'listset' => 'homepage', 'meta_query' => array( array ( 'key' => 'show_home', ...
0
votes
1answer
1k views

Exclude specific taxonomy term when using wp_get_post_terms

i have a single-post_type.php file where i constructud a breadcrumb (or similer to) i am currently using this to get the terms of this taxonomy: $terms = wp_get_post_terms( $post->ID, ...
0
votes
1answer
250 views

Generate multiple tag query URLs

As we know WordPress supports multiple tag queries (',' and '+'). The only problem with this add_query_arg() doesn't handle these methods if a query param is already exists in the URL. From the ...
5
votes
3answers
2k views

Modify Taxonomy pages to exclude items in child taxonomies

I found this question: Theres a way to use $query->set('tax_query' in pre_get_posts filter? which seems to indicate that yes, you can alter the taxonomy query on taxonomy archives via ...
6
votes
2answers
256 views

Assign posts to taxonomy terms instead of the taxonomy terms to posts?

So I have a custom post type (people) with a related custom taxonomy (directory). Instead of editing a person and then choosing the related directory organizations I'd like to "edit" a directory org ...
1
vote
1answer
234 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 ...
2
votes
4answers
3k views

Taxonomy: Why 'with_front' => false DOES NOT WORK?

Seriously, why 'with_front' => false does not work as it should be? It is supposed to remove TAXONOMY BASE NAME and my question is why it does not work? I just dont want the taxonamy base slug ...
3
votes
1answer
3k views

How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy

This answer provides the code for a query that returns an OR match on a taxonomy term: global $query_string; $args['tax_query'] = array( array( 'taxonomy' => 'status' ,'terms' ...
2
votes
2answers
3k views

Advanced Tax Query

Below is my tax query, at the moment this returns all posts which have at least one of the specified terms. Is there a way I can have it return only posts which have ALL of the specified terms? ...
2
votes
2answers
2k views

Improving WP_Query performance for multiple taxonomies

I have a site with several custom taxonomies, and have found that one of the slowest parts of the site is attempting to query with an OR across several of these at once. I'm using a WP_Query like so: ...