- This topic has 4 replies, 2 voices, and was last updated 5 years, 9 months ago by
cannect.
Viewing 4 reply threads
-
AuthorPosts
-
-
April 15, 2016 at 2:47 am #6296
cannectMemberHi,
I have a custom ‘project_category’ type. I have also a custom ‘project’ type that have some ‘project_category’s attached to it.
So I thought to retrieve all used project_category’s with:
$filter_category_get = get_posts(array( 'post_type' => 'project_category', 'posts_per_page' => -1, 'post_belongs' => 'NOT NULL', // <- my trick does not work 'post_status' => 'publish', 'suppress_filters' => false ));As you can see I do a
post_belongswithNOT NULLhowever this is not gonna work unfortunately.How do you accomplish this?
-
April 18, 2016 at 11:47 pm #6303
-
April 19, 2016 at 3:34 am #6308
-
April 25, 2016 at 1:28 pm #6355
JasonKeymasterHi @cannect!
Sorry for the late reply! Hopefully you’ve already looked into taxonomies a bit more, but in case you haven’t I suggest reading about them here: https://codex.wordpress.org/Taxonomies
It’s not a Piklist feature; it’s a feature of WordPress itself that allows you to add tag/category type structures to any post type (or even share between post types).
Hope this helps!
-
April 26, 2016 at 4:15 am #6358
-
-
AuthorPosts
Viewing 4 reply threads
- The topic ‘Trying to get all categories that has linked posts’ is closed to new replies.