• Resolved mikeywil

    (@mikeywil)


    I’m using Pods to manage a Custom Post Type. One of the custom fields is a URL and in my dev environment it has (for example) https://blah.com/. This is using Pod’s “website” field type (see https://pods.io/docs/learn/field-types/website/ )

    I can access this in the WPUPG template facility using [wpupg-item-custom-field key="titlelink" display="inline"],

    but when I place this inside an ‘A’ tag like this:
    <a href='[wpupg-item-custom-field key="titlelink" display="inline"]'>[wpupg-item-title]</a>

    it renders the code without the http: and with a rogue </span> at the end like this:
    <a href='//blah.com/</span>'>

    Any advice?

    • This topic was modified 3 years, 5 months ago by mikeywil.
    • This topic was modified 3 years, 5 months ago by mikeywil.
    • This topic was modified 3 years, 5 months ago by mikeywil.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brecht

    (@brechtvds)

    You can add type=”acf_link” as an attribute to the shortcode.

    It will be easier to see what attributes are available if you use the grid template editor: https://help.bootstrapped.ventures/article/216-grid-template-editor

    Thread Starter mikeywil

    (@mikeywil)

    Thanks.

    Yes, I am already using the grid template editor.

    adding type=”acf_link” (within the edit HTML view of the grid template editor) didn’t change anything.

    I can see that this code: [wpupg-item-custom-field key="titlelink2"]

    outputs <span class="wpupg-item-custom-field wpupg-block-text-normal">https://blah.com/</span>

    Is there a way to get it to output just the value of the custom field? i.e. https://blah.com/

    Thread Starter mikeywil

    (@mikeywil)

    I think I may have found a different way to achieve what I need. It doesn’t solve the behaviour where a custom field doesn’t output as expected. But it does give me the custom link (instead of default link) that I needed.

    In case this helps anyone else landing here… see: https://help.bootstrapped.ventures/article/249-set-custom-links-and-images

    Plugin Author Brecht

    (@brechtvds)

    Are you using the latest 3.7.1 version of the plugin? “Type” should just be a property you select when in “Edit Blocks” for the custom field block. No need to manually add that property under “Edit HTML”.

    We do indeed have our own custom links features as well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using custom field for a link’ is closed to new replies.