• Resolved sherriwmi

    (@sherriwmi)


    Hello,

    The link field is adding the link’s title to the actual URL. Here is the markup that is being generated:

    Register

    – WP version = 4.7.3

    – ACF version = Version 4.4.11

    – ACF Link Picker version = Version 1.2.8

    – OS/browser and browser version = Mac OSX 10.11.8, Chrome v56.0.2924.87 (can also replicate in an older version of Mac and Chrome)

    Please let me know if you need any other info.

    Thanks,
    – Sherri

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter sherriwmi

    (@sherriwmi)

    Hello again,

    I meant to enclose the markup in code:

    <a class="ui_btn" href="http://examplesite/volunteer-with-us/individuals-students-families/sign-up/, Individuals – Students – Families, ">Register</a>

    Plugin Author caalami

    (@caalami)

    Hi Sherri,

    Can you attach the snippet of code used to generate the markup?

    Thread Starter sherriwmi

    (@sherriwmi)

    Hi caalami,

    If I understand your request correctly, do you mean the following:

    <a class="ui_btn" href="<?php the_field('register_link'); ?>">Register</a>

    Thanks,
    – Sherri

    Plugin Author caalami

    (@caalami)

    Yep, that’s it. The plugin doesn’t generate a URL but instead returns an array with keys for the url, title, etc. For your use you’ll need something like:

    <?php
      $link = get_field('register_link');
    ?>
    <a href="<?php print $link['url']; ?>">Register</a>

    See https://wordpress.org/plugins/acf-link-picker-field/other_notes/ for more info.

    hope this helps.

    • This reply was modified 8 years, 4 months ago by caalami.
    • This reply was modified 8 years, 4 months ago by caalami.
    Thread Starter sherriwmi

    (@sherriwmi)

    That worked, thanks!

    Is there anything special I need to do to get the “open in new window” feature to work? I selected the option when creating the link in the custom post, but its not adding the target="_blank" code.

    Plugin Author caalami

    (@caalami)

    You’d need something like:

    <a href="<?php print $link['url']; ?>" target="<?php print $link['target']; ?>">Register</a>

    Thread Starter sherriwmi

    (@sherriwmi)

    Dear caalami,

    Thank you again. That worked perfectly. You’ve been very helpful and this is a really nice plugin.

    Best,
    – Sherri

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘URL format has errors’ is closed to new replies.