Home Forums Front-end Issues Field created – Value missing


Field created – Value missing

  • Hi,

    I never used that plugin which looks great, and what I want to achieve is quite basic, so I hope somebody can help !

    Here is my problem:

    I created a field named « subtitle » which is supposed to appear on an overlay, on the portfolio thumbnails of my theme.

    I inserted the code like that:

    $gallery .= '<h2 class="portfolio-title">' . $title . '</h2>';
    $gallery .= '<h3 class="portfolio-subtitle">' .the_field('subtitle') .'</h3>';								
    $gallery .= '<span>' . ut_generate_cat_list( $portfolio_cats ) . '</span>’;

    In the front-end, I see that the field is there, but no value appears in it (see Firebug screenshot).

    What do I need to get the value ?
    Do I need to insert a function in my function.php file ?
    Did I make a mistake in my code ?

    Thanks in advance for helping !

  • Hi @photoman6300,

    Thanks for the post.

    Please note that custom fields called outside the main posts() loop will require an additional post id parameter to be added to the get_field() or the_field() function so as to tell ACF where to fetch data from.

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

The topic ‘Field created – Value missing’ is closed to new replies.