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
<?php | |
// Add these cases on get_catalog_orderby() function on index.php | |
case 'title-desc': | |
$orderby = "title"; | |
$order = 'DESC'; | |
break; | |
case 'title-asc': | |
$orderby = "title"; | |
$order = 'ASC'; |
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
/* | |
* Move the mobile menu icon to center | |
* | |
* Theme Name: HB Charity | |
* Theme URI: http://hummingbirdthemes.com/themes/hb-charity-wordpress-theme/ | |
*/ | |
.menu .visible-xs{ | |
text-align:center; | |
} | |
.menu #showbutton{ |
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( 'hb_charity_top_header', function(){ | |
?> | |
<div class="topheader" style="color:#fff;"> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-lg-12"> | |
<?php echo __( 'My Articles', 'hb-charity' ); ?> | |
</div> | |
</div> | |
</div> |
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
<?php | |
add_action( 'wp_head', function () { | |
?> | |
<style> | |
.label.alg-wc-civs-term { | |
width: auto !important; | |
padding: 0 !important; | |
border: 2px solid #ccc !important; | |
line-height: auto !important; | |
} |
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
<?php | |
add_action('wp_head',function(){ | |
?> | |
<?php //Add your meta here ?> | |
<meta /> | |
<?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
<?php | |
add_filter('posts_clauses', 'posts_clauses_with_tax', 10, 2); | |
function posts_clauses_with_tax( $clauses, $wp_query ) { | |
global $wpdb; | |
//array of sortable taxonomies | |
$taxonomies = array('example-taxonomy', 'other-taxonomy'); | |
if (isset($wp_query->query['orderby']) && in_array($wp_query->query['orderby'], $taxonomies)) { | |
$clauses['join'] .= " | |
LEFT OUTER JOIN {$wpdb->term_relationships} AS rel2 ON {$wpdb->posts}.ID = rel2.object_id | |
LEFT OUTER JOIN {$wpdb->term_taxonomy} AS tax2 ON rel2.term_taxonomy_id = tax2.term_taxonomy_id |
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
SELECT p.ID, p.post_title, t.name AS product_type | |
FROM wp_posts AS p | |
JOIN wp_term_relationships AS tr ON tr.object_id = p.id | |
JOIN wp_term_taxonomy AS tt ON tr.term_taxonomy_id=tt.term_taxonomy_id | |
JOIN wp_terms AS t ON t.term_id = tt.term_id | |
WHERE p.id = 111 AND tt.taxonomy = 'product_type' |
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
/** | |
* Makes the plugin Wish list for WooCommerce compatible with Yith Infinite scrolling | |
*/ | |
add_action('wp_footer',function(){ | |
?> | |
<script> | |
jQuery(document).on('yith_infs_added_elem',function(){ | |
jQuery('.alg-wc-wl-btn').addClass('ajax-loading'); | |
var alg_wc_wl_show = function(){ | |
jQuery('.alg-wc-wl-btn.ajax-loading').removeClass('ajax-loading'); |
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
/** | |
* Update the whole wishlist every time an item is added or removed, considering the wishlist is always present in all pages | |
* Plugin: Wish list for WooCommerce | |
*/ | |
jQuery(document).ready(function($){ | |
//Get your wish list element first (Replace it by your wish list css class) | |
var wish_list_div = '.wish-list'; |
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
<?php | |
function woocommerce_version_check( $version = '3.0' ) { | |
if ( class_exists( 'WooCommerce' ) ) { | |
global $woocommerce; | |
if( version_compare( $woocommerce->version, $version, ">=" ) ) { | |
return true; | |
} | |
} | |
return false; | |
} |