Skip to content

Instantly share code, notes, and snippets.

View rickrduncan's full-sized avatar

Rick R. Duncan rickrduncan

View GitHub Profile
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 / jetpack-share-after-post-title.php
Last active August 29, 2015 13:59
Reposition JetPack share buttons to below post title for users of the Genesis Framework.
<?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 April 16, 2014 19:52
A shortcode to output your child theme URL to be used in Posts, Pages and/or Widgets.
<?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 April 25, 2014 10:37
Order WordPress archive posts by "Title" in "Ascending" order for one specific category.
<?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 11:22
Small script to place in child theme functions.php file to delay the publishing of a new RSS feed file.
<?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 August 29, 2015 14:04
2 Step process to remove RSS feeds from WordPress websites
<?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>.' ) );
}
<?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 April 30, 2015 12:12
508 Compliant Genesis Search Box
<?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 18:57
Disable WordPress 4.2 Emoji support
<?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' );
@rickrduncan
rickrduncan / header-nav.php
Last active August 29, 2015 14:21
Unregister header right widget and resposition genesis subnav
<?php
//* Do NOT include the opening php tag
//***************************************************************************************************
//** START: Unregister header right widget area. Reposition secondary navigation menu after header.
//* Unregister the header right widget area
unregister_sidebar( 'header-right' );