2067 posts
  • Collector Level 3
  • 5 Years of Membership
  • 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.

3535 posts
  • Power Elite Author
  • Author Level 12
  • Trendsetter
  • United States
+13 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
  • 5 Years of Membership
  • Affiliate Level 2
  • Collector Level 2
  • Exclusive Author
+1 more
wpCanyonThemes
says
2067 posts
  • Collector Level 3
  • 5 Years of Membership
  • Exclusive Author
  • United States
Landonw
says

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

381 posts Simple is the new black.
  • Weekly Top Seller
  • Elite Author
  • Author Level 7
  • 5 Years of Membership
+5 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.

2067 posts
  • Collector Level 3
  • 5 Years of Membership
  • Exclusive Author
  • United States
Landonw
says

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

2067 posts
  • Collector Level 3
  • 5 Years of Membership
  • 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.

2067 posts
  • Collector Level 3
  • 5 Years of Membership
  • Exclusive Author
  • United States
Landonw
says

Nevermind, got it!

by
by
by
by
by
by