Displaying alternate post template for lightbox effect
-
I am trying to set up my blog home page to display the individual posts in a lightbox style box when selected. But display in the normal single.php when they are accessed from direct link or from a search engine.
Basically I want the lightbox to display a stripped down version of the post (without the header and sidebars).
I have tried using thickbox, fancybox, etc. but I cant seem to get it to select the alternate template. I currently have my own lightbox pulling the page via iframe. I have set the code:
<?php if ( is_home() || is_search() || is_archive()) {include (TEMPLATEPATH . ‘/single_lightbox.php’);}
else {include(TEMPLATEPATH . ‘/single.php’); }?>It is working well to pull the separate templates, however when set up like this the lightbox is only displaying the most recent post. I can’t seem to be able to specify the individual posts.
I have searched everywhere and can’t seem to find the correct way to implement this. I am new to php so am by no means an expert. I would appreciate any assistance someone could give.
- The topic ‘Displaying alternate post template for lightbox effect’ is closed to new replies.