Home Forums Add-ons Options Page Custom fields created in Options not showing up on site


Custom fields created in Options not showing up on site

  • I am pretty new to ACF, but have successfully integrated it into many pages on my site. I recently purchased and downloaded the ‘options’ add-on. I can set up an advanced custom field and add information to it via the options page, but when I call a field into my site with PHP, just as I before with fields created on certain pages, nothing displays.

    An example of how I am calling in a field:
    <a href='<?php the_field('logo_1_link'); ?>'><img src='<?php the_field('logo_1_image'); ?>'alt=''/></a>

    here is another:

    			<h2><?php the_field('fest_date'); ?></h2>
    			<a href=''>
    				<h3><?php the_field('fest_price'); ?></h3>

    Neither of these are displaying… I’m 100% sure the field names are correct
    Any idea what I could be doing wrong… Again, it only happens with fields created on the options page.

  • I think your problem is the missing ‘option’ parameter like this:
    <p><?php the_field(‘fest_date’, ‘option’); ?></p>

    From the docs:

    Template Usage
    All the API functions can be used with the “Options Page’s” fields. However, a second parameter is required to target the options page. This is similar to passing through a post_id to target a specific post object.

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

You must be logged in to reply to this topic.