A landing page template with no header, footer or entry title, and two side sections for genesis
<?php
/**
* This file adds the Landing page template to the sk Pro Theme.
*
* @package sk
* @author sk
* @subpackage Customizations
*/
/*
Template Name: Application Page
*/
//* Force full-width-layout
/*
* This will strip out all the sidebar markup, and by hooking into
* 'genesis_before_entry' and 'genesis'_after_entry' we can add in out own sections with our own markup
* and easily style into a sidebar content sidebar layout using percentages.
*/
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Add full-width body class to the head
add_filter( 'body_class', 'sk_loan_application_body_class' );
function sk_loan_application_body_class( $classes ) {
$classes[] = 'application';
return $classes;
}
/*
*
* Strip out unecessary markup, including skip links, header and footer areas
* Keep or remove any parts you think are necessary
*
*/
//* Remove Skip Links
remove_action ( 'genesis_before_header', 'genesis_skip_links', 5 );
//* Dequeue Skip Links Script
add_action( 'wp_enqueue_scripts', 'genesis_sample_dequeue_skip_links' );
function genesis_sample_dequeue_skip_links() {
wp_dequeue_script( 'skip-links' );
}
//* 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 footer widgets
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
//* 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 );
//* Remove the entry title (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
//* Add section before content
/*
* Our layout is currently full width, we can now add a section before the main content, the article output.
* This can later be styled as a left sidebar with percentages
*/
add_action( 'genesis_before_entry', 'pb_before_content' );
function pb_before_content() {
// Setup your structure
echo '<section class="left-application-sidebar">';
// Your output here
echo "I'm content on the left";
// End structure
echo '</section><!—- End Left Section —>';
}
//* Add section after content
/*
* We can now add a section after the main content, the article output.
* This can later be styled as a right sidebar with percentages.
*/
add_action( 'genesis_after_entry', 'pb_after_content' );
function pb_after_content() {
// Setup your structure
echo '<section class="right-application-sidebar">';
// Your output here
echo "I'm content on the right";
// End structure
echo '</section><!—- End Right Section —>';
}
//* Run The Loop
genesis();
<?php
/**
* This file adds the Landing page template to the sk Pro Theme.
*
* @package sk
* @author sk
* @subpackage Customizations
*/
/*
Template Name: Application Page
*/
//* Force sidebar-content-sidebar layout
/*
* This will add in the primary and alt sidebar areas, we can use their markup to injecy your content
* and remoce any sidebar content that would show on any other page
* you will need to adjust the style to work with percentages.
*/
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content_sidebar' );
//* Add full-width body class to the head
add_filter( 'body_class', 'sk_loan_application_body_class' );
function sk_loan_application_body_class( $classes ) {
$classes[] = 'application';
return $classes;
}
/*
*
* Strip out unecessary markup, including skip links, header and footer areas
* Keep or remove any parts you think are necessary
*
*/
//* Remove Skip Links
remove_action ( 'genesis_before_header', 'genesis_skip_links', 5 );
//* Dequeue Skip Links Script
add_action( 'wp_enqueue_scripts', 'genesis_sample_dequeue_skip_links' );
function genesis_sample_dequeue_skip_links() {
wp_dequeue_script( 'skip-links' );
}
//* 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 footer widgets
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
//* 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 );
//* Remove the entry title (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
//* Add content to primary sidebar area
/*
* We can use 'genesis_before_sidebar_widget_area' to hook our own markup and content into the sidebar area
* then remove 'genesis_sidebar' to avoid outputing sidebar content.
*/
add_action( 'genesis_before_sidebar_widget_area', 'pb_before_primary_widget' );
function pb_before_primary_widget() {
// Your output here
echo "Hello, world!";
// Remove the Primary Sidebar from the Primary Sidebar area.
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
}
//* Add content to the secondary widget area
/*
* We can use 'genesis_before_sidebar_alt_widget_area' to hook our own markup and content into the sidebar area
* then remove 'genesis_sidebar_alt' to avoid outputing sidebar content.
*/
add_action( 'genesis_before_sidebar_alt_widget_area', 'pb_before_secondary_sidebar' );
function pb_before_secondary_sidebar() {
// Your output here
echo "Hello, world!";
// Remove the Secondary Sidebar from the alt sidebar area.
remove_action( 'genesis_sidebar_alt', 'genesis_do_sidebar_alt' );
}
//* Run The Loop
genesis();
/* A little base style for version two "template_application_sk_v2.php",
* with a simple media querie, to get you started.
* Adopting the default margins and padding of the sample child theme article.
*/
.application .right-application-sidebar,
.application .left-application-sidebar {
width: 25%;
float: left;
margin-bottom: 40px;
padding: 70px 80px;
background: #fff;
}
.application article {
width: 50%;
float: left;
}
@media only screen and (max-width: 1023px) {
.application .right-application-sidebar,
.application .left-application-sidebar,
.application article {
width: 100%;
}
}