0 1 2 3 4 5 6 7 |
function jma_search_filter( $query ) {/* exclude book specials from search */ if ( ! $query->is_admin && $query->is_search && $query->is_main_query() ) { $query->set( 'post__not_in', array( 1565, 1540 ) ); } } add_action( 'pre_get_posts', 'jma_search_filter' ); |
Modular Columns Same Height
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
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'); $this.css('height', 'auto'); // Then add size (no units) to array heights.push($this.innerHeight()); }); // Find max height of all elements var max = Math.max.apply( Math, heights ); // Set all heights to max height $selector.each(function() { if($(window).width() > 768) { $(this).css('min-height', max + 'px'); } }); } $(window).load(function() { // Fix heights on page load equalizeHeights($components); // Fix heights on window resize var iv = null; $(window).resize(function() { if(iv !== null) { window.clearTimeout(iv); } // Needs to be a timeout function so it doesn't fire every ms of resize iv = setTimeout(function() { equalizeHeights($components); }, 120); }); }); }); |
Supress Plugin Update Nag
0 1 2 3 4 5 6 7 8 |
/* 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
0 1 2 3 4 5 6 7 8 9 10 11 12 13 |
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:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
.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:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<div class="two col-list-wrap"><!--or three or four--> <ul> <li>Dental exams and procedures</li> <li>Job coaching, resume building assistance, etc.</li> <li>Housing programs</li> <li>Senior resources</li> </ul> <ul> <li>Domestic violence support</li> <li>Social Security Disability Income or Social Security Income</li> <li>Free financial counseling and budgeting classes</li> <li>One Stop Re-Entry Center: support services for incarcerated individuals </li> </ul> </div> |
Malone Box
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
.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
0 1 2 3 4 5 6 7 8 9 10 11 |
.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 } |
Showcase Item Popup Background Color Selector
And the selector is (are): .post_showcase .showcase-item.has-title .featured-item.showcase .tb-thumb-link:after, .post_showcase .showcase-item.has-title .featured-item.showcase.tb-thumb-link:after
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. Using Jumpstart columns notice wpautop=”false”
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
[raw] [column size="1/4" wpautop="false"] <div class="roll-over-wrap"> <img src="http://cleansupersites.com/wp-content/uploads/2016/07/horizontal1500x1125-blue-800x800.jpg" alt="horizontal1500x1125-blue" width="600" height="600" class="size-tb_square_medium wp-image-1720" /> <div class="roll-over"><div class="roll-over-inner">Lorem ipsum dolor sit amet</div></div><!--roll-over--> </div><!--roll-over-wrap--> [/column] [column size="1/4" wpautop="false"] <div class="roll-over-wrap"> <img src="http://cleansupersites.com/wp-content/uploads/2016/07/horizontal1500x1125-green-800x800.jpg" alt="horizontal1500x1125-green" width="600" height="600" class="size-tb_square_medium wp-image-1721" /> <div class="roll-over"><div class="roll-over-inner">Lorem ipsum dolor sit amet, consectetuer adipiscing </div></div><!--roll-over--> </div><!--roll-over-wrap--> [/column] [column size="1/4" wpautop="false"] <div class="roll-over-wrap"> <img src="http://cleansupersites.com/wp-content/uploads/2016/07/horizontal1500x1125-lavendar-800x800.jpg" alt="horizontal1500x1125-lavendar" width="600" height="600" class="size-tb_square_medium wp-image-1722" /> <div class="roll-over"><div class="roll-over-inner">Lorem </div></div><!--roll-over--> </div><!--roll-over-wrap--> [/column] [column size="1/4" wpautop="false"] <div class="roll-over-wrap"> <img src="http://cleansupersites.com/wp-content/uploads/2016/07/horizontal1500x1125-purple-800x800.jpg" alt="horizontal1500x1125-purple" width="600" height="600" class="size-tb_square_medium wp-image-1723" /> <div class="roll-over"><div class="roll-over-inner">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</div></div><!--roll-over--> </div><!--roll-over-wrap--> [/column] [/raw] |
and the css. NOTE: this is for square images, if your images are not square divide height […]
Page by Page Sidebars
Using Advanced Custom Fields Create WYSIWYG Fields “Right Sidebar” (id right_sidebar) and/or “Left Sidebar” (id left_sidebar).
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
function jma_custom_sidebar($side){ $content = get_field( $side.'_sidebar'); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content . '<div style="clear: both; margin-bottom: 20px"></div>'; } /** * Call our sidebar functions based on the * current position and current sidebar layout. */ function jma_custom_sidebars( $position ) { // Get current sidebar layout $layout = themeblvd_config( 'sidebar_layout' ); if( $position == 'left' ) { // Display any sidebars to be located on the LEFT // based on the current sidebar layout. // Display the left sidebar if( $layout == 'sidebar_left' || $layout == 'double_sidebar' || $layout == 'double_sidebar_left' ) { do_action( 'themeblvd_fixed_sidebar_before', 'left' ); if(get_field('left_sidebar')) jma_custom_sidebar('left'); else themeblvd_display_sidebar( 'sidebar_'.$position ); do_action( 'themeblvd_fixed_sidebar_after' ); } // Display the right sidebar if there is a // double sidebar over on the left. if( $layout == 'double_sidebar_left' ) { do_action( 'themeblvd_fixed_sidebar_before', 'right' ); if(get_field('right_sidebar')) jma_custom_sidebar('right'); else themeblvd_display_sidebar( 'sidebar_right' ); do_action( 'themeblvd_fixed_sidebar_after' ); } } else if( $position == 'right' ) { // Display any sidebars to be located on the RIGHT // based on the current sidebar layout. // Display the left sidebar if there is a // double sidebar over on the right. if( $layout == 'double_sidebar_right' ) { do_action( 'themeblvd_fixed_sidebar_before', 'left' ); if(get_field('left_sidebar')) jma_custom_sidebar('left'); else themeblvd_display_sidebar( 'sidebar_left' ); do_action( 'themeblvd_fixed_sidebar_after' ); } // Display the right sidebar if( $layout == 'sidebar_right' || $layout == 'double_sidebar' || $layout == 'double_sidebar_right' ) { do_action( 'themeblvd_fixed_sidebar_before', 'right' ); if(get_field('right_sidebar')) jma_custom_sidebar('right'); else themeblvd_display_sidebar( 'sidebar_'.$position ); do_action( 'themeblvd_fixed_sidebar_after' ); } } } function jma_template_redirect(){ if(is_page() && function_exists('get_field') && (get_field('right_sidebar') || get_field('left_sidebar'))){ remove_action( 'themeblvd_sidebars', 'themeblvd_fixed_sidebars' ); add_action( 'themeblvd_sidebars', 'jma_custom_sidebars' ); } } add_action('template_redirect', 'jma_template_redirect'); |