Last active
July 14, 2016 00:41
-
-
Save simbasounds/4fdff6f2cb47529a15c962fb9a977c9c to your computer and use it in GitHub Desktop.
Sample WordPress structural template code for Dynamik Website Builder and Beaver Builder Dynamic Template Switchboard plugin.
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_filter( 'body_class', 'dynamik_page_builder_body_class' ); | |
function dynamik_page_builder_body_class( $classes ) { | |
$classes[] = 'dynamik-page-builder'; | |
return $classes; | |
} | |
add_action('fl_dynamic_switchboard', 'fldts_template_content'); | |
function fldts_template_content() { | |
/* Just to get you started */ | |
global $wp_the_query; | |
$wp_the_query->the_post(); | |
/* Your template code here */ | |
/* Ideally based around a custom instance of $wp_the_query; */ | |
} | |
add_action('fldts_fl_template','fldts_get_fl_template'); | |
function fldts_get_fl_template() { | |
FLBuilder::render_query( array( | |
'post_type' => 'fl-builder-template', | |
'p' => 1234 /* Your BB Template ID */ | |
) ); | |
} | |
add_theme_support( 'genesis-structural-wraps', array( 'header', 'footer-widgets', 'footer' ) ); | |
get_header(); | |
do_action( 'fldts_fl_template' ); | |
get_footer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment