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 | |
add_filter( 'stylesheet_uri', 'gmj_stylesheet_uri' ); | |
/** | |
* Cache bust the style.css reference. | |
* | |
* Includes the file last modified time as a querystring. | |
* | |
* @author Gary Jones | |
* @link https://gist.github.com/1892762 |
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 | |
add_action( 'in_widget_form', 'extend_recent_posts_form', 10, 3 ); | |
add_filter( 'widget_update_callback', 'extend_recent_posts_update', 10, 4 ); | |
add_filter( 'widget_title', 'extend_recent_posts_init_query_filter', 10, 3 ); | |
add_filter( 'widget_posts_args', 'extend_recent_posts_query' ); | |
function extend_recent_posts_form( $widget, $return, $instance ) { | |
if( ! is_a( $widget, 'WP_Widget_Recent_Posts' ) ) | |
return; |
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
/** | |
* Code goes in functions.php or a custom plugin. | |
*/ | |
add_filter( 'woocommerce_states', 'malaysia_woocommerce_states' ); | |
function malaysia_woocommerce_states( $states ) { | |
$states['MY'] = array( | |
'JHR' => __('Johor', 'woocommerce') , | |
'KDH' => __('Kedah', 'woocommerce') , |
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 | |
/** | |
* Grid Loop on Portfolio archive | |
* | |
* @author Bill Erickson | |
* @link https://github.com/billerickson/Genesis-Grid/wiki/Home | |
* | |
* @param bool $grid, whether to use grid loop | |
* @param object $query, the WP Query | |
* @return bool |
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 | |
// These are just two examples | |
// Uses anonymous functions since these are for one-time use | |
// Short-circuit genesis_get_option to show thumbnails | |
add_filter( 'genesis_pre_get_option_content_archive_thumbnail', function() { | |
return 1; // 1 shows thumbnails | |
} ); |
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 | |
add_action( 'wp_enqueue_scripts', 'prefix_enqueue_awesome' ); | |
/** | |
* Register and load font awesome CSS files using a CDN. | |
* | |
* @link http://www.bootstrapcdn.com/#fontawesome | |
* @author FAT Media | |
*/ | |
function prefix_enqueue_awesome() { | |
wp_enqueue_style( 'prefix-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css', array(), '4.0.3' ); |
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 | |
add_filter ( 'jetpack_sharing_twitter_via', 'rkv_jp_twitter_via' ); | |
function rkv_jp_twitter_via() { | |
return 'YOUR_TWITTER_NAME'; | |
} |
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 | |
//* Do NOT include this comment or the opening php tag above | |
//* Wrap first word of widget title into a span tag | |
add_filter ( 'widget_title', 'b3m_add_span_widgets' ); | |
function b3m_add_span_widgets( $old_title ) { | |
$title = explode( " ", $old_title, 2 ); | |
if ( isset( $title[0] ) && isset( $title[1] ) ) { |
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 | |
//* Do NOT include the opening php tag | |
// Add support for 4-column footer widgets | |
add_theme_support( 'genesis-footer-widgets', 4 ); |
OlderNewer