Support

Account

Home Forums Front-end Issues Not showing my fields

Solving

Not showing my fields

  • hello. Is There any simple user guide for us newbie?.
    now I have been trying to view the custom fields I have made on my pages and post without success.
    how do i get most easily custom fields in my theme? I have tried both with free themes and bought themes, without any success at all.
    I HAVE try to read the guides But it dont work for me :/ .
    Regards michael
    denmark

  • hi @unomobil

    i guess you should note what are you doing and what field type are you trying to get.

    but the most usual code to get field’s values is:
    the_field( 'field_name', false, false )

    false, false make ACF to get values from THIS POST. btw you can use $post->ID instead them.

    i guess you know these codes are php codes and you should use <?php and ?> before and after them.

    Hope this help
    A

  • ups :-).

    i have try both via the – funktion.php by inserting the export php code to this file.

    i have also try your example by inserting
    `the_field( ‘field_name’, $post->ID ) inn my theme, both page.php and post.php
    by doing the last example im able to get some fields, etc an number string or text, but then its showet in the left side of the post, and its not showet with the view rules i have set to the field. example: test string to show for login in users, and if page is – contact.

    yes i have try both with and with out the <?php 🙂
    how do i get an text/number or Picture to show on my pages and postes ? .

    michaelm

  • Hi @astrixoblix

    Please note the ‘false, false’ parameters are NOT needed. Please read the docs to see why.

    The 1st false is the post_id param. This is false by default
    The 2nd false will prevent the value from being formatted. This will cause unexpected results and should be left out or true – as default.

    Thanks
    E

  • Hi @unomobil

    To answer your question, you can use the get_field and the_field functions to get and display data onto your template.

    Please note, you MUST edit your theme’s template file to add the code. Please read the getting started documentation to learn which template files to edit and what this will do.

    Thanks
    E

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Not showing my fields’ is closed to new replies.