View gist:11402159
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( 'woo_blog_template_query_args', 'blog_exclude_posts' ); | |
function blog_exclude_posts( $args ) { | |
$args['post_type'] = 'post'; | |
$args['paged'] = $paged; | |
$args['category_name'] = 'news'; | |
return $args; |
View gist:2f7ef362016bb33c0962
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_action ('woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 34 ); | |
add_action('woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); |
View hub-products-css-fix
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
@media only screen and (min-width: 768px) { | |
ul.products li.product { | |
float: left; | |
padding: 0; | |
margin-right: 0; | |
margin-bottom: 0; | |
clear: none; | |
width: 33.33%; | |
padding-top: 33.33%; |
View gist:f330aaf4f6358f898f24
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
input.qty { | |
-moz-appearance: textfield; /* Hide buttons for Firefox 29 and later */ | |
} |
View gist:23e4c543153e27a27573
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
function custom_projects_posts_per_page( $query ) { | |
if ( is_admin() || ! $query->is_main_query() ) | |
return; | |
if ( is_post_type_archive( 'project' ) || is_tax( 'project-category' ) ) { | |
// Display all posts for a custom post type called 'project' | |
$query->set( 'posts_per_page', -1 ); | |
return; | |
} | |
} | |
add_action( 'pre_get_posts', 'custom_projects_posts_per_page', 1 ); |
View gist:9579eebf6bc542e20ee5
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
function custom_projects_randomise_project_output( $query ) { | |
if ( is_admin() || ! $query->is_main_query() ) | |
return; | |
if ( is_post_type_archive( 'project' ) || is_tax( 'project-category' ) ) { | |
$query->set( 'order', 'ASC' ); | |
$query->set( 'orderby', 'rand' ); | |
return; | |
} |
View gist:8d9c59c8a0e61f4c2ebe
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( 'init', 'init_sensei_hooks' ); | |
function init_sensei_hooks() { | |
global $woothemes_sensei; | |
remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 ); | |
remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 ); | |
add_action('sensei_before_main_content', 'my_theme_wrapper_start', 10); | |
add_action('sensei_after_main_content', 'my_theme_wrapper_end', 10); |
View wordpress-login-redirect.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
if ( ( isset( $_GET['action'] ) && $_GET['action'] != 'logout' ) || ( isset( $_POST['login_location'] ) && ! empty( $_POST['login_location'] ) ) ) { | |
add_filter('login_redirect', 'my_login_redirect', 10, 3); | |
function my_login_redirect() { | |
$location = $_SERVER['HTTP_REFERER']; | |
wp_safe_redirect( $location ); | |
exit(); | |
} | |
} |
View woocommerce-exclude-on-sale-products.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
function custom_exclude_on_sale_products_from_query( $q ){ | |
if ( $q->is_search() ) return; | |
if ( ! $q->is_main_query() ) return; | |
if ( ! $q->is_post_type_archive() ) return; | |
if ( ! is_admin() ) { | |
$product_ids_on_sale = wc_get_product_ids_on_sale(); | |
$q->set( 'post__not_in', (array) $product_ids_on_sale ); |
View sf-tag-comma-remove
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
function storefront_post_meta() { | |
?> | |
<aside class="entry-meta"> | |
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?> | |
<?php | |
/* translators: used between list items, there is a space after the comma */ | |
$categories_list = get_the_category_list( __( ', ', 'storefront' ) ); | |
if ( $categories_list && storefront_categorized_blog() ) : ?> |
OlderNewer