Support

Account

Home Forums ACF PRO link field with text and class doesn't work

Solving

link field with text and class doesn't work

  • Hi!

    I’m trying to insert a link field type with class. In my flied group, I created a field with link type to external URL, and I insert my class.

    In the cpt where is the field, I insert the URL and the link text.
    In my template single-my.cpt.php I use to rpint this field:
    echo the_field ( ‘label_of_link_field’);

    The results, it’s: the text link,link” and the class there isn’t in the html..

    what have I done wrong?

    thanks for help!

  • <?php the_field(); ?> does not need an echo. (the_field())

    Ah, you need to take get_field_object() for getting the class.

  • This reply has been marked as private.
  • This reply has been marked as private.
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘link field with text and class doesn't work’ is closed to new replies.