javascript - Remove content if loaded in iframe? -


i'm working on wordpress onepager , want open wordpress posts in iframe. works fine, header , footer still appear in iframe.

in wordpress' single.php there these 2 lines:

<? get_header(); ?> <? get_footer(); ?> 

if delete them, header , footer gone, great, open link directly , not in iframe looks totally naked without stylesheet, header, etc.

is possible - maybe php - remove these 2 lines if site being loaded in iframe?

the url using in iframe: i'm assuming it's single.php change single.php?iframe=yes.

or if have single.php?id=whatever
change single.php?id=whatever&iframe=yes

in single.php use

if (!isset($_get["iframe"]) get_header(); if (!isset($_get["iframe"]) get_footer(); 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -