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
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
// WP_Query arguments | |
$args = array ( | |
'post_type' => 'events', | |
'pagination' => true, | |
'paged' => $paged, | |
'meta_query' => array( | |
array( | |
'key' => 'event_date', | |
'value' => date('Ymd', strtotime('now')), |
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 add to cart button on category archive pages. | |
function remove_loop_button(){ | |
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); | |
} | |
add_action('init','remove_loop_button'); |
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
/** | |
* [WordPress] Template Redirect | |
* Use archive-books.php for Genre taxonomy archives. | |
*/ | |
add_filter( 'template_include', 'sk_template_redirect' ); | |
function sk_template_redirect( $template ) { | |
if ( is_tax( 'sports-book-cat' ) ) | |
$template = get_query_template( 'archive-books' ); | |
return $template; |
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( !function_exists('wpex_fix_shortcodes') ) { | |
function wpex_fix_shortcodes($content){ | |
$array = array ( | |
'<p>[' => '[', | |
']</p>' => ']', | |
']<br />' => ']' | |
); | |
$content = strtr($content, $array); | |
return $content; | |
} |
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
<div class="row"> | |
<div class="archive-header"> | |
<?php | |
//firs argument of the action is WHERE the function hooks into | |
add_action( 'woocommerce_before_main_content', 'woocommerce_category_image', 2 ); | |
function woocommerce_category_image() { | |
if ( is_product_category() ){ | |
global $wp_query; | |
$cat = $wp_query->get_queried_object(); | |
$thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); |
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
//Goes in functions.php | |
// Change number or products per row to 3 | |
add_filter('loop_shop_columns', 'loop_columns'); | |
if (!function_exists('loop_columns')) { | |
function loop_columns() { | |
return 3; // 3 products per row | |
} | |
} |
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 | |
/* | |
Plugin Name: Custom Mini Cart | |
Plugin URI: https://www.zendesignfitm.com/ | |
Description: A widget framework for jewelry dropdown. | |
Version: 1.0 | |
Author: Joey Z | |
Author URI: https://www.zendesignfirm.com/ | |
License: GPL | |
*/ |
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
// This function loads the plugin. | |
function jz_load_plugin() { | |
if (!class_exists('Vintage_Engagement_Widget')) { | |
// load Vintage Engagement Widget if not already loaded | |
include_once(TEMPLATEPATH.'/plugins/vintage_engagement_widget.php'); | |
} | |
if (!class_exists('Jewelry_Widget')) { | |
// load Vintage Engagement Widget if not already loaded | |
include_once(TEMPLATEPATH.'/plugins/jewelry_widget.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 | |
/* | |
Template Name: Events Search Page | |
*/ | |
global $query_string; | |
$query_args = explode("&", $query_string); | |
//this is where you would normally put your $args array | |
$search_query = array(); |