Skip to content

Instantly share code, notes, and snippets.

@helgatheviking
Last active May 6, 2019 00:15
Show Gist options
  • Save helgatheviking/617187f95c528f5cabf58c1d0f8ebc9f to your computer and use it in GitHub Desktop.
Save helgatheviking/617187f95c528f5cabf58c1d0f8ebc9f to your computer and use it in GitHub Desktop.
Add Beaver Builder Support to Storefront Child Theme
<?php
function remove_page_header_for_builder() {
if( is_page_template( 'template-builder.php' ) ) {
remove_action( 'storefront_page', 'storefront_page_header' );
}
}
add_action( 'storefront_page_before', 'remove_page_header_for_builder' );
/*
Theme Name: A Storefront Child Theme
Description: For testing stuff
Author: Kathy Darling
Author URI: http://kathyisawesome.com/
Template: storefront
Version: 1.0
.
*/
@media (max-width: 66.4989378333em) {
.page-template-template-builder.fl-builder .site-content .col-full {
margin-left: 0;
margin-right: 0;
}
}
@media (min-width: 768px) {
.page-template-template-builder.fl-builder .site-content .col-full {
max-width: 100%;
padding: 0;
}
.page-template-template-builder.fl-builder .site-content .content-area {
width: 100%;
margin-right: 0;
float: none;
}
.page-template-template-builder.fl-builder.no-wc-breadcrumb .site-header {
margin-bottom: 0;
}
}
<?php
/**
* The template for displaying really full width pages.
*
* Template Name: Beaver Builder
*
* @package storefront
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post();
do_action( 'storefront_page_before' );
get_template_part( 'content', 'page' );
/**
* Functions hooked in to storefront_page_after action
*
* @hooked storefront_display_comments - 10
*/
do_action( 'storefront_page_after' );
endwhile; // End of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment