Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1368899

    Hi I have ACF installed and am using it to add fields to the bottom of my portfolio edit page.
    I am adding ACF shortcodes to elements within the ALB.

    Most are working well but I have uploaded a hero image for each via an ACF upload image field. This field (at the moment) returns an Image URL (for example “https://owe.brother.design/wp-content/uploads/2022/10/3_OxfordStationComp_1120x800.jpeg”

    I was hoping to then use the said URL in either a text block eg: <img class="alignnone size-full wp-image-391" src="[acf field="field_6349785a674e0"]" alt="" width="1120" height="800" /> which doesn’t work or somehow within the Media/Image element in ALB.

    Do you have any advice on how I can do this? Thanks in advance.

    Dominic

    • This topic was modified 2 years, 2 months ago by domchocolate.
    • This topic was modified 2 years, 2 months ago by domchocolate.
    #1368922

    Hey domchocolate,

    We haven’t really tested the theme with ACF unfortunately. Does the same code work if you use the default WordPress editor, or switch to a default WordPress theme? Shortcodes will likely not work within actual Layout Builder elements.

    Best regards,
    Rikard

    #1368928

    Hi Rikard

    I’m glad to say that the shortcodes work in most of the elements I’ve used so far. Eg. here in hotspots https://owe.brother.design/projects-2/ password below – all the hotspot copy is generated through ACF fields added to portfolio item posts. I guess it’s where I use the shortcode in an element that has a WYSIWYG or text field to edit them.

    With the ACF image field, however, it works in that it will call the image URL if I place the shortcode on its own in a text field (see https://owe.brother.design/project-item/oxford-station-eastern-side/). The problem comes when I want to call that image using HTML <img src="[insert acf shortcode]'....</img> – the shortcode is either not recognised or is truncated automatically by the Builder.

    If the image element in ALB had a field to add a shortcode that may work. Or other elements (eg section, columns) had a field to add a shortcode to insert a background image which could be another possibility.

    Any thoughts on that?

    Dominic

    • This reply was modified 2 years, 2 months ago by domchocolate.
    • This reply was modified 2 years, 2 months ago by domchocolate.
    #1368956

    Hi,

    This code is working in a Text Block element when I try it:

    <img src="[acf field='field_634abece8f014']" />

    Second image is using that code: https://wpexpert.se/enfold/acf-image-test/

    Best regards,
    Rikard

    #1368957

    Is the Image field returning an ID, URL or array?

    #1368960

    Hi,

    It’s returning the image URL.

    Best regards,
    Rikard

    #1368963

    Not for me. I don’t understand.

    #1368965

    Would you mind taking a look for me on my site?

    #1368966

    I’ve created a new page and still no joy

    https://owe.brother.design/project-item/test-page/

    The edit is at https://owe.brother.design/wp-admin/post.php?post=481&action=edit

    Would you mind taking a look? Can you remind me of that temporary access plug-in??

    #1368967

    Hi,

    You can create a new user, then post the login details in private.

    Best regards,
    Rikard

    #1368971

    Here you go

    #1368976

    Hi Rikard – did you do anything? It all seems to be working now!

    #1368977

    Hi,

    I didn’t do anything, great to hear that it’s working though. Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.