Displaying fields from an Options page
Last updated
An Options Page is a centralized settings area that stores custom fields. Unlike fields on regular pages, values saved on an Options Page are available site-wide and often displayed in the header/footer.
Advanced Views supports Options Pages created with both the ACF and Meta Box plugins.
In Advanced Views, Layout embedding happens using native WordPress shortcodes. Each Layout has its own unique shortcode that can be pasted into any location, regardless of the theme, editor, or page builder you're using.
Shortcodes also support arguments, allowing you to customize the behavior of the same entity in different contexts.
Add any fields
Save the Layout, copy its embedding shortcode
Add the object-id="options" argument
Embed Layout: paste the shortcode inside the target place
If you made your option page using Advanced Custom Fields, you should use the options keyword for ANY options page.
If you made your option page using the MetaBox plugin, you should use the ID of your options page in the argument.
To load fields from the options page, the Layout shortcode should contain at least 3 arguments:
[avf-layout name="Name" id="651d5d75bfdf2" object-id="options"]name argument - used for clarification purposes only and doesn't play any functional role.
id argument - associates the shortcode with a specific Layout.
object-id argument - with options value for ACF, and YOUR_OPTIONS_ID for the MetaBox plugin.
You can also use the common Layout shortcode arguments to additionally customize this Layout embedding, e.g., limiting its visibility for specific user roles.
Last updated