Skip to content

Instantly share code, notes, and snippets.

View carlosonweb's full-sized avatar

Carlos Velasco carlosonweb

View GitHub Profile
@carlosonweb
carlosonweb / bb-content-slider-text-on-mobile.css
Created September 20, 2017 03:38
Beaver Builder Content Slider Move the Text Content Up When on Mobile Screen
@media (max-width: 768px){
#bblocal-content-slider .fl-slide-foreground{
margin-top: -200px;
}
#bblocal-content-slider .fl-slide-content{
background-color: rgba(0,0,0,0.2);
}
}
@carlosonweb
carlosonweb / font-awesome-render-blocking.php
Created September 16, 2017 07:56
Fix Font Awesome Render Blocking Issue on Beaver Builder Theme
add_action( 'wp_print_scripts', function(){
wp_dequeue_script( 'font-awesome' );
});
add_action('wp_head', function(){
?>
<script id="bblocal-font-awesome" type='text/javascript'>
var fontAwesomeURL = <?php echo "'" . FL_THEME_URL . "/css/font-awesome.min.css" . "';"; ?>
function loadCSS(e, t, n) {
@carlosonweb
carlosonweb / post-top-meta.php
Last active August 28, 2017 03:17
Beaver Builder Customer Request: Modify the Schema Object for the author by removing the author URI
<?php
if( !function_exists('bblocal_post_schema_meta')){
// Copied from FLTheme::post_schema_meta();
// This function is invoked at the last line of this file.
function bblocal_post_schema_meta()
{
// General Schema Meta
echo '<meta itemscope itemprop="mainEntityOfPage" itemid="' . get_permalink() . '" />';
echo '<meta itemprop="datePublished" content="' . get_the_time('Y-m-d') . '" />';
echo '<meta itemprop="dateModified" content="' . get_the_modified_date('Y-m-d') . '" />';
@carlosonweb
carlosonweb / bb-themer-sticky-topbar.js
Last active March 2, 2018 04:39
How to make a sticky Topbar in Beaver Themer.
/**
* First, you need to setup this CSS
*******************************************
.fl-sticky {
position: fixed !important;
width: 100% !important;
left: 0 !important;
top: 0 !important;
z-index: 9999 !important;
border-top: 0 !important;
@carlosonweb
carlosonweb / bb-contact-form-modify.js
Last active October 9, 2017 03:07
Modify the Labels, Placeholders and Error Messages on the BB Contact Form
// In BB, you can embed this to the page by going to Tools > Layout CSS/JavaScript > JavaScript
jQuery(document).ready(function($){
// Change the Labels
$('#mybb-contact-form label[for="fl-name"]').text('NAME Label here...');
$('#mybb-contact-form label[for="fl-email"]').text('EMAIL Label here...');
$('#mybb-contact-form label[for="fl-phone"]').text('PHONE Label here...');
$('#mybb-contact-form label[for="fl-message"]').text('MESSAGE Label here...');
// Change the placeholders
@carlosonweb
carlosonweb / bb-bg-image-cdn.php
Created August 8, 2017 22:03
Fix BB Background Image not fetching from CDN
function fl_builder_rewrite_cdn_urls( $css ) {
return str_ireplace( 'example.com', 'example-5782.kxcdn.com', $css );
}
add_filter( 'fl_builder_render_css', 'fl_builder_rewrite_cdn_urls' );
# Error Message:
#
# Access to Font at '...' from origin '...' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header
# is present on the requested resource. Origin '...' is therefore not allowed access.
#
# --------------------------------------
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
@carlosonweb
carlosonweb / bb-no-ace-editor.php
Created August 2, 2017 00:03
Remove the Ace Editor in the BB Theme's Customizer Area
add_action( 'customize_controls_print_scripts', function(){
?>
<style id='no-ace-editor-style'>
#customize-control-fl-js-code textarea,
#customize-control-fl-head-code textarea,
#customize-control-fl-header-code textarea,
#customize-control-fl-footer-code textarea{
display: block !important;
}
</style>
@carlosonweb
carlosonweb / bb-toolset-views.html
Created July 12, 2017 21:34
Toolset Meets BB -- Sample Result
<div class="fl-builder-content fl-builder-content-1003" data-post-id="1003"><div class="fl-row fl-row-fixed-width fl-row-bg-none fl-node-58f60c7d3a748 bb-view-row" data-node="58f60c7d3a748">
<div class="fl-row-content-wrap">
<div class="fl-row-content fl-row-fixed-width fl-node-content">
<div class="fl-col-group fl-node-59668e8d05571" data-node="59668e8d05571">
<div class="fl-col fl-node-59668e8d05659" data-node="59668e8d05659">
<div class="fl-col-content fl-node-content">
<div class="fl-module fl-module-heading fl-node-59668e8d054ce bb-view-headline" data-node="59668e8d054ce">
<div class="fl-module-content fl-node-content">
<h3 class="fl-heading">
@carlosonweb
carlosonweb / list-active-plugins.js
Last active October 16, 2017 21:07
List active WP plugins. This is useful in troubleshooting a WP site for plugin conflicts.
jQuery( '.plugin-title > strong' ).each( function () {
console.log( jQuery(this).text() );
} );