Skip to content

Instantly share code, notes, and snippets.

View northernbellediaries's full-sized avatar

northernbellediaries

View GitHub Profile
@northernbellediaries
northernbellediaries / robots.txt
Created August 1, 2015 13:14
Fixing CSS and JS permissions for robots.txt
User-agent: *
Disallow: /wp-admin/
User-agent: Googlebot
Allow: /* .js*
Allow: /* .css*
@northernbellediaries
northernbellediaries / Add a post signature for multiple authors?
Created October 12, 2014 16:10
Add a post signature for multiple authors?
<?php
//* Add a post signature for multiple authors
if ( is_single() ) {
printf ('<div class="tracey-signature ' .
get_the_author_meta('user_id') . '"> </div>');
}
elseif ( is_single() ) {
printf ('<div class="cat-signature ' .
get_the_author_meta('user_id') . '"> </div>');
}
@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
@northernbellediaries
northernbellediaries / gist:6913bca7cd31ca8b478f
Created August 21, 2014 20:43
Hide main Blogher ad on mobile view
! wp_is_mobile()
@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: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 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 / Hide BlogHer ad conditional statement
Created June 15, 2014 04:24
Hide BlogHer ad conditional statement per 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>