35 posts
  • Had an item that was trending
  • Had an item that became a weekly top seller
  • Has sold $250,000+ on Envato Market
  • Has referred 10+ members
+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: Sold more than $1M on Envato Market
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Had an item that was trending
  • Located in 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
  • Had an item that became a weekly top seller
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
+11 more
ThemeProvince
says

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

35 posts
  • Had an item that was trending
  • Had an item that became a weekly top seller
  • Has sold $250,000+ on Envato Market
  • Has referred 10+ members
+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
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+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
  • Had an item that was trending
  • Had an item that became a weekly top seller
  • Has sold $250,000+ on Envato Market
  • Has referred 10+ members
+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
  • Had an item that became a weekly top seller
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
+11 more
ThemeProvince
says

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

1383 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+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
  • Had an item that was trending
  • Had an item that became a weekly top seller
  • Has sold $250,000+ on Envato Market
  • Has referred 10+ members
+5 more
madza
says

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

35 posts
  • Had an item that was trending
  • Had an item that became a weekly top seller
  • Has sold $250,000+ on Envato Market
  • Has referred 10+ members
+5 more
madza
says

I found a solution, thank you all!

by
by
by
by
by
by