This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modify breadcrumb arguments | |
add_filter( 'genesis_breadcrumb_args', 'sp_breadcrumb_args' ); | |
function sp_breadcrumb_args( $args ) { | |
// $args['home'] = 'Home'; | |
$args['sep'] = ' <span>›</span> '; | |
// $args['list_sep'] = ', '; // Genesis 1.5 and later | |
// $args['prefix'] = '<div class="breadcrumb">'; | |
// $args['suffix'] = '</div>'; | |
// $args['heirarchial_attachments'] = true; // Genesis 1.5 and later | |
// $args['heirarchial_categories'] = true; // Genesis 1.5 and later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Expires Caching # | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/jpg "access 1 year" | |
ExpiresByType image/jpeg "access 1 year" | |
ExpiresByType image/gif "access 1 year" | |
ExpiresByType image/png "access 1 year" | |
ExpiresByType image/svg+xml "access 1 year" | |
ExpiresByType text/css "access 1 month" | |
ExpiresByType application/pdf "access 1 month" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove empty p tags for custom shortcodes | |
add_filter('the_content', 'op_content_filter'); | |
function op_content_filter($content) { | |
// array of custom shortcodes requiring the fix | |
$block = join('|',array('shortcode1')); | |
// opening tag | |
$rep = preg_replace("/(<p>)?\[($block)(\s[^\]]+)?\](<\/p>|<br \/>)?/","[$2$3]",$content); | |
// closing tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Disable XML-RPC | |
add_filter( 'xmlrpc_enabled', '__return_false' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove edit link | |
add_filter ( 'genesis_edit_post_link' , '__return_false' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fixes duplicate items showing up if the same menu_order is shared between two items across a page break. | |
// Replace update_menu_order() with the code below. | |
function update_menu_order() | |
{ | |
global $wpdb; | |
parse_str( $_POST['order'], $data ); | |
if ( !is_array( $data ) ) return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dialog.dialog({ | |
draggable: false, | |
modal: true, | |
resizable: false, | |
maxWidth: 600, | |
width: 500, | |
fluid: true, // Enables fluidDialog() | |
}); | |
function fluidDialog() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('plugins_loaded', function() { | |
$action = is_user_admin() ? 'user_admin_notices' : 'admin_notices'; | |
add_action($action, function () { | |
ob_start(); | |
}); | |
add_action('all_admin_notices', function () { | |
$log = strip_tags(trim(ob_get_clean())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @2x image sizes | |
*/ | |
function make_it_retina($file, $width, $height, $crop = false) { | |
if ($width || $height) { | |
$resized_file = wp_get_image_editor($file); | |
if (!is_wp_error($resized_file)) { | |
$resized_file->resize($width * 2, $height * 2, $crop); |