The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Displaying alternate post template for lightbox effect (1 post)

  1. SarahCoats
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic