Home › Forums › ACF PRO › Add a 'Select header layout' option to Options Page (ACF Pro) › Reply To: Add a 'Select header layout' option to Options Page (ACF Pro)
get_header() can be called with an empty string or a value of false or null and all of these are the equivalent of calling the function without the name value. For example, all of these are the same
get_header();
get_header('');
get_header(false);
get_header(null);
So all you really need to do is get the option an have the values be whatever the name is. If no value is set then then default header.php will be used
get_header(get_field('header_option_field', 'options'));
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.