Home › Forums › General Issues › Include ACF pro in theme › Reply To: Include ACF pro in theme
You add filters and actions.
I’m pretty sure this is all in the documentation somewhere so this is just a quick overview.
Examples:
// add options pages
add_action('init', 'add_theme_options_pages');
function add_theme_options_pages() {
if (!function_exists('acf_add_options_sub_page')) {
return;
}
// add code here to add options pages
}
// add custom fields
// export the field groups and use below
add_action('acf/include_fields', 'add_theme_field_groups');
function add_theme_field_groups() {
// you can get the code you need here by exporting
// your field group to PHP
// you could also use JSON, search for ACF Local JSON
}
Hope this helps.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.