This file contains 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 new image sizes | |
function lc_insert_custom_image_sizes( $image_sizes ) { | |
// get the custom image sizes | |
global $_wp_additional_image_sizes; | |
// if there are none, just return the built-in sizes | |
if ( empty( $_wp_additional_image_sizes ) ) | |
return $image_sizes; | |
// add all the custom sizes to the built-in sizes | |
foreach ( $_wp_additional_image_sizes as $id => $data ) { |
This file contains 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
<ifModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault A300 | |
# Expires after 1 month | |
ExpiresByType image/gif A2592000 | |
ExpiresByType image/png A2592000 | |
ExpiresByType image/jpg A2592000 | |
ExpiresByType image/x-icon A2592000 | |
ExpiresByType application/pdf A2592000 |
This file contains 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 support for JetPack infinite scroll | |
**/ | |
function lc_infinite_scroll_init() { | |
add_theme_support( 'infinite-scroll', array( | |
'container' => 'content', | |
'footer' => 'footer', | |
'render' => 'genesis_do_loop' | |
) ); | |
} |
This file contains 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
#!/bin/sh | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Wil Brown | |
# | |
# @uses /bin/sh scriptname.sh path | |
# @params text path to your WordPress folder from the www root e.g. / or /WordPress | |
# |
This file contains 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
/** | |
* The Infinite Blog Footer | |
* | |
* @uses self::get_settings, self::set_last_post_time, self::archive_supports_infinity, __, wp_get_theme, get_current_theme, apply_filters, home_url, esc_attr, get_bloginfo, bloginfo | |
* @return string or null | |
*/ | |
function footer() { | |
// Bail if theme requested footer not show | |
if ( false == self::get_settings()->footer ) | |
return; |
This file contains 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 support for JetPack infinite scroll | |
**/ | |
add_theme_support( 'infinite-scroll', array( | |
'container' => 'content', | |
'footer' => 'page', | |
) | |
); |
This file contains 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
if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { | |
require_once( WP_CONTENT_DIR . '/maintenance.php' ); | |
die(); | |
} |
This file contains 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
/** Grab IDs from new WP 3.5 gallery **/ | |
function lc_grab_ids_from_gallery() { | |
global $post; | |
$attachment_ids = array(); | |
$pattern = get_shortcode_regex(); | |
$ids = array(); | |
if (preg_match_all( '/'. $pattern .'/s', $post->post_content, $matches ) ) { //finds the "gallery" shortcode and puts the image ids in an associative array at $matches[3] | |
$count=count($matches[3]); //in case there is more than one gallery in the post. |
This file contains 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
// Filter video output | |
add_filter('oembed_result','lc_oembed_result', 10, 3); | |
function lc_oembed_result($html, $url, $args) { | |
// $args includes custom argument | |
$newargs = $args; | |
// get rid of discover=true argument | |
array_pop( $newargs ); |
This file contains 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
[ text* your-name 58/ ] | |
[ email* your-email 58/ ] | |
[ checkbox mailchimp-optin default:1 use_label_element "Subscribe to our newsletter" ] |