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_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
/** | |
* Remove WooCommerce Generator tag, styles, and scripts from the homepage. | |
* Tested and works with WooCommerce 2.0+ | |
* @author Greg Rickaby @since 2.0.0 | |
*/ | |
function child_manage_woocommerce_styles() | |
{ |
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_action( 'pre_get_posts', 'set_posts_per_page' ); | |
function set_posts_per_page( $query ) { | |
global $wp_the_query; | |
if ( ( ! is_admin() ) && ( $query === $wp_the_query ) && ( $query->is_search() ) ) { | |
$query->set( 'posts_per_page', 3 ); | |
} | |
elseif ( ( ! is_admin() ) && ( $query === $wp_the_query ) && ( $query->is_archive() ) ) { | |
$query->set( 'posts_per_page', 5 ); |
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
# ------------------------------------------------------------------------------ | |
# | Expires headers | | |
# ------------------------------------------------------------------------------ | |
# The following expires headers are set pretty far in the future. If you | |
# don't control versioning with filename-based cache busting, consider | |
# lowering the cache time for resources such as style sheets and JavaScript | |
# files to something like one week. | |
<IfModule mod_expires.c> |
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
define('WP_MEMORY_LIMIT', '128M'); |
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
<?php | |
function redirect_user_on_role() | |
{ | |
//retrieve current user info | |
global $current_user; get_currentuserinfo(); | |
//If login user role is Subscriber | |
if ($current_user->user_level == 0) | |
{ | |
wp_redirect( home_url() ); exit; | |
} |
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
# Visual Editor as default | |
add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') ); | |
# HTML Editor as default | |
add_filter( 'wp_default_editor', create_function('', 'return "html";') ); |
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_action('admin_head', 'custom_logo'); | |
function custom_logo() { | |
echo ' | |
<style type="text/css"><!-- | |
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.gif) !important; } | |
--></style>'; | |
} |
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_filter('the_content_feed', 'rss_post_thumbnail'); | |
function rss_post_thumbnail($content) { | |
global $post; | |
if( has_post_thumbnail($post->ID) ) | |
$content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '</p>' . $content; | |
return $content; | |
} |
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_filter( 'jpg_quality', 'high_jpg_quality' ); | |
function high_jpg_quality() { | |
return 100; | |
} |
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
<?php | |
add_filter( 'tgmsp_caption_output', 'tgm_soliloquy_custom_html', 10, 4 ); | |
function tgm_soliloquy_custom_html( $html, $id, $image, $i ) { | |
// If the ID doesn't match the one we want to modify, return the default HTML output. Change 324 to your slider ID. | |
if ( '324' !== $id ) | |
return $html; | |
// Append custom code output of the caption to do whatever. $i is the number of the slide. | |
$html .= '<div class="my-custom-class"><p>My custom stuff!</p></div>'; |