Skip to content

Instantly share code, notes, and snippets.

View mikeyarce's full-sized avatar

Mikey Arce mikeyarce

View GitHub Profile
@kraftbj
kraftbj / functions.php
Created September 16, 2015 15:22
Related Posts: Only return posts in same categories
<?php // do not include this line if pasting into an existing php file
// This function will only return posts that are related AND has ALL of the same categories.
function jp_only_rp_in_same_category( $categories, $post_id ) {
$category_objects = get_the_category( $post_id );
if ( ! empty( $categories ) ) {
$categories = array_merge( 'categories', 'category_objects' );
return $categories;
}
@woogist
woogist / functions.php
Created October 15, 2014 10:04
Increase the import limit for WooCommerce Product CSV Import Suite
<?php
/**
* Increase the import limit for WooCommerce Product CSV Import Suite
*/
add_filter( 'woocommerce_csv_import_limit_per_request', create_function( '', 'return 20;' ) ); //Increase limit to 20
@mjangda
mjangda / jetpack-mobile-override.php
Created November 7, 2012 15:45
Override Jetpack's mobile theme by loading your own.
<?php
add_filter( 'jetpack_mobile_stylesheet', function( $stylesheet, $theme ) {
return 'vip/mytheme-mobile';
} );
add_filter( 'jetpack_mobile_template', function ( $template, $theme ) {
return 'vip/mytheme-mobile';
// if our mobile theme is a child theme, we should return the parent:
// return 'pub/myparenttheme-mobile';