Skip to content

Instantly share code, notes, and snippets.

Rick R. Duncan rickrduncan

Block or report user

Report or block rickrduncan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wp-login-headertitle.php
<?php
//* Do NOT include the opening php tag
//* Login Screen: Change login logo hover text
add_filter( 'login_headertitle', 'b3m_login_logo_url_title' );
function b3m_login_logo_url_title() {
return 'REPLACE THIS WITH YOUR TEXT';
}
View wp-login-headerurl.php
<?php
//* Do NOT include the opening php tag
//* Login Screen: Use your own URL for login logo link
add_filter( 'login_headerurl', 'b3m_url_login' );
function b3m_url_login(){
return get_bloginfo( 'wpurl' ); //This line keeps the link on current website instead of WordPress.org
}
View disallow-file-edit.php
<?php
//* Do NOT include this comment or the opening php tag above
//* Remove 'Editor' from 'Appearance' Menu.
//* This stops users from being able to edit files from within WordPress admin dashboard.
if ( ! defined( 'DISALLOW_FILE_EDIT' ) )
define( 'DISALLOW_FILE_EDIT', true );
View widget-title-3a.css
/* The CSS code you will need to customize and add into your stylesheet */
.widgettitle {
border-bottom: 1px solid #DDDDDD;
}
.widgettitle span {
border-bottom: 1px solid #F0591A;
color: #F0591A;
display: block;
float: left;
View widget-title-2a.css
.sidebar .widgettitle span {
background: #fff none repeat scroll 0 0;
padding: 0 2rem;
}
.sidebar .widgettitle {
background: #ffffff url("images/bg-double-bar.png") repeat-x scroll center center;
text-align: center;
}
View exclude-theme-update.php
<?php
//* Do NOT include this comment or the opening php tag above
//* Don't Update Theme
//* @author Mark Jaquith
//* @link http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/
add_filter( 'http_request_args', 'cws_hidden_theme_12345', 5, 2 );
function cws_hidden_theme_12345( $r, $url ) {
if ( 0 !== strpos( $url, 'http://api.wordpress.org/themes/update-check' ) )
@rickrduncan
rickrduncan / wordpress-functionality-plugin.php
Last active Sep 29, 2019
This WordPress functionality plugin contains code snippets that tweak WordPress core and do not contain theme specific functionality. This is code that I run on every single website I build using WordPress.
View wordpress-functionality-plugin.php
<?php
/**
* Plugin Name: WordPress Functionality Plugin
* Plugin URI: http://rickrduncan.com/wordpress/functionality-plugin
* Description: Core WordPress customizations that are theme independent.
* Author: Rick R. Duncan - B3Marketing, LLC
* Author URI: http://rickrduncan.com
*
*
* Version: 1.0.0
View disallow-file-edit.php
<?php
//* Do NOT include this comment or the opening php tag above
//* Remove 'Editor' from 'Appearance' Menu in WordPress.
//* Prevent users from editing theme and plugin files directly from within the WordPress control panel.
define( 'DISALLOW_FILE_EDIT', true );
View x-frame-options.php
<?php
//* Do NOT include the opening php tag
//* Add X-Frame-Options: This will keep people from using any page on our website in an IFRAME
//* https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options
function add_header_xframe() {
header( 'X-Frame-Options: DENY' );
}
add_action( 'send_headers', 'add_header_xframe' );
View genesis-breadcrumb-fontawesome.php
<?php
//* Do NOT include the opening php tag
//* STEP 1
//* Enqueue styles
add_action( 'wp_enqueue_scripts', 'b3m_enqueue_styles' );
function b3m_enqueue_styles() {
wp_enqueue_style( 'fa', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), '4.5.0' );
}
You can’t perform that action at this time.