Skip to content

Instantly share code, notes, and snippets.

@JayOkey
JayOkey / jo_gp_full_width_layout.php
Last active July 27, 2018 11:01
Sets the GeneratePress Page Builder Layout to full width when Beaver Builder has been used to create the layout of the page
<?php
/***
* Automatically set GeneratePress to full width layout when Beaver Builder active on page
***/
function jo_custom_body_class( $classes ) {
if ( class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_enabled() ) {
$classes[] = 'full-width-content';
@grantambrose
grantambrose / 1functions.php
Created September 12, 2016 22:23
WordPress: Change the main menu on different pages
// Conditionally change menus
add_filter( 'wp_nav_menu_args', 'bb_wp_nav_menu_args' );
function bb_wp_nav_menu_args( $args = '' ) {
// change the menu in the Header menu position
if( $args['theme_location'] == 'header' && is_page('1159') ) {
$args['menu'] = '32'; // 32 is the ID of the menu we want to use here
}
return $args;
}
@katlove
katlove / functions.php
Created August 28, 2016 04:21
Remove Presets on Beaver Builder Child Theme
<?php
// Remove all of the Beaver Builder child theme presets
//(does not remove default as you should overwrite default with your child theme's default settings)
function es_remove_presets()
{
FLCustomizer::remove_preset( 'default-dark' );
FLCustomizer::remove_preset( 'classic' );
FLCustomizer::remove_preset( 'modern' );
FLCustomizer::remove_preset( 'bold' );