Skip to content

Instantly share code, notes, and snippets.

View rickrduncan's full-sized avatar

Rick R. Duncan rickrduncan

View GitHub Profile
@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 / 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>.' ) );
}
<?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() {
<?php
//* Do NOT include the opening php tag
//* Remove 'You are here' from the front of breadcrumb trail
function b3m_prefix_breadcrumb( $args ) {
$args['labels']['prefix'] = '';
return $args;
}
<?php
//* Do NOT include the opening php tag
//* Change the text at the front of breadcrumb trail
function b3m_home_text_breadcrumb( $args ) {
$args['home'] = 'CUSTOM TEXT HERE';
return $args;
<?php
//* Do NOT include the opening php tag
//* Change the breadcrumb separator
function b3m_change_breadcrumb_separator( $args ) {
$args['sep'] = ' &rsaquo; ';
return $args;
<?php
//* Do NOT include the opening php tag
//* Prefix author breadcrumb trail with the text 'Articles written by'
function b3m_prefix_author_breadcrumb( $args ) {
$args['labels']['author'] = 'Articles written by ';
return $args;
<?php
//* Do NOT include the opening php tag
//* Remove breadcrumb from a single page
//* https://codex.wordpress.org/Function_Reference/is_page
function b3m_remove_genesis_breadcrumb() {
if ( is_page( 'resources' ) ) {
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
}
}
<?php
//* Do NOT include the opening php tag
//* Reposition the Genesis breadcrumb to bottom of page
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_entry_footer', 'genesis_do_breadcrumbs' );