35 posts
  • Trendsetter
  • Weekly Top Seller
  • Author Level 9
  • Affiliate Level 2
+5 more
madza
says

Hi,

I can’t get some cat from custom post!

WP_Query( array('post_type' => 'portfolio', 'portfolio_taxonomy' => 'Web, LogoWork, Other Work'));

I get only Web and LogoWork but Other Work is missing

What I do wrong?

Thanks You! madza

3535 posts
  • Power Elite Author
  • Author Level 12
  • Trendsetter
  • United States
+13 more
sevenspark
Moderator
says

Perhaps if you run the query that way you need to use term slugs rather than term names? That might explain why the term with the space isn’t returning.

You may also want to read up here: http://codex.wordpress.org/Function_Reference/WP_Query#Taxonomy_Parameters

2627 posts Put a Donk On It
  • Weekly Top Seller
  • Elite Author
  • Exclusive Author
  • Featured Author
+11 more
ThemeProvince
says

Surely you should use an array for including multiple taxonomies in your query.

35 posts
  • Trendsetter
  • Weekly Top Seller
  • Author Level 9
  • Affiliate Level 2
+5 more
madza
says

Thanks You,

I do something wrong but I don’t see what. It’s not work for me. Maybe someone can show me more?

I check link for taxonomy parameters and make this:

new WP_Query( array('post_type' => 'portfolio', 'tax_query' => array( array( 'taxonomy' => 'portfolio_taxonomy', 'field' => 'slug', 'terms' => array('Web', 'LogoWork', 'Other Work')))));

The same problem!

58 posts
  • 6 Years of Membership
  • Affiliate Level 3
  • Author Level 9
  • Collector Level 2
+6 more
DigitalCavalry
says

Thanks You,

I do something wrong but I don’t see what. It’s not work for me. Maybe someone can show me more?

I check link for taxonomy parameters and make this:

new WP_Query( array('post_type' => 'portfolio', 'tax_query' => array( array( 'taxonomy' => 'portfolio_taxonomy', 'field' => 'slug', 'terms' => array('Web', 'LogoWork', 'Other Work'))))); The same problem!

Check the operator value, possible that in default is set to AND , so queried post must be associated with all portfolio categories you have typed in query. Change to this and try.

new WP_Query( array('post_type' => 'portfolio', 'tax_query' => array( array( 'taxonomy' => 'portfolio_taxonomy', 'field' => 'slug', 'terms' => array('Web', 'LogoWork', 'Other Work'), 'operator' => 'IN'))));
35 posts
  • Trendsetter
  • Weekly Top Seller
  • Author Level 9
  • Affiliate Level 2
+5 more
madza
says

Thank You, I tried! But same problem!

It’s showed only first taxonomy and not show category with space!

Maybe that is WordPress bug!

Or maybe someone knows other way how to get out from custom post necessary category with space?

Thanks!

madza

2627 posts Put a Donk On It
  • Weekly Top Seller
  • Elite Author
  • Exclusive Author
  • Featured Author
+11 more
ThemeProvince
says

Dunno why people use WP_Query. Using query_posts is far easier to implement.

1383 posts
  • 5 Years of Membership
  • Affiliate Level 2
  • Collector Level 2
  • Exclusive Author
+1 more
wpCanyonThemes
says

Dunno why people use WP_Query. Using query_posts is far easier to implement.

query_posts should be used to change the main loop ONLY .

35 posts
  • Trendsetter
  • Weekly Top Seller
  • Author Level 9
  • Affiliate Level 2
+5 more
madza
says

For me query_posts work similar! Can’t get out with space!

35 posts
  • Trendsetter
  • Weekly Top Seller
  • Author Level 9
  • Affiliate Level 2
+5 more
madza
says

I found a solution, thank you all!

by
by
by
by
by
by