You can use a conditional logic. E.G.
<?php
if ( is_home() ) :
get_header( 'home' );
elseif ( is_404() ) :
get_header( '404' );
else :
get_header();
endif;
?>
The file names for the home and 404 headers should be header-home.php and header-404.php respectively.
So in your page-template just add
get_header( 'newtmpl' );
dunno why you should use a function for that.
Related Posts:
- Providing updates to your WordPress theme
- One-Page WordPress Template
- Any way to permanently translate themes?
- New created Theme leads to malfunctioning Xampp Apache –> functions.php is cause
- Weird ‘theme update’ error [duplicate]
- WordPress Blog Page displaying nothing
- WordPress Theme Developments – Start from another theme
- Slider should be display in home template [closed]
- How one category can have different fields?
- How to create multiple pages in a client theme?
- How do child themes work?
- Modify comments_popup_link output
- Using Customizer value in an external PHP file inside a theme
- Fail to install theme on development copy of WordPress on Webmatrix
- How to prevent XSS attack in wordpress theme?
- Featured Image Module Randomly Disappears
- Best strategy for providing theme options using customizer
- Next post in category
- Primary Menu Showing All Pages With No Sub-Nav
- How to figure out which wordpress theme a site was using?
- Magnific Popup – Add Caption to Images
- Why do WordPress developers use so many opening and closing PHP tags when developing themes? [duplicate]
- Can you create a custom page with content in the center already defined?
- Safe way to echo wp_trim_words
- How to migrate the menu from the site on my own theme in WordPress?
- Import from HubSpot COS into WordPress 4?
- Incorrect search results in search.php – issue triggered by using `define(‘BodyID’, ‘search’); the_post();` in search.php
- Flexslider not working for my custom theme WordPress
- Theme Development : License help
- Trouble creating custom sanitization function when uploading video files
- How can I demonstrate themes well?
- What’s the policy for building a theme that doesn’t support widgets/menus?
- “No Data Received” error in Chrome every time i try to update the theme functions file
- How Does One Create a Global Variable Repository
- Why the slideshow is not shown in my theme?
- Theme customizer live preview JS- Trying to bind to an html image url without luck
- RSS feed url showing page not found. How to solve it?
- Redirect to custom login page
- How to update my own theme?
- WordPress custom jquery not found
- WordPress two sidebar layout or theme
- Theme automatically inserting “more” tag on every post
- How get the 10 most viewed pages (not post)
- adding navigation to genesis themes
- How to close open divs in post loop
- Display Today’s date outside the loop?
- Standard Way To Do Custom Work Within A Page?
- Using wp_enqueue_script with social media buttons?
- Confused on loading page content
- Displaying Tags for the Page I’m On?
- Custom link color or stylesheets
- How to convert that page to a wordpress template? [closed]
- Toolbox theme using printif statement – help needed understanding code block
- Show post thumbnail only if it exists using timthumb
- Add Dynamic Sidebar to Exisiting WordPress Theme [closed]
- php file child theme directory not overriding parent theme php file [duplicate]
- How to make navigation a list without a plugin? [duplicate]
- Any Cool WordPress Theme Editor? [closed]
- How to Create a Multi Purpose Theme?
- Showcase your wordpress themes [closed]
- How can I install my custom-made theme on a wordpress.com blog? [closed]
- Turning WordPress Into full-featured website?
- Getting all months in one year WordPress Archive
- What is The Best Way to Make Parallax header effect for wordpress theme ?? pure CSS or using JavaScript? [closed]
- Why am I getting posts back when I shouldnt
- Purchased Theme to Custom Made Theme? [closed]
- How to make website with many template that active [closed]
- Custom Single Page Portfolio Theme [closed]
- Image Size wrong during upload
- How to remove proudly created by WordPress in theme?
- getting id of page
- Roll my own theme or customize an existing one [closed]
- How to create full header but keep content narrow
- Why do some sites show themes/”themename” as the only theme?
- Is there any open source WordPress Themes?
- How do I add new layout width options in WordPress editor?
- Correct way to make a custom block theme responsive
- .submenu class missing in output from wp_nav_menu
- How to make a multilingual wordpress site to be translated one-to-one without much effort and without using translate?
- Is there a way to have WordPress autodetect page templates in the page-templates directory and any sub-folders?
- What is the point of using the front-page.php template? [closed]
- My wordpress site memory exhausted more than 1GB trying to debug with default
- How to show associated fields if checkbox is checked in customize widget screen using wp_customize?
- Meaning of “if ( is_home() && ! is_front_page() )” snippet?
- How to automatically set a Template Page Name next to a page in menu screen such as WooCommerce pages, front page, or posts page in wordpress?
- Dynamic nav menu with icons [closed]
- Full site editing templates folder vs block-templates
- How do I send out an update for my custom wordpress theme?
- TItle In Latest Post is not using H1 Tag [closed]
- Is via.placeholder.com a good site to auto-generate placeholder images?
- Should we escape the values of constants?
- Is child-theme required when modyfing “Appearence > Editor”?
- How to Add Dynamic Sliders to WordPress Customizer with JavaScript
- How to add multiple custom blocks in custom WordPress theme using create-block?
- Export WordPress theme with modifications for other site
- WP Update Messages get cut off during Theme update
- Trying to create a cutom query with pagination and page 2 breaking. Any help?
- Why is wp_nav_menu() not removing the container around the nav ?
- Confusion about theme’s parent and child functions.php file
- Theme folder name changed after update theme