Created
November 24, 2019 12:28
-
-
Save fieldoffice/74d38654f747bc0c4c6d91b9d12e9b97 to your computer and use it in GitHub Desktop.
ACF Options with Custom Post Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Functions | |
if( function_exists('acf_add_options_page') ) { | |
acf_add_options_sub_page(array( | |
'page_title' => 'PAGE_TITLE', | |
'menu_title' => 'MENU_TITLE', | |
'menu_slug' => 'MENU_SLUG', | |
'capability' => 'edit_posts', | |
'parent_slug' => 'edit.php?post_type=POST_TYPE', | |
)); | |
} | |
// Template | |
<?php if(get_field('FIELD_NAME', 'option')): ?> | |
<?php the_field('FIELD_NAME', 'option');?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment