A mixin for writing @font-face rules in SASS.
Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.
@include font-face(Samplino, fonts/Samplino);
if (function_exists('bcn_display')) { | |
function theme_remove_news_from_trail_on_404($trail) { | |
if ( is_404() ) { | |
unset($trail->trail[1]); | |
array_keys($trail->trail); | |
} | |
} | |
add_action('bcn_after_fill', 'theme_remove_news_from_trail_on_404'); | |
} |
<?php | |
// https://businessbloomer.com/woocommerce-remove-specific-category-shop-loop/ | |
// https://stackoverflow.com/questions/34684881/hide-products-from-users-who-are-not-logged-in-using-tags/34689768#34689768 | |
add_action( 'woocommerce_product_query', 'show_hide_products_category_shop' ); | |
function show_hide_products_category_shop( $q ) { | |
$tax_query = (array) $q->get( 'tax_query' ); | |
if ( is_user_logged_in() ) { |
add_filter( 'woocommerce_cart_shipping_packages', 'bulky_woocommerce_cart_shipping_packages' ); | |
function bulky_woocommerce_cart_shipping_packages( $packages ) { | |
// Reset the packages | |
$packages = array(); | |
// Bulky items | |
$bulky_items = array(); | |
$regular_items = array(); | |
<script type="text/javascript"> | |
/* in order to update info on your checkout page you need to trigger update_checkout function | |
so add this in your javascript file for your theme or plugin | |
*/ | |
jQuery('body').trigger('update_checkout'); | |
/* what this does is update the order review table but what it doesn't do is update shipping costs; | |
the calculate_shipping function of your shipping class will not be called again; | |
so if you were like me and you made a shipping method plugin and you had to change costs based on payment method then |
/** | |
* Menu customizations | |
*/ | |
add_filter('wp_nav_menu_objects', 'intro_nav_menu_objects', 10, 2); | |
function intro_nav_menu_objects( $items, $args ) { | |
//If our menu has the id primary-menu in the wp_nav_menu in our header.php | |
if ( $args->menu_id == 'primary-menu' ){ | |
//var_dump( $items ); | |
//For each item in the menu. the $item->ID is the menu item ID not the page/post ID | |
//The post id will be the $item->object_id if it is a post/page |
<?php | |
$my_menu = array( | |
'menu' => 'main-menu', | |
'container' => '', | |
'items_wrap' => '%3$s' | |
); | |
wp_nav_menu( $my_menu ); | |
<?php | |
/* | |
Plugin Name: Set Image Alt field | |
Plugin URI: https://www.damiencarbery.com | |
Description: Set the alt field of uploaded images to the title. Copy image title to alt when inserted into editor. Set alt of post thumbnail to post title. Code copied from various sources. | |
Author: Damien Carbery, Francisco Ruiz, Dan and Bojan Petrovic. | |
Version: 0.1 | |
*/ | |
<?php | |
/* This snippet removes the action that inserts thumbnails to products in the loop | |
* and adds link and title the image, it applies to all archives of products. | |
* | |
* @original plugin: WooCommerce | |
* @author of snippet: Luis Ruiz | |
**/ | |
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); | |
add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); |
//* http://gasolicious.com/remove-tabs-keep-product-description-woocommerce/ | |
// Location: add to functions.php | |
// Output: removes woocommerce tabs | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); |