Skip to content

Instantly share code, notes, and snippets.

@grantambrose
Last active October 25, 2016 17:41
Show Gist options
  • Save grantambrose/11fe201f412f5fe744d2bdcb2a0020d8 to your computer and use it in GitHub Desktop.
Save grantambrose/11fe201f412f5fe744d2bdcb2a0020d8 to your computer and use it in GitHub Desktop.
Hide page elements in Beaver Builder using URL parameters
// 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{
$classes[] .= 'pricing-standard';
}
return $classes;
}
/* ----------------------
HANDLE THE PRICING TABLE CONDITIONAL DISPLAY
---------------------- */
/* Hide the partner pricing table by default */
.fl-row-pricing-partner{display:none;}
/* Hide the standard pricing when partner url variable set */
body.pricing-partner .fl-row-pricing-standard{display:none;}
/* Show the partner pricing when partner url variable set */
body.pricing-partner .fl-row-pricing-partner{display:block;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment