Skip to content

Instantly share code, notes, and snippets.

View sirchrispy's full-sized avatar
🤔
Just doing my thing.

Chris Power sirchrispy

🤔
Just doing my thing.
View GitHub Profile
@sirchrispy
sirchrispy / functions.php
Last active December 19, 2015 03:19
WP: Genesis - Change Footer Information
<?php
/** Change information in footer */
remove_action('genesis_footer', 'genesis_do_footer');
add_action('genesis_footer', 'seasoning2013_custom_footer');
function seasoning2013_custom_footer() {
$goTop = '<div class="gototop"><a rel="nofollow" href="#wrap">Return to Top of Page</a></div>';
$myCreds = '<div class="creds">Copyright &copy;';
$myCreds .= date( 'Y' );
$myCreds .= ' &middot; <a href="http://thecookingdish.com">The Cooking Dish</a> &middot; Built on the <a href="http://www.shareasale.com/r.cfm?b=242694&u=469466&m=28169&urllink=&afftrack=">Genesis Framework</a> &middot; Inspired by <a href="http://www.shareasale.com/r.cfm?b=457657&u=469466&m=28169&urllink=&afftrack=">Modern Portfolio</a></div>';
@sirchrispy
sirchrispy / functions.php
Last active December 19, 2015 03:39
WP: Genesis - Change Header Position
<?php
/** Reposition the header */
remove_action('genesis_header', 'genesis_header_markup_open', 5);
remove_action('genesis_header', 'genesis_do_header');
remove_action('genesis_header', 'genesis_header_markup_close', 15);
add_action('genesis_before', 'genesis_header_markup_open', 5);
add_action('genesis_before', 'genesis_do_header');
add_action('genesis_before', 'genesis_header_markup_close', 15);
@sirchrispy
sirchrispy / functions.php
Last active December 30, 2015 09:29 — forked from wpscholar/functions.php
WP: Conditional IE stylesheets from child theme
<?php
add_action( 'wp_enqueue_scripts', 'child_theme_scripts' );
function child_theme_scripts() {
global $wp_styles;
/**
* Load our IE-only stylesheet for all versions of IE:
* <!--[if IE]> ... <![endif]-->
@sirchrispy
sirchrispy / functions.php
Last active August 29, 2015 14:05
WP: Plugins - Jetpack
<?php
//* Only display the following jetpack modules
add_filter( 'jetpack_get_available_modules', 'fs_only_these_jetpack_modules' );
function fs_only_these_jetpack_modules ( $modules ) {
$return = array();
$return['after-the-deadline'] = $modules['after-the-deadline']; // Spelling and Grammar
$return['carousel'] = $modules['carousel']; // Carousel
$return['comments'] = $modules['comments']; // Jetpack Comments
$return['contact-form'] = $modules['contact-form']; // Contact Form
@sirchrispy
sirchrispy / functions.php
Created March 25, 2015 21:04
WP: Allow shortcodes everywhere
//* Shortcode optimization
add_filter( 'the_content', 'do_shortcode' ); // Allow shortcodes inside of shortcodes
add_filter( 'comment_text', 'do_shortcode' ); // Allow shortcodes in comments
add_filter( 'comment_text', 'shortcode_unautop' ); // Prevent comment shortcodes from wrapping in <p>...</p> tags
add_filter( 'the_excerpt', 'do_shortcode' ); // Allow shortcodes in excerpts
add_filter( 'the_excerpt', 'shortcode_unautop' ); // Prevent excerpt shortcodes from wrapping in <p>...</p> tags
add_filter( 'widget_text', 'do_shortcode' ); // Allow shortcodes in widgets
add_filter( 'widget_text', 'shortcode_unautop' ); // Prevent shortcodes in widgets from wrapping in <p>...</p> tags
@sirchrispy
sirchrispy / functions.php
Created March 25, 2015 21:11
WP: Modify Visual Editor Toolbar
/**
* Modify TinyMCE4 configurations & Init.
*
* @param array $mceInit config
* @param int $editor_id
* @return array $mceInit
* @link Modified from https://github.com/mattheu/wp-editor-talk-demo/blob/master/inc/tinymce-mods.php
*/
add_filter( 'tiny_mce_before_init', 'geff_modify_tinyMCE4', 10, 2 );
function geff_modify_tinyMCE4( $mceInit, $editor_id ) {
@sirchrispy
sirchrispy / style-admin.css
Last active March 1, 2016 17:10
WordPress MultiSite: Display a List of Network User Emails by Role
.emails {
margin-bottom: 40px;
}
@sirchrispy
sirchrispy / security.php
Last active March 15, 2016 21:40
WordPress Security Functions
<?php
/*
Steps to Secure WordPress
1. Create your own database with a unique name
2. Use a unique table prefix
3. Change default Admin username
4. After install, remove wp-admin/install.php
5. Disable version info
6. Secure wp-config.php via .htaccess file
@sirchrispy
sirchrispy / box-colors.txt
Last active March 21, 2016 19:15
Boxes Shortcode Examples
[box]Your content here.[/box]
[box color="black"]Your content here.[/box]
[box color="blue"]Your content here.[/box]
[box color="brown"]Your content here.[/box]
[box color="gray"]Your content here.[/box]
[box color="green"]Your content here.[/box]
[box color="orange"]Your content here.[/box]
[box color="purple"]Your content here.[/box]
[box color="red"]Your content here.[/box]
[box color="yellow"]Your content here.[/box]
@sirchrispy
sirchrispy / wpms-genesis-network-menu.php
Last active March 16, 2021 08:57
WordPress MultiSite and Genesis: Display a Network-Wide Menu Raw
<?php
/*
* This code adds a network-wide menu in Genesis Header Right.
* It can be altered to be in any location your heart desires.
*
* For this code to work, your main site and all sub-sites need to meet the following conditions:
* 1) Register a menu with the same name on all themes used in network
* 2) Create a menu via the Appearance menu on main site and sub-sites and assign it to the same location
* 3) Leave the menu created in condition 2 blank on all sub-sites