How to show two or more different page templates of same page content in wordpress

How to show two or more different page templates of same page content in wordpress

I ran into a problem where in I was told to show page content on pop up in some part and on other hand to show page content as full page layout on rest parts.
Wordpress being such a pretty bunch of Codex of Hooks and Filter solved the problem

I used the following code :

<?php
switch ($_GET[“template”]) {
case “pop”:
include(TEMPLATEPATH . “/pop.php”);
break;
default:
include(TEMPLATEPATH . “/default.php”);
break;
}
?>

In the above code it states that if the anchor link

<a class=”kb_modal” href=”http://example.org?template=pop”></a>

The above will display the page example.org in pop up.

<a href=”http://example.org”><a/>

whereas these above code will display as simple full page layout as complete page.

Note : Don’t forget to discard header and footer in pop up tag as in my case.

676 total views, 1 views today

Leave a Comment