use another theme for just one page

I am a wordpress newbie. Been looking the whole day for a solution. http://codex.wordpress.org/Theme_Development and http://codex.wordpress.org/Template_Hierarchy#Visual_Overview did not give me what I need. There are theme1 – the general website theme and theme2 – the one I want to use for only one page.

I have managed to make a template to use for that custom page that employs a the page.php, header.php and footer.php files from theme2 but no joy. The page became a mess. I think what needs changed is the page’s .css file. Any way to import that too from theme2 ?

thanks

Answer

If you want all of the visual aspects of the second theme on that one page, you could do something like this. It’s hacky and I wouldn’t recommend doing this but it’s your question!

From where you say you’re at now (separate header/footer/page.php) you simply need to update the URLs that call in the CSS and other support files. These may include a “pieces, blocks or assets” folder, for example. You will have to look at the output of currently broken page to see the full list of what needs updating.

Look at those URLs, and simply rewrite the header.php lines to point to the correct URLs.

For example, most theme authors make use of built-in WP functions such as get_stylesheet_uri() and other methods to avoid a hard-coded URL such as http://domain.tld/folder/wp-content/themes/themename/etc

If you replace the PHP functions with the actual hard-coded URLs to load the CSS and other assets from the other theme, you could effectively port a second theme to that page.

Hope that makes sense. I wouldn’t do it that way but you’re partially there with what you’ve done already.

Attribution
Source : Link , Question Author : kellogs , Answer Author : jdm2112

Leave a Comment