2032 posts
  • Has been a member for 4-5 years
  • Bought between 50 and 99 items
  • Exclusive Author
  • 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.

3418 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 100 and 499 items
  • Referred more than 2000 users
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer 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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Serbia
wpCanyonThemes says
2032 posts
  • Has been a member for 4-5 years
  • Bought between 50 and 99 items
  • Exclusive Author
  • United States
Landonw says

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

327 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Sold between 50 000 and 100 000 dollars
  • United Kingdom
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.

2032 posts
  • Has been a member for 4-5 years
  • Bought between 50 and 99 items
  • Exclusive Author
  • United States
Landonw says

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

2032 posts
  • Has been a member for 4-5 years
  • Bought between 50 and 99 items
  • Exclusive Author
  • 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.

2032 posts
  • Has been a member for 4-5 years
  • Bought between 50 and 99 items
  • Exclusive Author
  • United States
Landonw says

Nevermind, got it!

by
by
by
by
by
by