Support

Account

Home Forums Feedback Link Field – Title Text

Solving

Link Field – Title Text

  • I am so excited to use the link field, as it really simplifies the amount of fields I need to create/output as well as the UI for the author!

    I am bummed to see that the “Title Attribute” is not available. It would be great if you could toggle this field on and off in the field settings. We run SEO audits on our sites and title text on links is always a red flag, so I will need to add an additional field for title text to all “Link” fields.

    Let me know if this is feasible!

  • Hi @bravenewmedia

    Not sure what you mean.

    When using the Link field with a Return Value of ‘Link Array’ you can get ‘title’ like so:

    <?php
    $link = get_field('link');
    echo $link['title'];
    
    // Button Example
    ?>
    <a class="button" href="<?php echo $link['url']; ?>" target="<?php echo $link['target']; ?>"><?php echo $link['title']; ?></a>
    

    It is the ‘Link Text’ in the dialogue box when adding the link. Know what I mean?

  • Hi Keith,

    Thanks for getting back to me!

    I think this is a little confusing because there is an overlap in terminology. I’m referring to the title attribute you can put on <a> tags.

    <a class="button" href="<?php echo $link['url']; ?>" target="<?php echo $link['target']; ?>" title="TITLE ATTRIBUTE TEXT"><?php echo $link['title']; ?></a>

    HOWEVER, I just did some more research about the title attribute for accessibility and SEO and have found that it makes no difference for either of these things. So you can disregard my request completely!

    I am now going to reach out to our SEO audit tool and ask them why this is part of their grading/criteria.

    Thank you,

Viewing 3 posts - 1 through 3 (of 3 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.