Links

Shortcode

Each ACF View has a shortcode that displays the assigned fields. HTML markup is created automatically by the plugin.
Shortcode default example;
[acf_views view-id="123" name="Name of View"]
Note: Displays the View, chosen ACF fields should be filled at the same object where the shortcode is pasted (post/page), replace view-id="123" with the ID of your View. See full doc​
Shortcode example to Display fields from another post/page;
[acf_views view-id="123" object-id="ANOTHER_POST_ID" name="Name of View"]
Note: Displays the View, chosen ACF fields should be filled at the target object. Insert ID in place of "ANOTHER_POST_ID", replace view-id=123" with the ID of your View. See full doc​
Shortcode example to restrict access to the View;
[acf_views view-id="123" name="Name of View" user-with-roles="ROLE1,ROLE2" user-without-roles="ROLE1,ROLE2"]
Note: Insert the Role names in the ‘user-with-roles’ and/or ‘user-without-roles’ argument replacing “ROLE1,ROLE2” with your user roles, replace view-id="123" with the ID of your View. See full doc​
Shortcode example to display fields from “Options” page;
[acf_views view-id="123" object-id=”options” name="Name of View"]
Note: Replace view-id="123" with the ID of your View.
Shortcode example to display fields for current user;
[acf_views view-id="123" object-id=”$user$” name="Name of View"]
Note: Replace view-id="123" with the ID of your View.
Last modified 4mo ago