Skip to content

Instantly share code, notes, and snippets.

View WebEndevSnippets's full-sized avatar

Bruce Munson WebEndevSnippets

View GitHub Profile
@WebEndevSnippets
WebEndevSnippets / gist:5700817
Created June 3, 2013 19:49
Genesis: Customize Post Navigation
// Customize the next page link
add_filter ( 'genesis_next_link_text' , 'custom_next_link_text' );
function custom_next_link_text ( $text ) {
return g_ent( '» ' ) . __( 'Custom Next Page Link', CHILD_DOMAIN );
}
// Customize the previous page link
add_filter ( 'genesis_prev_link_text' , 'custom_prev_link_text' );
function custom_prev_link_text ( $text ) {
return g_ent( '« ' ) . __( 'Custom Previous Page Link', CHILD_DOMAIN );
@WebEndevSnippets
WebEndevSnippets / gist:5694483
Created June 2, 2013 18:53
Genesis: Force Layout Setting
// Force content-sidebar layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
// Force sidebar-content layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' );
// Force content-sidebar-sidebar layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar_sidebar' );
// Force sidebar-sidebar-content layout setting
@WebEndevSnippets
WebEndevSnippets / gist:5682311
Created May 31, 2013 00:42
Genesis: Add Top Navigation for Genesis 2.0 with HTML5 Activated
ADD FOLLOWING CODE TO FUNCTIONS FILE
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Register Genesis Menus
add_theme_support ( 'genesis-menus' , array ( 'primary' => 'Primary Navigation Menu' , 'secondary' => 'Secondary Navigation Menu' ,'top' => 'Top Navigation Menu' ) );
// Add Custom Top Navigation
add_action('genesis_before_header', 'custom_top_nav');
function custom_top_nav() {
echo '<nav class="nav-top" role="navigation" itemscope itemtype="http://schema.org/SiteNavigationElement">';
@WebEndevSnippets
WebEndevSnippets / functions.php
Created May 28, 2013 19:54
Plugins: Remove Shareaholic (Sexybookmarks)plugin from admin menu
add_action( 'admin_menu', 'we_remove_shareaholic_menu' );
/**
* Remove Shareaholic (Sexybookmarks)plugin from admin menu
*
*/
function we_remove_shareaholic_menu() {
if ( ! is_admin() )
return;
if ( is_plugin_active('sexybookmarks/sexy-bookmarks.php') && ( ! current_user_can( 'manage_options' ) ) ) {
@WebEndevSnippets
WebEndevSnippets / functions.php
Created May 19, 2013 11:32
WordPress: Add rel tag to links for Lightbox
add_filter( 'the_content', 'we_addlightboxrel_replace', 12 );
add_filter( 'get_comment_text', 'we_addlightboxrel_replace' );
/**
* Add rel tag to links for Lightbox
*/
function we_addlightboxrel_replace($content){
global $post;
$pattern = "/<a(.*?)href=('|\")([^>]*).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>(.*?)<\/a>/i";
$replacement = '<a$1href=$2$3.$4$5 rel="prettyPhoto"$6>$7';
$content = preg_replace($pattern, $replacement, $content);
@WebEndevSnippets
WebEndevSnippets / style.css
Last active April 18, 2018 12:08
Gravity Forms: 4 Column CSS
/* 4 column Gravity Forms custom ready class ------------------------------------------------------*/
.gform_wrapper .top_label li.gfield.gf_first_quarter,
.gform_wrapper .top_label li.gfield.gf_second_quarter,
.gform_wrapper .top_label li.gfield.gf_third_quarter,
.gform_wrapper .top_label li.gfield.gf_fourth_quarter {
margin:0 0 8px 0;
width:24%;
}
@WebEndevSnippets
WebEndevSnippets / functions.php
Created April 16, 2013 18:59
WooCommerce: Remove all WooCommerce scripts and styles
add_action( 'init', 'we_manage_woo_styles', 99 );
define( 'WOOCOMMERCE_USE_CSS', false );
/**
* Remove all WooCommerce scripts and styles
*
* @author WP Smith
* @since 1.0.0
*/
function we_manage_woo_styles() {
if ( 'product' !== get_post_type() && !is_page( 'cart' ) && !is_page( 'checkout' ) ) {
@WebEndevSnippets
WebEndevSnippets / functions.php
Created March 10, 2013 00:47
WordPress: Hide Toolbar (Admin Bar) on front end for all except Administrators
add_filter( 'show_admin_bar' , 'webendev_hide_admin_bar');
/**
* Hide Toolbar (Admin Bar) on front end for all except Administrators
*
*/
function webendev_hide_admin_bar($content) {
return ( current_user_can( 'administrator' ) ) ? $content : false;
}
@WebEndevSnippets
WebEndevSnippets / functions.php
Created February 18, 2013 15:30
WordPress: Change Default WP Email Address (instead of from wordpress@domain.com)
add_filter( 'wp_mail_from', 'webendev_change_default_wp_email' );
/**
* Change Default WP Email Address (instead of from wordpress@domain.com)
*
*/
function webendev_change_default_wp_email(){
return 'my.email@domain.com';
}
@WebEndevSnippets
WebEndevSnippets / functions.php
Created February 18, 2013 15:30
WordPress: Change Default WP Email 'From Name'(instead of from WordPress)
add_filter( 'wp_mail_from_name', 'webendev_change_default_wp_email_name' );
/**
* Change Default WP Email 'From Name'(instead of from WordPress)
*
*/
function webendev_change_default_wp_email_name(){
return 'My Real Name';
}