Home › Forums › ACF PRO › Unable to query custom post type with specific category › Reply To: Unable to query custom post type with specific category
Thanks, John.
If you don’t mind, I am going to ask you a dumb question, as I am still learning.
So, a lot of time, I will google for answers related to what I want.
Below is the solution I found after you told me to use “get_terms”.
Instead of showing only the selected categories for the post, it listed every single category I have created. Can you give me some clue why?
$args = array(
"hide_empty" => false,
"taxonomy" => "project-category",
);
$terms = get_terms($args);
foreach($terms as $term){
echo $term->name.", ";
}?>
I hope I am not disturbing you, though.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.