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 | |
if (!is_page() && !is_home()){ | |
$catsy = get_the_category(); | |
$myCat = $catsy[0]->cat_ID; | |
} | |
wp_list_categories('orderby=id&title_li=¤t_category='.$myCat); | |
?> |
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 drop dwon for custom tax | |
function restrict_books_by_genre() { | |
global $typenow; | |
$post_type = 'resource'; // change HERE | |
$taxonomy = 'resource_cats'; // change HERE | |
if ($typenow == $post_type) { | |
$selected = isset($_GET[$taxonomy]) ? $_GET[$taxonomy] : ''; | |
$info_taxonomy = get_taxonomy($taxonomy); | |
wp_dropdown_categories(array( | |
'show_option_all' => __("Show All {$info_taxonomy->label}"), |
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
// Custom post type results template. | |
function template_chooser($template) { | |
global $wp_query; | |
$post_type = get_query_var('post_type'); | |
if( isset($_GET['s']) && $post_type == 'directory_list' ) { | |
return locate_template('archive-directory.php'); // redirect to archive-search.php | |
} | |
if( isset($_GET['s']) && $post_type == 'resource' ) { | |
return locate_template('archive-resources.php'); // redirect to archive-search.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
/* This is the code responsible for the centering of content */ | |
display: -webkit-box; | |
display: -moz-box; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; | |
-webkit-flex-pack:center; | |
-webkit-justify-content:center; | |
-moz-justify-content:center; |
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 if (sizeof(WC()->cart->get_cart()) != 0): ?> | |
<?php global $woocommerce; echo $woocommerce->cart->cart_contents_count; ?> | |
<a href="<?php echo get_permalink(5); ?>"> | |
<i class="fa fa-shopping-cart"></i> <?php global $woocommerce; echo $woocommerce->cart->cart_contents_count; ?> Cart | |
</a> | |
<?php endif ?> |
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, | |
.woocommerce form .form-row select, | |
.gform_wrapper ul.gform_fields li.gfield div.ginput_complex span.ginput_left select, | |
.gform_wrapper ul.gform_fields li.gfield div.ginput_complex span.ginput_right select, | |
.gform_wrapper ul.gform_fields li.gfield input[type=radio], | |
.gform_wrapper ul.gform_fields li.gfield select { | |
-webkit-appearance: button; | |
-webkit-border-radius: 2px; | |
-webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); | |
-webkit-padding-end: 20px; |
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
var holidays= ["2014-7-30","2015-07-29","2013-03-16"] | |
$('input').datepicker({ | |
beforeShowDay: function(date){ | |
var string = jQuery.datepicker.formatDate('yy-mm-dd', date); | |
var noWeekend = $.datepicker.noWeekends(date); | |
if (noWeekend[0]) { | |
return [$.inArray(string, holidays) == -1]; | |
} | |
else |
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
import React from 'react' | |
import styled from 'styled-components' | |
const StyledImage = styled.img` | |
filter: grayscale(100%); | |
width: 100px; | |
height: 100px; | |
` | |
export default ({count = 10}) => { |
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
// check for clear-cart get param to clear the cart, append ?clear-cart to any site url to trigger this | |
add_action( 'init', 'woocommerce_clear_cart_url' ); | |
function woocommerce_clear_cart_url() { | |
if ( isset( $_GET['clear-cart'] ) ) { | |
global $woocommerce; | |
$woocommerce->cart->empty_cart(); | |
} | |
} |
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 | |
/** | |
* [list_searcheable_acf list all the custom fields we want to include in our search query] | |
* @return [array] [list of custom fields] | |
*/ | |
function list_searcheable_acf(){ | |
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
return $list_searcheable_acf; | |
} |
OlderNewer