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:
- How to add custom css file in theme?
- get_template_part vs action hooks in themes
- CSS classes for theme
- How to remove search bar from a wordpress theme? [closed]
- Get url of thumbnail from the media uploader
- Should I use set_transient or update_option?
- Template for individual post designs
- Best practice way to implement custom sections into a WordPress theme
- Pushing updates to your premium theme
- Where can I find a good reviewed collection of Twenty Ten child themes?
- Front End Post Submit Form
- How do I remove RSS feeds from themes?
- CSS in child theme not overriding the parent theme [closed]
- First post of each category
- Advantages of using instead of wp_enqueue_style()?
- Style.css redirects to 404 Page not found
- Displaying wp menus by name without using theme locations
- How to add dynamic inline style?
- Optimal solution to develop a wordpress theme?
- How to add suggest plugin to theme?
- Prevent update check for specific theme
- Do I really need the div class entry?
- How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?
- Am I supposed to create a child theme for every theme I use?
- If I build a custom theme, will it update?
- using wordpress without javascript
- Recommended tools for Theme Development with SASS [closed]
- What tags should be used for themes to show the type of layout?
- Theme Check: Could not find post_class
- What are non-printable characters doing in my theme?
- Why wp_head() function not loading style.css?
- Override theme programmatically
- Set multiple templates per post
- WP 3.1 upgrade breaks AutoFocus+ theme
- How can I display/hide certain content based on a Theme Option field?
- create-guten-block in wordpress theme?
- How can I make that when I clic on one of the menu items, that page shows only posts with the same category?
- Lightweight framework [closed]
- Theme Splash Image within the “Appearance -> Themes” control panel [duplicate]
- Theme Loading Into Dashboard
- How to make theme elements customizable in wordpress?
- How to add “Template” option in page attributes panel?
- How to edit my theme for full width?
- Which html elements should be styled in wordpress theme
- Folder name for a pro version of a WordPress.org theme?
- Echo all category names, apart from one
- Customize how a WordPress theme looks like in the Theme Selector
- How to set a page as homepage in stead of the newspages?
- Widget Option is Missing
- WordPress Theme Validator?
- If you were to start using a WordPress framework today, which one would you use? [closed]
- Template for landing pages
- Is it possible to have a theme that uses only one single page?
- underscores use of the article element on the page template
- Plugin does not work in custom theme
- Create a child theme from multiple themes
- html5-reset theme does not show the image [closed]
- Adding a gallery to my first theme
- How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?
- What exactly is “wordpress theming”? [closed]
- Copying the theme style files and images to duplicate the website but with a difference
- I have WordPress setup on primary domain, how do I set it up on its subdomain using the same database?
- Valid SQL query not returning results
- Unable to change the priority with ‘remove_action’ and ‘add_action’ in child theme
- How do I include a partial from a directory below a wordpress theme directory?
- Remove h1 from 2015 theme
- WordPress pulling in random page themes
- Can’t change theme name
- How to remove permalinks links presents in each page of my site?
- first excerpt fine, subsequent post excerpts shift to the right instead of displaying vertically [closed]
- HTTP Error when uploading images over specific dimensions
- Why is the `if else` not working?
- showing all recent posts in theme
- Is there a way to serve different resolution images to different devices?
- iPad WordPress theme?
- custom Background not showing after upgrade?
- Rolling your own WordPress Themes
- How to make a function occurs for one time?
- List categories of a post hierarchically?
- PHP Parse error: syntax error, unexpected ‘endwhile’ (T_ENDWHILE), expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) on line 124
- Problem with pagination link (error 404)
- How to display home page last modified date in anywhere of wordpress theme?
- Is there a way to create sections under “Colors” panel in the Theme Customizer?
- Is a multipurpose theme an alternative to modifying or creating a theme from scratch?
- Local theme changes upload on server but theme changes not showing
- WooCommerce – edit templates
- WordPress Custom font not found
- How to dowload and edit content of a website
- WordPress Blog Page displaying nothing
- Best strategy for providing theme options using customizer
- Next post in category
- Trouble creating custom sanitization function when uploading video files
- What’s the policy for building a theme that doesn’t support widgets/menus?
- How Does One Create a Global Variable Repository
- Custom link color or stylesheets
- Any Cool WordPress Theme Editor? [closed]
- getting id of page
- Is there any open source WordPress Themes?
- Meaning of “if ( is_home() && ! is_front_page() )” snippet?
- Full Site Editing, Block Theme, Gutenberg, Site Editor