0

When i create a new page, i want to choose different theme. I know about Multiple Themes plugin but i'm thinking something else. Install three different themes, activate only one and then creating a new page template in this which calling functions get_header() and get_footer() from another theme.

I don't know if i can do this but i want to try it.

My question is how to call get_header() from another theme?

  • I would personally download the plugin and see how they do it. I can't imagine it being simple (or a good idea, but that's beside the point). – Cai Feb 20 '16 at 22:25
2

You can't do it.

Well you can hack it, but it is very unlikely to give you the results you expect as there are usually many settings that needs to be initialized when themes are used and since themes are rarly designed to be able to "run" in parallel with other themes you will have a collision of settings. In addition the header.php contains more the the HTML header and the HTML it produce have to be compatible with the HTML and CSS produced by the other parts, something that it is unlikely to happen between different themes.

-1

you can do below with code ....

create header file like as header-new.php

Call header function like as get_header('new')

And you can add different style and js inside header-new.php

bellow is example of css adding

<link href="<?php bloginfo( 'template_url' ); ?>/css/template.css" rel="stylesheet" type="text/css" />
-1

Maybe the solution is use child theme

If you want to change more than just the stylesheet, your child theme can override any file in the parent theme: simply include a file of the same name in the child theme directory, and it will override the equivalent file in the parent theme directory when your site loads. For instance, if you want to change the PHP code for the site header, you can include a header.php in your child theme's directory, and that file will be used instead of the parent theme's header.php.

You can also include files in the child theme that are not included in the parent theme. For instance, you might want to create a more specific template than is found in your parent theme, such as a template for a specific page or category archive. See the Template Hierarchy for more information about how WordPress decides what template to use.

  • I'm not sure how that answers the question? – Cai Feb 20 '16 at 20:32
  • I guess He needs extend a theme, the right way is use theme child – Apeiron Feb 20 '16 at 20:35
  • Ok. Here we Go!!! – Apeiron Feb 21 '16 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.