Skip to content

Instantly share code, notes, and snippets.

// 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');
// 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 }
@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;
//Anti-Spam Email Shortcode
//Use this shortcode [email]info@google.com[/email]
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('email', 'protect_email_address');
@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;
}
@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:d9c99f078d321f4f8cdd
Last active January 13, 2016 20:48
Builder Full Width - CSS
/*********************************************
Full Width Awesomeness Webinar
*********************************************/
/* Header Logo and Navigation */
#header-container-wrapper {
position: absolute;
top: 0;
width: 100%;
@nathaningram
nathaningram / gist:fd0b4c8cf3f79f32baf0
Last active January 13, 2016 20:48
Builder Full Width - HTML Module - Video Background
[rev_slider alias="Home2"]
<div id="header-container-wrapper">
<div id="header-container">
<div id="header-logo"><a href="http://wpnathan.com"><img src="http://wpnathan.com/wp-content/media/lone-palm-logo.png"></a></div>
<div id="header-menu"><?php wp_nav_menu( array('menu' => 'Palm Menu' )); ?></div>
@nathaningram
nathaningram / gist:a25f5bbcaf2a01ac0bde
Last active January 18, 2016 20:02
Hides WP Help Functions for Non-Admins
// Hides WP Help Functions for Non-Admins
// Add to the functions.php of your active child theme
function ni_hide_wphelp_actions() {
echo '<style type="text/css">
#cws-wp-help-actions {display:none !important;}
</style>';
}
if ( ! current_user_can('administrator') ) {
@nathaningram
nathaningram / gist:353d9768bd49de26c059
Created February 29, 2016 16:53
Full Width Awesomeness Webinar - CSS for Full Width Featured Image
/* Full Width Blog Featured Image & Info */
#ni-blog-wrapper {
height: 75vh; /* 1vh = 1% of viewport height */
background-size: cover;
background-position: center center;
position: relative;
}
#ni-blog-info {