Home › Forums › Backend Issues (wp-admin) › show articles with category (food) › Reply To: show articles with category (food)
ACF fields are tied to individual posts, not categories. If you want to display the fields dynamically without specifying a post ID, simply use:
php
Copy
Edit
<?php the_field(‘nome’); ?>
<?php the_field(‘ingredienti’); ?>
<?php the_field(‘prezzo’); ?>
This will automatically pull the data from the current post. However, if you need to filter and display fields based on a category, you’ll need to query posts assigned to that category and retrieve their ACF fields. You can apply this to any menu listing or structured content, like on mangmenuprices.ph, where details such as names, ingredients, and prices need to be dynamically managed.
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.