Skip to content

Instantly share code, notes, and snippets.

@nathaningram
nathaningram / gist:7fe101c52b54a4809fc4
Created November 13, 2015 20:54
Design to Builder Webinar CSS
/***************************************************
Design to Builder Webinar CSS
***************************************************/
/* Header + Nav */
ul#menu-vandalay-menu li a {
color: #17335B;
text-decoration: none;
font-weight: bold;
@nathaningram
nathaningram / gist:e4223705b0efb5fb86da
Created November 13, 2015 20:55
Design to Builder Shortcodes for functions.php
//Anti-Spam Email Shortcode
//Use this shortcode [emailme]nathan@brilliantly.net[/emailme]
function protect_email_address( $atts , $content=null ) {
for ($i = 0; $i < strlen($content); $i++) $encodedmail .= "&#" . ord($content[$i]) . ';';
return '<a href="mailto:'.$encodedmail.'">'.$encodedmail.'</a>';
}
add_shortcode('emailme', 'protect_email_address');
@nathaningram
nathaningram / gist:e8adfae9501ad6e74797
Last active June 30, 2020 22:47
Pods - Change Default Metabox Title
// Change Pods MORE FIELDS Metabox Title to Custom
add_filter('pods_meta_default_box_title','ni_changethatname',10,5);
function ni_changethatname($title, $pod, $fields, $type, $name ) {
// assuming we are changing the meta box title on a pod named 'business'
$title = ($name=='POD-SLUG-HERE') ? __('WHAT YOU WANT TO CALL IT HERE', 'plugin_lang') : $title ;
return $title;
}
@nathaningram
nathaningram / gist:c62c01b09cd166cff067
Created November 16, 2015 16:24
File Link Based Icons for Resource Library
.resource-library a {
padding: 10px 0 10px 50px;
text-decoration: none;
display: block;
line-height: 1.1em;
background-size: 30px 30px !important;
}
.resource-library a:hover {
@nathaningram
nathaningram / gist:195d2f385c5a314e401d
Created November 16, 2015 20:14
Create a PDF Resource Library CSS
/*********************************************
Resource Library CSS
*********************************************/
.resource-library a {
text-decoration: none;
background: url(/icons/pdf.png) left center no-repeat;
background-size: 30px 30px;
padding: 15px 0 15px 40px;
}
add_theme_support( 'builder-responsive', array('tablet-width' => '1023px', 'mobile-width' => '767px' ));
// Add Yoast Breadcrumbs to Top of Builder Content Module
// Be sure breadcrumbs are enabled in Yoast Advanced Settings
add_action( 'builder_module_render_element_block_contents_content', 'show_breadcrumbs', 0 );
function show_breadcrumbs() { ?>
<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?>
<?php }
// Select Builder Layout Automatically for Logged In Users
function ni_logged_in_layout(){
if ( is_user_logged_in() ) {
$layout = '555cdacdbbbb5';
}
return $layout;
}
add_filter( 'builder_filter_current_layout', 'ni_logged_in_layout');
//Sign Up Now Button Shortcode
function ni_cta_button() {
$ctabutton = '<div class="cta-button"><a href="/sign-up/" class="btn">Sign Up Now</a></div>';
return $ctabutton;
}
add_shortcode('signup', 'ni_cta_button');
add_filter( 'show_admin_bar', '__return_false' );