Support

Account

Home Forums Add-ons Options Page Show group fields from an options page

Helping

Show group fields from an options page

  • Hoping I can get some help with code. Basically I have an options page which has a group field (‘page-ad’) which I want to display on pages.

    The fields are:
    ‘image’
    ‘heading’
    ‘sub_heading’
    ‘button_text’
    ‘button_link’

    I have searched here and everywhere, read up loads, tried different examples but haven’t been able to get this to work. Any ideas please?

    Thanks

  • You should probably rename page-ad to page_ad first

    Then I think something like the following should work:

    
    $group = get_field( 'page-ad', 'option );
    $subHeading = $group['sub_heading'];
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.