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( 'woocommerce_checkout_fields', 'webendev_woocommerce_checkout_fields' ); | |
/** | |
* Change Order Notes Placeholder Text - WooCommerce | |
* | |
*/ | |
function webendev_woocommerce_checkout_fields( $fields ) { | |
$fields['order']['order_comments']['placeholder'] = 'Your custom placeholder'; | |
return $fields; | |
} |
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( 'image_size_names_choose', 'we_custom_image_sizes_choose' ); | |
/** | |
* Display custom image sizes in Media Gallery | |
* | |
*/ | |
function we_custom_image_sizes_choose( $sizes ) { | |
$custom_sizes = array( | |
'slider-1140' => 'Wide', | |
); | |
return array_merge( $sizes, $custom_sizes ); |
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( 'get_the_excerpt', 'webendev_custom_excerpt' ); | |
/** | |
* Customize Excerpt 'Read More' (including manual excerpts) | |
* | |
*/ | |
function webendev_custom_excerpt($text) { | |
if (strpos( $text, '[...]' ) ) { | |
$excerpt = strip_tags(str_replace('[...]', ' <a class="more-link" href="'.get_permalink().'">[More…]</a>', $text), "<a>"); | |
} else { | |
$excerpt = '' . $text . ' <a class="more-link" href="'.get_permalink().'">[More…]</a>'; |
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
remove_filter( 'get_the_excerpt', 'we_trim_excerpt' ); | |
add_filter( 'get_the_excerpt', 'we_trim_all_excerpt' ); | |
/** | |
* Limit Length of All Excerpts (Manual and Automatic) | |
* | |
*/ | |
function we_trim_all_excerpt($text) { | |
// Creates an excerpt if needed; and shortens the manual excerpt as well | |
global $post; | |
$raw_excerpt = $text; |
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
/** | |
* Disable W3 Total Cache CDN on HTTPS pages only (for SSL) | |
*/ | |
add_action('wp_head','we_nocdn_on_ssl_page'); | |
function we_nocdn_on_ssl_page() { | |
if ( $_SERVER['HTTPS'] == "on" ) { | |
define( 'DONOTCDN', true ); | |
} | |
} |
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-post.php', 'we_fix_html_editor_font' ); | |
add_action( 'admin_head-post-new.php', 'we_fix_html_editor_font' ); | |
/** | |
* Change Font in HTML Editor | |
* | |
*/ | |
function we_fix_html_editor_font() { ?> | |
<style type="text/css">#wp-content-editor-container #content, #wp_mce_fullscreen { font-family: Verdana, Geneva, sans-serif; }</style> | |
<?php | |
} |
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( 'get_the_content_more_link', 'webendev_content_more_link' ); | |
/** | |
* Customize Read More on Content Limit | |
* | |
*/ | |
function webendev_content_more_link() { | |
return '<a class="more-link" href="' . get_permalink() . '">[More …]</a>'; | |
} |
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
/** Modify the length of post excerpts */ | |
add_filter( 'excerpt_length', 'we_custom_excerpt_length' ); | |
function we_custom_excerpt_length($length) { | |
return 50; | |
} |
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( 'genesis_after', 'we_initialize_prettyphoto' ); | |
/** | |
* Initialize prettyPhoto | |
* | |
*/ | |
function we_initialize_prettyphoto() { | |
?> | |
<script type="text/javascript" charset="utf-8"> | |
jQuery(document).ready(function($){ | |
$("a[rel^='prettyPhoto']").prettyPhoto({ |
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 the sub footer section */ | |
add_action( 'genesis_before_footer', 'webendev_sub_footer', 5 ); | |
function webendev_sub_footer() { | |
if ( is_active_sidebar( 'sub-footer-left' ) || is_active_sidebar( 'sub-footer-right' ) ) { | |
echo '<div id="sub-footer"><div class="wrap">'; | |
genesis_widget_area( 'sub-footer-left', array( | |
'before' => '<div class="sub-footer-left">' | |
) ); | |