Support

Account

Home Forums ACF PRO ACF+Twig Page Link Field Type Returning Page ID not Page Name

Helping

ACF+Twig Page Link Field Type Returning Page ID not Page Name

  • I have created a ‘page link’ field type. I am using Timber/Twig. The syntax:

    <a href="{{post.big_button_link}}">
      <button class="btn -cta">{{post.big_button_text}}</button>
    </a>

    The problem is this returns the page ID, not the page name. This is what is returned:

    domain.com/141

    expected:
    domain.com/contact

    What do I need to do to correct this issue?

    Cheers

  • can you call the acf function get_field()? ACF only stores page ID values, and sometimes other values that all need to be converted to the URL. This is the same for all fields except the basic field types (the same field types that work with the acf shortcode). So you’ll either need to figure out how to call a function or write custom code in what you’re using. Not sure if this is what you’re talking about, but it came up in a search http://timber.github.io/timber/#acf-cookbook

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

You must be logged in to reply to this topic.