Skip to content

Instantly share code, notes, and snippets.

@topleague
Created September 1, 2017 11:25
Show Gist options
  • Save topleague/d21b9d6f0a3212a8c112981fb2ed1638 to your computer and use it in GitHub Desktop.
Save topleague/d21b9d6f0a3212a8c112981fb2ed1638 to your computer and use it in GitHub Desktop.
Custom Template for Lead Capturing
<?php
//* Template Name: Lead Capture
//* Add landing page body class to the head
add_filter( 'body_class', 'genesis_add_body_class' );
function genesis_add_body_class( $classes ) {
$classes[] = 'lead-capture-page';
return $classes;
}
//* Force full width content layout
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
//* Hook lead capture widget area
add_action( 'genesis_loop', 'genesis_lead_capture' );
function genesis_lead_capture() {
genesis_widget_area( 'lead-capture', array(
'before' => '<div class="lead-capture">',
'after' => '</div>',
) );
}
//* Remove site header elements
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
remove_action( 'genesis_header', 'genesis_do_header' );
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
//* Remove navigation
remove_theme_support( 'genesis-menus' );
//* Remove breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
//* Remove site footer widgets
remove_theme_support( 'genesis-footer-widgets' );
//* Remove site footer elements
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
//* Run the Genesis loop
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment