2064 posts
  • Has collected 50+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
  • Located in United States
Landonw says

So I’m trying to get posts from a custom taxonomy’s category, which I’ve attempted 100 different ways, currently like this:

    $posts = get_posts(array('tax_query' => array('taxonomy' => 'Products'), 'cat' => $item->ID));

the $item->ID is a valid category ID, which I’ve ran several tests on , so that isn’t the problem. The taxonomy is also really named “Products”, so that’s dead on. Am I doing something wrong? I need this done ASAP for my client.

3468 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Moderator says

I think you can just do this:

$posts = get_posts(array(
  'taxonomy' => 'products',
  'term' => $term->name
));

I’m not sure that uppercase taxonomy names are allowed in WP3 .1 btw.

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
2064 posts
  • Has collected 50+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
  • Located in United States
Landonw says

wpCanyon, you’re a bro and all, but I already did. D:<

331 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+3 more
PaulWinslow says

I know I had a couple of issues with custom taxonomies that were due to using a capital, so “Portfolio” threw issues whereas “portfolio” wouldn’t be a problem.

Just throwing that in there incase it’s any help.

2064 posts
  • Has collected 50+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
  • Located in United States
Landonw says

Paul: You should make a show called “True Bro’d”. Anyways, didn’t work.

2064 posts
  • Has collected 50+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
  • Located in United States
Landonw says

Well, I got that working. Now I MUST ask – how do you use query_posts to order posts by a meta field? I think it would work with WP Query but not with query_posts.

2064 posts
  • Has collected 50+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
  • Located in United States
Landonw says

Nevermind, got it!

by
by
by
by
by
by