I am trying to set up a settings page for my wordpress theme (developed it in roots.io using Trellis and Sage etc).
I have found a lot of really good documentation on how to use the settings API, for example: https://wpshout.com/making-an-admin-options-page-with-the-wordpress-settings-api/ or http://qnimate.com/wordpress-settings-api-a-comprehensive-developers-guide/ and a few others.
So lets say that I want a theme option page, this code should do it:
add_action( 'admin_menu', 'NEW_admin_add_page' );
function NEW_admin_add_page() {
add_options_page(
'Theme settings Page',
'Theme settings',
'manage_options',
'nts',
'nts_options_page'
);
}
Should create a new page, but where within my theme do I add this code to ensure that when you load this theme (or when it loads if that is the right thing) this page turns up.