-
AuthorPosts
-
October 14, 2022 at 6:15 pm #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.
October 15, 2022 at 10:11 am #1368922Hey 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,
RikardOctober 15, 2022 at 10:27 am #1368928Hi 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.
October 15, 2022 at 4:15 pm #1368956Hi,
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,
RikardOctober 15, 2022 at 4:19 pm #1368957Is the Image field returning an ID, URL or array?
October 15, 2022 at 4:24 pm #1368960October 15, 2022 at 4:41 pm #1368963Not for me. I don’t understand.
October 15, 2022 at 4:59 pm #1368965Would you mind taking a look for me on my site?
October 15, 2022 at 5:11 pm #1368966I’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??
October 15, 2022 at 5:16 pm #1368967Hi,
You can create a new user, then post the login details in private.
Best regards,
RikardOctober 15, 2022 at 5:28 pm #1368971Here you go
October 15, 2022 at 6:45 pm #1368976Hi Rikard – did you do anything? It all seems to be working now!
October 15, 2022 at 7:51 pm #1368977 -
AuthorPosts
- You must be logged in to reply to this topic.