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); });
jQuery Same Height Columns
This requires the CSS flag below to release the min-heights – assuming the divs stack. jQuery(document).ready(function($) { $window = $(window); var jma_same_height = function() { $(‘.same-height-wrap’).each(function() { $this = $(this); // counter for successive same-height classes counter = 1; while ($this.find(‘.same-height-‘ + counter).length) { var highestBox = 0; $inner = $this.find(‘.same-height-‘ + counter); counter++; $inner.each(function() […]
Javascript Detect Mobile
var iOS = /(iPad|iPhone|iPod|Android)/g.test(navigator.userAgent);
Options Page for Plugin
Original code: https://gist.github.com/hlashbrooke/9267467 First the Files (2) The Class: <?php if ( ! defined( ‘ABSPATH’ ) ) exit; class JMAYtSettings { private $dir; private $file; private $assets_url; private $settings_base; private $settings; private $db_option; private $page_title; private $text_domain; public function __construct($base = ‘jma_plugin’, $title = ‘Cool Plugin’, $settings = array(), $text_domain = ”) { $this->file = […]
Modular Columns Same Height
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’); […]
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 = […]
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”);
Placeholder Text with jQuery
This is for the constant contact widget: jQuery(document).ready(function($){ /* Put any theme-specific JS here… */ $ccwidget = $( ‘.widget_sf_widget_constantcontact’ ); $ccwidget.find(‘label’ ).css(‘display’, ‘none’); $ccwidget.find(‘input[name=”fnm”]’ ).attr(‘placeholder’, ‘First Name’); $ccwidget.find(‘input[name=”lnm”]’ ).attr(‘placeholder’, ‘Last Name’); $ccwidget.find(‘input[name=”eml”]’ ).attr(‘placeholder’, ‘Email’); });
Accordion Sidebar Menu
Shows all the children under the current root item and all other root items. function jma_sidebar_addon() { global $post; $ancestors = get_ancestors( $post->ID, ‘page’ ); $ancestor_id = array_pop($ancestors); $ancestor_id = $ancestor_id? $ancestor_id: $post->ID; $root_pages = get_pages(array(‘parent’ => 0)); echo ‘<ul>’; foreach ($root_pages as $root_page) { $jma_classes = ”; $show_kids = false; $has_kids = false; if( […]