ACF shortcode for project page
-
Hi all,
I'm creating a portfolio page with LayTheme. I have the ACF Wordpress plugin installed.
I'd like to add fields to each project to easily enter info to be put in the right spot on the website.However, when using the Shortcode option the LayGridder, and I use the ACF function (acf field="project_type"), it only shows the function text itself and not the value I've put in for the field.
Is this expected behaviour or is there a workaround? I found two posts on this forum regarding ACF and shortcodes, but they weren't tackling my problem..
Thanks for any help!
-
you mean a shortcode like
[acf field="project_type"]
?
and do you use www.laytheme.com
or do you use www.laygridder.comif you use lay theme.
can u go to lay options
enable this setting, (at the bottom)
does that change anything?
-
Here:
https://www.advancedcustomfields.com/resources/shortcode/It says
"From ACF 6.3.0, the ACF shortcode is disabled by default for new installs of ACF. If you need to enable it, see enabling the ACF shortcode."It seems that you have to enable it first for the ACF plugin:
https://www.advancedcustomfields.com/resources/shortcode/#enabling -
If you use www.laygridder.com
You can create your own elements for the gridder with CMB2. If you do, you will even get "+MyElement" buttons in the gridder UI to add your own element.
And in the modal you can have fields like text inputs and more that you can use to create your element on the Frontend and your element in the preview inside the Gridder.You can see how to do it here, with an example code:
https://laygridder.com/documentation.html#custom-element-type
Its a little complicated though
-
Hi Armin,
thanks so much for the reply and help.
I'm using LayTheme and also found the ACF documentation. Will try to enable it and see what happens. Currently the website is moving server so won't get to it until next week.If it proves too difficult, might switch to LayGridder and use CMB2 with the help of a developer.
Am I understanding correctly, that LayGridder gives the option of creating templates? Can LayGridder then be used together with LayTheme?Many thanks!
-
Can LayGridder then be used together with LayTheme?
no
Am I understanding correctly, that LayGridder gives the option of creating templates?
it gives you the ability to create your own custom elements that you can add to the gridder
-
it gives you the ability to create your own custom elements that you can add to the gridder
here: https://laygridder.com/documentation.html#custom-element-type
its a little difficult cause there is some coding involved
7/7
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it