Forked from cobaltapps/Custom Genesis Page Builder Page Template For Genesis Extender
Created
March 28, 2019 07:59
-
-
Save incidunt/3ab50c7a03a264f47564d67b97d64de2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'wp_head', 'custom_genesis_page_builder_styles' ); | |
/** | |
* Echo the necessary "Full Page Width" styles into the head of the page. | |
* Credit for the following CSS goes to the developer of the "Genesis Dambuster" | |
* Plugin as this CSS is an edited version of that Plugin's full-width.css file. | |
*/ | |
function custom_genesis_page_builder_styles() { | |
echo ' | |
<style type="text/css"> | |
.extender-page-builder, | |
.extender-page-builder .site-container, | |
.extender-page-builder .site-container .site-inner { | |
max-width: 100%; | |
width: 100%; | |
background: none; | |
border: 0; | |
float: none; | |
margin: 0 auto; | |
padding: 0; | |
box-shadow: none; | |
border-radius: 0; | |
-webkit-border-radius: 0; | |
-webkit-box-shadow: none; | |
} | |
.extender-page-builder .center-block { margin: 0 auto; } | |
.extender-page-builder .center-text { text-align: center; } | |
.extender-page-builder .clearfix:before, .clearfix:after { content: "\0020"; display: table; } | |
.extender-page-builder .clearfix:after { clear: both; } | |
.extender-page-builder .clearfix { *zoom: 1; } | |
@media screen and (max-width: 500px) { | |
.extender-page-builder .fl-row-bg-video video { | |
left:0 !important; | |
} | |
.extender-page-builder .fl-row-bg-video { | |
min-width: 360px; | |
} | |
} | |
</style> | |
'; | |
} | |
add_filter( 'body_class', 'custom_genesis_page_builder_body_class' ); | |
/** | |
* Adds a css class to the body element | |
* | |
* @param array $classes the current body classes | |
* @return array $classes modified classes | |
*/ | |
function custom_genesis_page_builder_body_class( $classes ) { | |
$classes[] = 'extender-page-builder'; | |
return $classes; | |
} | |
add_filter( 'genesis_attr_site-inner', 'custom_genesis_page_builder_attributes_site_inner' ); | |
/** | |
* Add attributes for site-inner element. | |
* | |
* @since 2.0.0 | |
* | |
* @param array $attributes Existing attributes. | |
* | |
* @return array Amended attributes. | |
*/ | |
function custom_genesis_page_builder_attributes_site_inner( $attributes ) { | |
$attributes['role'] = 'main'; | |
$attributes['itemprop'] = 'mainContentOfPage'; | |
return $attributes; | |
} | |
// Remove div.site-inner's div.wrap | |
add_filter( 'genesis_structural_wrap-site-inner', '__return_empty_string' ); | |
// Display Header | |
get_header(); | |
// Display Content | |
the_post(); // sets the 'in the loop' property to true. | |
the_content(); | |
// Display Footer | |
get_footer(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment