jQuery(document).ready(function($){ /* Put any theme-specific JS here… */ var $components = $(‘#content > .inner, .fixed-sidebar .fixed-sidebar-inner’); function equalizeHeights($selector) { var heights = new Array(); // Loop to get all element heights $selector.each(function() { var $this = $(this); // Need to let sizes be whatever they want so no overflow on resize $this.css(‘min-height’, ‘0’); $this.css(‘max-height’, ‘none’); […]
For more code ideas go to my GitHub gists:
https://gist.github.com/johnnya23
Supress Plugin Update Nag
/* just add to main.php of indy plugin */ add_filter(‘site_transient_update_plugins’, ‘dd_remove_update_nag’); function dd_remove_update_nag($value) { unset($value->response[ plugin_basename(__FILE__) ]); return $value; }
Complex Query Over-rides
function jma_spout_args( $query, $args ) { if ( isset( $args[‘query’] ) && $args[‘query’] == ‘spouts’ ) { $query = array( ‘post_type’ => ‘product’, ‘post__in’ => array( 126,128 ) ); } return $query; } add_filter(‘themeblvd_posts_args’, ‘jma_spout_args’, 10, 2);
Multi column Lists
The CSS: .col-list-wrap { margin-bottom: 20px; } .col-list-wrap ul { margin-bottom: 0; float: left; width: 100%; } .col-list-wrap:before,/* adding clearfix */ .col-list-wrap:after { content: ” “; display: table; } .col-list-wrap:after { clear: both; } @media(min-width:768px){ .two.col-list-wrap ul, .col-list-wrap ul { width:50%; } .three.col-list-wrap ul { width:33%; } .four.col-list-wrap ul { width:25%; } } The HTML: […]
Malone Box
.malone-box, .malone-box input[type=”submit”], .malone-box input[type=”text”], .malone-box input[type=”email”], .malone-box input[type=”tel”] { border-bottom-right-radius: 20px; border-top-left-radius: 20px; } .malone-box { padding: 25px 30px 15px!important; } .malone-box p { margin-bottom: 0; } .malone-box { border: 2px solid #990000; }
Replace Placehoders
.list-wrap .placeholder {/* or .grid-wrap or .showcase-wrap or .pst-wrap (for all) */ background-image: url(‘./images/scales.png’); background-repeat: no-repeat; background-position: center center; background-color: transparent; opacity: 0.7; } .list-wrap .placeholder i { display:none }
Rollover
Roll over image covers. Notice that overflow is hidden so if there is too much text the extra gets cut off (column 4). Be Careful when considering how it will behave responsively. [raw] [column size=”1/4″ wpautop=”false”] Lorem ipsum dolor sit amet [/column] [column size=”1/4″ wpautop=”false”] Lorem ipsum dolor sit amet, consectetuer adipiscing [/column] [column size=”1/4″ […]
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 […]
Menu Top “Tags”
/* tag effect at top of dropdown menus */ .tb-primary-menu > .menu-item > .sub-menu > li:first-child:before, .tb-primary-menu > .menu-item > .sf-mega:before { content: “”; position: absolute; top: -11px; left: 15px; width: 0px; height: 0px; border-style: solid; border-width: 0 11px 11px 11px; border-color: transparent transparent #ff4891 transparent;/* border color*/ } .tb-primary-menu > .menu-item > .sub-menu > […]