This file contains hidden or 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
// this function redirects users to the course they purchased | |
// when they try to access the WooCommerce product that sold the course | |
// as they don't need to see the sales page anymore, they want the lessons | |
add_action( 'template_redirect', 'c_redirect_to_purchased_course' ); | |
function c_redirect_to_purchased_course() { | |
// if it's not a woo product page, return and do nothing | |
if( !is_product() ) return; | |
// get related courses | |
$c_products_related_courses = get_field('c_products_related_courses'); |
This file contains hidden or 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
function c_has_purchased_product_ids($product_ids){ | |
// debugging | |
// echo "Customer has bought product ids: " . $ids; | |
if ( ! $product_ids ) return false; | |
$current_user = wp_get_current_user(); | |
// always show for admins | |
if(current_user_can('administrator')) return true; | |
if(is_array($product_ids)){ |
This file contains hidden or 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 get_header(); ?> | |
<?php | |
// replace 404-error-page below with the slug of your own 404 Beaver Builder Template | |
echo do_shortcode('[fl_builder_insert_layout slug="404-error-page"]'); ?> | |
<?php get_footer(); ?> |
This file contains hidden or 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
// Add our custom Body Classes based on the URL Parameters | |
add_filter('body_class', 'bb_body_class'); | |
function bb_body_class($classes) { | |
if( isset($_GET['plan']) ){ | |
$plan_param = $_GET['plan']; | |
if($plan_param == 'partner'){ | |
$classes[] .= 'pricing-partner'; | |
} | |
} | |
else{ |
This file contains hidden or 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
// 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; | |
} |
This file contains hidden or 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 FLTheme::sidebar('left'); ?> | |
<div class="fl-content <?php FLTheme::content_class(); ?>"> | |
<?php if(have_posts()) : while(have_posts()) : the_post(); ?> | |
<?php get_template_part('content', 'single'); ?> | |
<?php endwhile; endif; ?> | |
</div> | |
<?php FLTheme::sidebar('right'); ?> |
This file contains hidden or 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
/* Change Typography for Medium Devices and up */ | |
@media only screen and (min-width: 992px) { | |
/* ---------------------- | |
TYPOGRAPHY | |
---------------------- */ | |
body{font-size:20px;} | |
h1{font-size:2.5em;} | |
h2{font-size:2em;} | |
h3{font-size:1.7em;} | |
h4{font-size:1.5em;} |
This file contains hidden or 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
/* Sticky the Top Bar in the Beaver Builder Theme ONLY for medium devices and large devices | |
- Change the 992px breakpoint to whatever you like */ | |
@media only screen and (min-width: 992px) { | |
/* Change the 35px value below to the heigt of your Top Bar */ | |
.fl-page-bar { position: fixed; width: 100%; z-index: 10; } | |
.fl-page-header-fixed { margin-top: 35px;} | |
.fl-page-header-primary { padding-top: 35px; } | |
} |
This file contains hidden or 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
'align' => array( | |
'type' => 'select', | |
'label' => __('Alignment', 'fl-builder'), | |
'default' => 'center', | |
'options' => array( | |
'left' => __('Left', 'fl-builder'), | |
'center' => __('Center', 'fl-builder'), | |
'right' => __('Right', 'fl-builder'), | |
'full-width' => __('Full-width', 'fl-builder') | |
) |
NewerOlder