Skip to content

Instantly share code, notes, and snippets.

View rickrduncan's full-sized avatar

Rick R. Duncan rickrduncan

View GitHub Profile
<?php
//* Do NOT include the opening php tag above
//* Customize the default search button text
add_filter( 'genesis_search_button_text', 'b3m_genesis_search_button_text' );
function b3m_genesis_search_button_text( $text ) {
return esc_attr( 'Go' );
}
<?php
//* Do NOT include the opening php tag above
//* Customize search form input box text of Genesis child themes
add_filter( 'genesis_search_text', 'b3m_genesis_search_text' );
function b3m_genesis_search_text( $text ) {
return esc_attr( 'Search my blog...' );
<?php
//* Do NOT include the opening php tag
/**
* @purpose: Remove references to feed from <head> section of website
*
* @author: Rick R. Duncan
* @contact: www.rickrduncan.com
*
*/
function b3m_remove_header_junk() {
@rickrduncan
rickrduncan / htaccess.txt
Last active August 29, 2015 14:23
Limit Access to wp-admin by IP Address
# BEGIN Allow/Deny Access to WP-LOGIN
<Files wp-login.php>
# set up rule order
order deny,allow
# default deny
deny from all
# Add additional IPs for access below:
# YOUR PLACE OF BUSINESS
allow from xxx.xxx.xxx.xxx
allow from xxx.xxx.xxx.xxx
@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' );
@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 / 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 ) {
<?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 / 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>.' ) );
}
@rickrduncan
rickrduncan / disable_rss_feed.php
Last active November 6, 2015 12:05
Small script to place in child theme functions.php file to disable RSS feed.
<?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="'. get_bloginfo('url') .'">visit our homepage</a>.' ) );
}