0
votes

I am using the Advanced Custom Fields Plugin (http://www.advancedcustomfields.com) with the options page add-on so I can use global variables throughout the theme (on multiple pages).

I don't know PHP and I'm trying to get the custom field from the options page by using a shortcode in the content on the different pages inside the WYSIWYG editor.

Is this possible? I can't figure out how to do it after days of trying. Can anyone help? I've tried going to the plugin's support and haven't gotten anything back.

Please Help! I really need to get this working!

References: http://www.advancedcustomfields.com/docs/functions/using-shortcodes/

http://www.advancedcustomfields.com/add-ons/options-page/

3

3 Answers

0
votes

Figured out a way around it. I can just use the shortcode they provide to reference a specific post/page ID which accomplishes the goal of only having to put it in once and it being rendered at multiple pages as long as the shortcode is there and properly formatted.

0
votes

Use the post_id of option in your shortcode as per this example:

[acf field="myfieldname" post_id="option"]
0
votes

Block type: Text Block (WYSIWYG field)

Text:
[acf field="NAME-OF-ACF-FIELD" post_id="options"]

Image (Return Format: Image URL) and alt text:
<img src="[acf field='NAME-OF-ACF-FIELD' post_id='options']" alt="[acf field='NAME-OF-ACF-FIELD' post_id='options']" />