Home Forums Backend Issues (wp-admin) show articles with category (food)


show articles with category (food)

  • Good morning,
    I try to explain the problem well.
    I installed the ACF Plugin for the following reason (to have a group where I manage 3 fields).

    Dettagli ACF:
    1) I created a group with ACF with the following name: (Menu Details)
    2) inside the group created ACF I created 3 fields
    nome – type Text
    ingredienti – type Text
    prezzo – type Number
    3) once created the group and the fields with ACF I went to the articles section of WordPress and I created 2 articles
    Menu item (with the following menu CATEGORY)
    Deliver item (with the following delivery CATEGORY)
    *once I have created the two articles and compiled the ACF FIELDS INSIDE THE TWO ARTICLES I created a file inside the WP-CONTENT / THEMES / BETHEME / page-acf.php line 47 to 78 code and I customized the graphics I want to use with the ACF fields that I extract (I ATTACH FILE WITH THE ACF CODE + GRAPHICS).

    IMPORTANT QUESTION: inside the file I created to extract and display the information entered in the ACF fields and see them in the front-end part of the website, I must always specify the following code for each field:
    <?php the_field(‘nome_piatto’, 383); ?>
    <?php the_field(‘ingredienti_menu’, 383); ?>
    <?php the_field(‘prezzo’, 383); ?>
    BUT I ALWAYS HAVE TO SPECIFY (POST_ID) instead I would like to specify not the post_id but the (category ID) that I put on each article … otherwise I would have to create that <? Php the_field (‘price’, 383); ?>

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.