generated from autonomic-cooperative/wordpress-starter
Initial theme import
This commit is contained in:
45
wp-content/themes/mont58-coffee/functions.php
Normal file
45
wp-content/themes/mont58-coffee/functions.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Equeue the child theme stylesheet.
|
||||
*/
|
||||
function mont58coffee_enqueue_styles() {
|
||||
|
||||
wp_enqueue_style('child-style',
|
||||
get_stylesheet_uri(),
|
||||
array( 'bridge' ),
|
||||
wp_get_theme()->get( 'Version' )
|
||||
);
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'mont58coffee_enqueue_styles' );
|
||||
|
||||
add_filter( 'get_terms', 'ts_get_subcategory_terms', 10, 3 );
|
||||
function ts_get_subcategory_terms( $terms, $taxonomies, $args ) {
|
||||
$new_terms = array();
|
||||
// if it is a product category and on the shop page
|
||||
if ( in_array( 'product_cat', $taxonomies ) && ! is_admin() &&is_shop() ) {
|
||||
foreach( $terms as $key => $term ) {
|
||||
if ( !in_array( $term->slug, array( 'african-coffees' ) ) ) { //pass the slug name here
|
||||
$new_terms[] = $term;
|
||||
}}
|
||||
$terms = $new_terms;
|
||||
}
|
||||
return $terms;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin Name: Extend WooCommerce Subscription Intervals
|
||||
* Description: Add a "every 10 weeks" billing interval to WooCommerce Subscriptions
|
||||
* Author: Brent Shepherd
|
||||
* Author URI: http://brent.io
|
||||
* Version: 1.0
|
||||
* License: GPL v2
|
||||
*/
|
||||
|
||||
function eg_extend_subscription_period_intervals( $intervals ) {
|
||||
|
||||
$intervals[10] = sprintf( __( 'every %s', 'my-text-domain' ), WC_Subscriptions::append_numeral_suffix( 10 ) );
|
||||
|
||||
return $intervals;
|
||||
}
|
||||
add_filter( 'woocommerce_subscription_period_interval_strings', 'eg_extend_subscription_period_intervals' );
|
||||
Reference in New Issue
Block a user