Site icon WP Smith

A Genesis iFrame Page Template

***UPDATED: 5/16***
Recently, I needed an iFrame page template so that I could create pages that appear on multiple external websites, especially Facebook pages. So in order to do this, I had to remove the header, navigation, footer, breadcrumbs, and post title. For styling, I added an iframe custom body class. Here is a Sample iFrame Page.

So here is the code from the page:
[php]
<?php
/*
*Template Name: iframe
*/

remove_action('genesis_header', 'genesis_header_markup_open', 5);
remove_action('genesis_header', 'genesis_do_header');
remove_action('genesis_after_header', 'genesis_do_nav');
remove_action('genesis_after_header', 'genesis_do_subnav');
remove_action('genesis_footer', 'genesis_do_footer');
remove_action('genesis_before_footer', 'metric_include_footer_widgets');
remove_action('wp_head', 'genesis_header_scripts');
remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
remove_action('genesis_post_title', 'genesis_do_post_title');
add_filter('body_class','my_body_classes');
function my_body_classes($classes) {
$classes[] = "iframe";
return $classes;
}

genesis();
?>
[/php]

For example, it can be styled by adding something like the following:
[html]body.iframe {
background: none repeat scroll 0 0 #FFFFFF;
}[/html]

You could also remove the sidebar or you could just force the layout to be full-width:
[php]add_filter('genesis_pre_get_option_site_layout', 'wps_iframe_layout');
function wps_iframe_layout($opt) {
$opt = 'full-width-content';
return $opt;
} [/php]

The possibilities of this are endless! I would love to know what you do with this!