Skip to content

Instantly share code, notes, and snippets.

Rick R. Duncan rickrduncan

View GitHub Profile
View combine-menu-responsive.js
jQuery(function( $ ){
$("header #menu-right-menu").addClass("responsive-menu").before('<div id="responsive-menu-icon"></div>');
$("#responsive-menu-icon").click(function(){
$("header #menu-right-menu").slideToggle();
});
$(window).resize(function(){
if(window.innerWidth > 768) {
@rickrduncan
rickrduncan / oembed-gist.php
Last active Aug 29, 2015
A quick fix to this plugin: http://wordpress.org/plugins/oembed-gist/. Line 57, 61 & 69 were changed to rename the variable from 'gist' to 'oe-gist.' Line 79 was edited to add isset() to stop the error I was getting while testing.
View oembed-gist.php
<?php
/*
Plugin Name: oEmbed Gist
Plugin URI: http://firegoby.jp/wp/oembed-gist
Description: Embed source from gist.github.
Author: Takayuki Miyauchi
Version: 1.4.0
Author URI: http://firegoby.jp/
*/
@rickrduncan
rickrduncan / jetpack-share-after-post-title.php
Last active Aug 29, 2015
Reposition JetPack share buttons to below post title for users of the Genesis Framework.
View jetpack-share-after-post-title.php
<?php
//* Do NOT include the opening php tag
//* Add Jetpack share buttons above post
remove_filter( 'the_content', 'sharing_display', 19 );
remove_filter( 'the_excerpt', 'sharing_display', 19 );
add_filter( 'the_content', 'b3m_share_buttons_above_post', 19 );
add_filter( 'the_excerpt', 'b3m_share_buttons_above_post', 19 );
@rickrduncan
rickrduncan / child-theme-url.php
Created Apr 16, 2014
A shortcode to output your child theme URL to be used in Posts, Pages and/or Widgets.
View child-theme-url.php
<?php
//* Do NOT include the opening php tag
//* Get path to our child theme folder
//* Useage: [theme-url]
function b3m_theme_uri_shortcode( $attrs = array (), $content = '' ) {
$theme_uri = is_child_theme() ? get_stylesheet_directory_uri() : get_template_directory_uri();
return $theme_uri;
@rickrduncan
rickrduncan / archive-order-by.php
Created Apr 25, 2014
Order WordPress archive posts by "Title" in "Ascending" order for one specific category.
View archive-order-by.php
<?php
//* Do NOT include the opening php tag
function b3m_before_loop () {
if( is_category( '1' ) ) {
global $query_string;
query_posts( wp_parse_args( $query_string, array( 'orderby' => 'title', 'order' => 'ASC' ) ) );
@rickrduncan
rickrduncan / delay_publish_rss_feed.php
Created May 28, 2014
Small script to place in child theme functions.php file to delay the publishing of a new RSS feed file.
View delay_publish_rss_feed.php
<?php
//* Do NOT include the opening php tag
//* Delay the adding of new content to the WordPress RSS feed
function b3m_delay_publish_rss_feed($where) {
global $wpdb;
if ( is_feed() ) {
@rickrduncan
rickrduncan / step_1.php
Last active Aug 29, 2015
2 Step process to remove RSS feeds from WordPress websites
View step_1.php
<?php
//* Do NOT include the opening php tag
//* BEGIN: Disable WordPress RSS Feed
function b3m_disable_rss_feed() {
wp_die( __( 'Our RSS feed is disabled. Please <a href="/">visit our homepage</a>.' ) );
}
View scramble-email-address.php
<?php
//* Do NOT include the opening php tag
//* Display email to screen WITHOUT href and scramble it to hide from spam bots
//* http://codex.wordpress.org/Function_Reference/is_email
//* http://codex.wordpress.org/Function_Reference/antispambot
function b3m_hide_email_shortcode( $atts, $content = null ) {
if ( ! is_email( $content ) ) {
return;
}
@rickrduncan
rickrduncan / 508-genesis-searchbox.php
Created Apr 30, 2015
508 Compliant Genesis Search Box
View 508-genesis-searchbox.php
<?php
//* Do NOT include the opening php tag
/** 508 Compliant Search Box
* @param string search form
* @param string search text
* @param string button text
* @return string modified search form
*/
function b3m_search_form( $form, $search_text, $button_text ) {
@rickrduncan
rickrduncan / remove-emoji.php
Created May 17, 2015
Disable WordPress 4.2 Emoji support
View remove-emoji.php
<?php
//* Do NOT include the opening php tag
//* Remove silly-ass emoji code
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
You can’t perform that action at this time.