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
jQuery('h1.widget-title').each(function(i) { | |
var new_heading = jQuery('<h3></h3>').append(jQuery(this).contents()); | |
new_heading.attr('id', jQuery(this).attr('id')); | |
new_heading.attr('class', jQuery(this).attr('class')); | |
jQuery(this).replaceWith(new_heading); | |
}) | |
jQuery('body.home #content h1.entry-title').each(function(i) { | |
var new_heading = jQuery('<h2></h2>').append(jQuery(this).contents()); | |
new_heading.attr('id', jQuery(this).attr('id')); |
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
Object Caching: APC / Memcached | |
Page Caching: Batcache | |
APC: http://wordpress.org/extend/plugins/apc/ | |
Memcached: http://wordpress.org/extend/plugins/memcached/ | |
Batcache: http://wordpress.org/extend/plugins/batcache/ | |
Remember, these require server-side components or libraries; ask your host for advice before installing these plugins if you're not sure. |
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 | |
require_once getenv( 'WP_TESTS_DIR' ) . '/includes/functions.php'; | |
function _install_and_load_liveblog() { | |
require dirname( __FILE__ ) . '/../liveblog.php'; | |
} | |
tests_add_filter( 'muplugins_loaded', '_install_and_load_liveblog' ); | |
require getenv( 'WP_TESTS_DIR' ) . '/includes/bootstrap.php'; |
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 | |
function pg_change_rss_query( $query ) { | |
if ( ! $query->is_feed ) | |
return $query; | |
// Excludes posts in the staff category from the current feed | |
$query->set( 'category_name', 'staff' ); | |
return $query; | |
} |
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
Index: woocommerce-core-functions.php | |
=================================================================== | |
--- woocommerce-core-functions.php (revision 711539) | |
+++ woocommerce-core-functions.php (working copy) | |
@@ -1425,6 +1425,9 @@ | |
function woocommerce_terms_clauses( $clauses, $taxonomies, $args ) { | |
global $wpdb, $woocommerce; | |
+ // If we're not filtering a query for the product_cat taxonomy, bail out | |
+ if ( ! in_array( 'product_cat', $taxonomies ) ) return $clauses; |
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 | |
// Not tested, but it should work | |
function pg_adjust_main_query( $query ) { | |
/** | |
* If we're not on the blog posts index page, | |
* or if we're not modifying the main query, | |
* then bail out. | |
*/ |
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 | |
function pg_config_achievement_post_type( $settings ) { | |
$settings['menu_icon'] = ''; // url here | |
return $settings; | |
} | |
add_filter( 'dpa_register_post_type_achievement', 'pg_config_achievement_post_type' ); |
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 | |
function pg_init_custom_extension() { | |
achievements()->extensions->your_extension = new Your_DPA_Extension_Class; | |
} | |
add_action( 'dpa_ready', 'pg_init_custom_extension' ); |
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 $query = new WP_Query( array( 'posts_per_page' => 100, 'fields' => 'ids' ) ); ?> | |
<?php if ( $query->have_posts() ) : | |
$post_ids = $query->posts; | |
shuffle( $post_ids ); | |
$post_ids = array_splice( $post_ids, 0, 12 ); | |
foreach ( $post_ids as $post_id ) : | |
$post = get_post( $post_id ); | |
setup_postdata( $post ); | |
?> |
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 | |
// ***************************************************************************************** | |
// Hi! These functions are early versions and might have bugs or not work properly, so YMMV. | |
// ***************************************************************************************** | |
/** | |
* Prints the current function's return type and description. Template tag function for the function post type. | |
* | |
* @return string | |
*/ |