Support

Account

Home Forums Add-ons Options Page the_field from custom options page

Solving

the_field from custom options page

  • It just doesn’t work…
    I added a text new field to the “Theme Options” group I made a new tab also…
    Then I see that it comes up on my “Theme Options” page
    but <?php the_field(‘name_of_field’,’options’); ?> doesnt show anything
    I copied and pasted in ‘name_of_field’ to make sure its right.
    Whats wrong? Thanks.

  • Hi @dfoley23

    Could you please provide me with the PHP code to add the options page, JSON export file of the field group, and a screenshot of the options page?

    Keep in mind that you need the PRO version or Options Page add-on to make it works.

    Thanks!

  • Theme Options Page
    s
    https://drive.google.com/file/d/0BwddMVI60KgFdUR0V0RqejNqUTA/view?usp=sharing

    So turns out I just needed to put some html in these fields…
    I wrapped the number with a <span> and now it works…

  • Hi @dfoley23

    If that is the case, it’ll be simpler if you wrap it from your templates. You can use a code like this when you want to show the number:

    <span><?php the_field(‘name_of_field’,’options’); ?></span>

    Hope this helps!

  • Well thats the problem I don’t actually want the spans at all.
    But The field in ACF wont output anything if I don’t add html in the ACF field itself.

    Is this a known issue? Would be great if it could be fixed as I may just want the number so I can treat it like an int in php.

    Thanks

  • Hi @dfoley23

    I believe that’s mostly caused by your template. Could you please show me the example of the page that has the numbers with and without the span?

    Thanks!

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

The topic ‘the_field from custom options page’ is closed to new replies.