Skip to content

Instantly share code, notes, and snippets.

@Joel-James
Created February 19, 2020 09:37
Show Gist options
  • Save Joel-James/07035564b207f6e60a16bf2941fc7985 to your computer and use it in GitHub Desktop.
Save Joel-James/07035564b207f6e60a16bf2941fc7985 to your computer and use it in GitHub Desktop.
Full width page template for Genesis Sample theme
<?php
/**
* Genesis Sample.
*
* This file adds the full width page template to the Genesis Sample Theme.
*
* Template Name: Full Width
*
* @author StudioPress
* @link https://www.studiopress.com/
* @license GPL-2.0-or-later
* @package Genesis Sample
*/
add_filter( 'genesis_attr_site-inner', 'dclwp_site_inner_attr' );
/**
* Adds the attributes from 'entry', since this replaces the main entry.
*
* @param array $attributes Existing attributes.
*
* @return array Amended attributes.
*/
function dclwp_site_inner_attr( $attributes ) {
// Adds a class of 'full' for styling this .site-inner differently.
$attributes['class'] .= ' full';
// Adds an id of 'genesis-content' for accessible skip links.
$attributes['id'] = 'genesis-content';
// Adds the attributes from .entry, since this replaces the main entry.
$attributes = wp_parse_args( $attributes, genesis_attributes_entry( array() ) );
return $attributes;
}
// Header content.
get_header();
// Breadcrumb markup.
genesis_do_breadcrumbs();
// Displays content.
the_post();
the_content();
// Displays Comments (if any are already present and if comments are enabled in Genesis settings - disabled by default for Pages).
genesis_get_comments_template();
// Displays Footer.
get_footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment