Install and populate woo testimonials plugin: Extract and import this .json file into slider (the .jma-testimonials class isincluded in this import): soliloquy-73-05-11-2018.json.tar /* testimonial slider */ .jma-testimonials { max-height: inherit !important; } .jma-testimonials .soliloquy-caption { position: static !important; display: block !important } .jma-testimonials .soliloquy-caption-inside { position: absolute !important; top: 0 !important; width: 100% !important; height: […]
WP Google Maps in Tabs
Add this to js/core.js around line 932 right after this: jQuery(‘body’).on(‘tabsactivate’, function(event, ui) { for(var entry in wpgmaps_localize) { InitMap(wpgmaps_localize[entry][‘id’],’all’,false); } }); jQuery(‘.nav-tabs a’).click(function() { setTimeout(function(){ for(var entry in wpgmaps_localize) { InitMap(wpgmaps_localize[entry][‘id’],’all’,false); } },500); });
WooCommerce Filters
Remove related products function jma_remove_related_products( $args ) { return array(); } add_filter(‘woocommerce_related_products_args’,’jma_remove_related_products’, 10); Redirect ‘add to cart’ button function jma_redirect_add_to_cart() { global $woocommerce; $checkout_url = $woocommerce->cart->get_checkout_url();//get_cart_url(); for cart return $checkout_url; } add_filter (‘add_to_cart_redirect’, ‘jma_redirect_add_to_cart’); Redirect ‘back to shop’ button function jma_return_to_shop_redirect() { return get_permalink(682); } add_filter( ‘woocommerce_return_to_shop_redirect’, ‘jma_return_to_shop_redirect’ ); Turn off Themeblvd Woo Images (re-enable […]
Order by Expiration
Using the post expirator plugin see useful plugins function my_custom_posts_query( $query, $args ){ if( $args[‘query’] == ‘expires_first’ ){ $query = array( ‘cat’ => 1, ‘order’ => ‘ASC’, ‘meta_key’ => ‘_expiration-date’, ‘orderby’ => ‘meta_value’ ); if(is_front_page())//optional $query[‘posts_per_page’] = 5; } return $query; } add_filter( ‘themeblvd_posts_args’, ‘my_custom_posts_query’, 10, 2 ); For woo products with variable category query […]
MySql Move Post Tags
When using Post Type Switcher the tags get left behind (this will move them ALL which isn’t always what you want). UPDATE wp_term_taxonomy SET taxonomy=’portfolio_tag’ WHERE taxonomy=’post_tag’ UPDATE wp_term_taxonomy SET taxonomy=’portfolio’ WHERE taxonomy=’category’
Nivo Slider From ACF Gallery
Use this to create the html for the slider: function jma_nivo($input = array() ){ $defaults = array( ‘class’ => ”, ‘acf_field’ => ‘gallery’, ‘image_size’ => ‘tb_grid’, ‘thumb_size’ => ‘tb_thumb’, ‘post_id’ => ”, ‘image_ids’ => ”, ); foreach($defaults as $var => $default){ $args[$var] = isset($input[$var]) && $input[$var]? $input[$var]: $default; } extract($args); if(!$post_id){ global $post; $post_id = […]
Nivo Slider Nav Styling
/* slider nav and caption */ .tb-nivo-slider-wrapper .nivo-directionNav { height: 0; position:static; } .tb-nivo-slider-wrapper .nivo-directionNav a { top: 50%; transform: translate(0, -50%); position: absolute; background-image: none; width: 30px; height: 30px; opacity: 0; -webkit-transition: opacity 0.6s; /* Safari */ transition: opacity 0.6s; z-index: 100; } .tb-nivo-slider-wrapper:hover .nivo-directionNav a { opacity: 1; } .tb-nivo-slider-wrapper .nivo-directionNav a.nivo-prevNav { […]
Suppress Related Videos on Popups
For lightbox videos: function change_magnific_popup_iframe_setting(){ ?> <script> jQuery(window).load(function(){ jQuery(‘a[href*=”youtube.com/watch”]’).magnificPopup({ type: ‘iframe’, iframe: { patterns: { youtube: { index: ‘youtube.com’, id: ‘v=’, src: ‘//www.youtube.com/embed/%id%?rel=0&autoplay=1’ } } } }); }); </script> <?php } add_action(“wp_footer”, “change_magnific_popup_iframe_setting”);
WPML Add Language Toggle
function languages_list_header(){ $languages = icl_get_languages(‘skip_missing=0&orderby=code’); if(!empty($languages)){ echo ‘<div class=”tb-wpml-flaglist-header”><ul>’; foreach($languages as $l){ if(!$l[‘active’] && !$l[‘missing’]){ echo ‘<li>’; echo ‘<a href=”‘.$l[‘url’].'”>’; echo icl_disp_language($l[‘native_name’], $l[‘translated_name’]); echo ‘</a>’; echo ‘</li>’; } } echo ‘</ul></div>’; } } function below_menu_html(){ echo ‘<div class=”below_menu_html”><div>’; echo languages_list_header(); echo ‘</div></div>’; } add_action(‘themeblvd_header_menu’,’below_menu_html’);