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.

3503 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:<

338 posts
  • Has been part of the Envato Community for over 4 years
  • Located in United Kingdom
  • Made it to the Authors' Hall of Fame
  • Sells items exclusively 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!

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by