WordPress show post without widgets, header, footer

We use WordPress for the company blog. We would like to show some of the posts in a popover (or light box) on another website. To do that, we need to be able to show just the post’s contents without the widgets, header, footer, etc.

So, for example, look at this post:
http://wordpress.org/news/2014/07/wordpress-4-0-beta-1/

Read More

Imagine being able to use a special URL, like http://wordpress.org/news/2014/07/wordpress-4-0-beta-1/?postOnly=true where the top header would be removed (the black stuff), all the widgets on the side bar, the entire footer, etc.

Only thing remaining would be the headline, when posted and by who, and the actual post contents.

Any ideas?

Related posts

Leave a Reply

2 comments

  1. Create a very simple page template with code similar to this:

    <?php 
    /*
    Template Name: Clean Page Template
    */
    wp_head(); 
    
    if (have_posts()) :
        while (have_posts()) : the_post(); 
           the_content(); 
        endwhile; 
    endif;
    
    wp_footer(); 
    

    Then just set this template in the post edit screen.

  2. If You can modify theme You’re using it’s simple to do – just check if postOnly parameter is set and set to true in places that render header, footer etc. If so, simply don’t render it.