Skip to content

Instantly share code, notes, and snippets.

View northernbellediaries's full-sized avatar

northernbellediaries

View GitHub Profile
@northernbellediaries
northernbellediaries / custom gravatar
Last active August 29, 2015 14:01
Custom Gravatar
<?php
//* Do NOT include the opening php tag
//* Create a custom Gravatar
add_filter( 'avatar_defaults', 'custom_gravatar' );
function custom_gravatar ($avatar) {
$custom_avatar = get_stylesheet_directory_uri() . '/images/gravatar.jpg';
$avatar[$custom_avatar] = "Custom Gravatar";
return $avatar;
}
@northernbellediaries
northernbellediaries / Hide code
Last active August 29, 2015 14:02
Hide BlogHer ad if it this is a single post under # category
<?php if (! ( is_single() && in_category('#') )) { ?>
<center>Paste BlogHer Code Here</center>
<?php } ?>
@northernbellediaries
northernbellediaries / Replacing BlogHer ad
Last active August 29, 2015 14:02
Replacing BlogHer ad with a different ad
(is_category('#') || (is_single() && in_category('#')))
@northernbellediaries
northernbellediaries / Hide Swoop
Created June 15, 2014 04:22
Hiding Swoop Ads
<span class="swoop_ignore_page" style="display:none"></span>
@northernbellediaries
northernbellediaries / Hide BlogHer ad conditional statement
Created June 15, 2014 04:24
Hide BlogHer ad conditional statement per category
! ( is_single() && in_category('#') )
@northernbellediaries
northernbellediaries / mobile only
Last active August 29, 2015 14:03
shortcode to show elements in mobile only
<?php
//* Do NOT include the opening php tag
/** Add shortcode to show elements in mobile only */
add_filter('widget_text', 'do_shortcode');
function only_mobile_shortcode($atts, $content = '') {
if (wp_is_mobile() === false) {
$content = '';
}
return $content;
@northernbellediaries
northernbellediaries / gist:7412af75c92898dc9577
Created July 14, 2014 03:53
Hide main BlogHer ad on mobile view and in sponsored posts
! wp_is_mobile() && ! ( is_single() && in_category('XX') )
@northernbellediaries
northernbellediaries / Mobile supplemental BlogHer ad
Last active August 29, 2015 14:03
Coding supplemental BlogHer ad for mobile only
[only_mobile]<div align="center"><!-- BLOGHER ADS Begin supplemental 300 ad -->
<script src="UNIQUE AD URL PROVIDED BY BLOGHER" type="text/javascript"></script>
<!-- End supplemental 300 ad --></div>[/only_mobile]
@northernbellediaries
northernbellediaries / gist:6913bca7cd31ca8b478f
Created August 21, 2014 20:43
Hide main Blogher ad on mobile view
! wp_is_mobile()
@northernbellediaries
northernbellediaries / Combine gists
Created September 27, 2014 16:45
Combining these two functions please?
//* Customize the entry meta in the entry footer (requires HTML5 theme support)
add_filter( 'genesis_post_meta', 'sp_post_meta_filter');
function sp_post_meta_filter($post_meta) {
$post_meta = '[post_comments zero="0 Comments"]';
return $post_meta;
}
add_action( 'genesis_before_comments', 'child_related_posts' );
/**
* Outputs related posts with thumbnail