It is not possible to override header/footer via hooks in respective get_header()
/get_header()
functions.
However it is often overlooked that these function allow input and loading different headers.
For example get_header( 'nested/header' );
will look for header-nested/header.php
in theme’s folder. It’s kind of a hack in regards to subdirectory use, but it works. 🙂
Related Posts:
- Proper Javascript Implementation
- Change directory where get_header(), get_footer() and get_sidebar() look for templates
- Checking for page templates in child theme
- bloginfo(‘template_directory’) img src
- How to get the most recent modified date of anything in the footer of my site?
- get_template_directory() still returning path to previous theme
- How to change header image size in custom themes
- Best practice to update the file header.php
- Return get_header and get_footer string instead of echo it
- Will placing custom templates in sub directory break any native WordPress functionality
- Adding text to the footer of each post based on tags or categories
- trouble calling different header.php for home.php
- Loading different header and footer in woocommerce templates (AMP)
- Header and footer fail to load with SSL and custom links
- Creating page-templates directory breaks everything!
- How do I get the size of an attachment file?
- How to get slug of current category in taxonomy template?
- Using WordPress templating for HTML emails
- I put my blog on a subpage, how do I get page title?
- Outputting Canonical Resource URLs Across a Multisite Network?
- Restrict a search to a custom post type
- Test if page is child and has children, if so echo child pages also on grandchild pages
- How did you incorporate WooCommerce in your own WordPress theme?
- Correct process for a new Page Template?
- Templates & CSS – Proper Programming Practice?
- A shared custom taxonomy between two custom post types
- Creating a custom category page with pagination
- New Template — copy existing template and change code? [duplicate]
- Same template for all the terms of a taxonomy
- Modifying searchform.php and search.php to have two kinds of searches
- Create a WordPress template without navigation and footer
- Template redirect is_tax() not working
- Hide Front-End Admin Bar Including 32 px Spacing
- Passing variables to template parts
- Show template loaded
- How can I make my custom templates respect permissions?
- How to format shortcode’s HTML in external file
- How to replace WordPress sidebars (widget areas) with Gutenberg
- Unable to include a template
- Turning on the 404 page on localhost
- Is there an action hook that fires just before a template is loaded?
- “Issues” loading MANY featured images on a single page (custom template)
- WordPress Shortcode wrap around div
- How to add an HTML tag to the Header?
- Where is the template for the ‘standard’ format of a post in the theme twentythirteen?
- Missing ‘Page Attributes’
- how to use custom page template in a page?
- Want to make header and footer CMS driven sothat Editors can modify its content from wordpress admin section
- include ‘wp_enqueue_scripts’ (CSS) to multiple templates
- Is there a way I can put my post templates in a separate folder?
- new page sidebar-template by default
- Get link to a specific template file [closed]
- Default Template Selected After Changes in Elementor [closed]
- Include Custom Style & Script into Custom Post Type Single Template
- Standard WordPress Search does not work / Search-results are not displayed / Custom template
- How to preserve changes in templates and other files
- Adding Query to Custom Page Template
- Whats the template of my homepage?
- Custom headers based on taxonomies
- Override Dokan Includes File in Child Theme
- How to get link to homepage
- How is WooCommerce cart.php template supposed to be used?
- Two exact templates, sidebar showing in one but not the other
- Taxonomy term page going to 404
- How can I use default CPT templates from sub-folder?
- How to set page title tag in custom template for non-Custom Post Type?
- Page header on specific page is different from the rest [closed]
- Can a link in WordPress contain a query string that is picked up as $_POST
- Is it possible to access plugin data from a custom feed template?
- How can I get all archive-URLs to use the same template?
- How to use a template file to show all post having same metakey
- Automate configuration after new/hosted installation
- get_header() in backend – but keep JavaScript and CSS files
- Modify just ONE page based on a template
- Conditional config WP_HOME/WP_SITEURL does not update bloginfo(‘template_url’)?
- which template does wp_ tag_ cloud point to?
- Pagination problem (plugin wp-pagenavi) with a custom post type?
- Add an anchor link to a ‘plain’ HTML file, without over-writing the entire site?
- Template part including not working
- Parent/Child themes – both CSS files loaded
- front-page.php includes a placeholder text field. How to get rid of it?
- Display a custom 404 page without a redirect
- Template and URL parameter problem
- get_users by role returns all users
- Validating Error with submit button
- How can I alter a post?
- What is the purpose of the $before and $after arguments on the the_title() function?
- Remove ” Browse Category : ” from Archive title
- When to use content-pagename.php?
- Using external file with WP_USE_THEMES set to false causing 404
- Current URL path variable
- MailPress plugin: table inline style tag removed when sending the newsletter
- How to install a wordpress website template on an existing website?
- Why is my no-results.php template moving my sidebar and footer into the main container?
- Given a page ID, how to display entire page (header/content/footer/sidebars) from a plugin hook
- Any way to insert text on page from a query results?
- Show page title just from the first child-page in template
- How to know which page/file WordPress is expecting?
- AJAX requests within templates
- Page.php vs Single.php