static function admin_enqueue_scripts_callback() { $javo_admin_css = array('javo_admin_theme_settings-extend.css' => 'javo-ts-extends', 'javo_admin_post_meta.css' => 'javo-admin-post-meta-css'); $javo_admin_jss = array(); foreach ($javo_admin_css as $src => $id) { javo_get_asset_style($src, $id); } foreach ($javo_admin_jss as $src => $id) { javo_get_asset_script($src, $id); } wp_enqueue_style('wp-color-picker'); wp_enqueue_style("jQuery-chosen-autocomplete-style", JAVO_THEME_DIR . "/assets/css/chosen.min.css", null, "0.1"); wp_enqueue_script('wp-color-picker'); wp_enqueue_script('my-script-handle', JAVO_THEME_DIR . '/assets/js/admin-color-picker.js', array('wp-color-picker'), false, true); wp_enqueue_script('jQuery-chosen-autocomplete', JAVO_THEME_DIR . '/assets/js/chosen.jquery.min.js', array('jquery'), false, true); wp_enqueue_script('thickbox'); wp_enqueue_script('google_map_API', '//maps.google.com/maps/api/js?sensor=false&language=en', null, '0.0.1', false); javo_get_script('gmap3.js', 'jQuery-gmap3', '5.1.1', false); }
public function javo_gallery_function($atts = array(), $content = "") { global $javo_tso; javo_get_script("jquery.mixitup.min.js", "mixitup", "2.1.4"); extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff', 'have_terms' => '', 'display_type' => 'parent', 'max_amount' => 0, 'rand_order' => null), $atts)); $javo_this_gallery_args = array("post_type" => 'item', "post_status" => 'publish', "posts_per_page" => (int) $max_amount > 0 ? (int) $max_amount : -1); if ($rand_order == 'use') { $javo_this_gallery_args['orderby'] = 'rand'; } $have_terms = @explode(',', $have_terms); $javo_have_terms = array(); if (!empty($have_terms)) { foreach ($have_terms as $term) { if ((int) $term <= 0) { continue; } $javo_have_terms[] = get_term($term, 'item_category'); // IF NOT ONLY PARENTS if ($display_type != 'parent') { $javo_sub_cat = get_terms('item_category', array('parent' => $term, 'hide_empty' => false)); foreach ($javo_sub_cat as $cat) { $javo_have_terms[] = $cat; } } } } $javo_this_get_term_args = array(); $javo_this_get_term_args['hide_empty'] = false; if ($display_type == 'parent' || $display_type == '') { $javo_this_get_term_args['parent'] = 0; } $javo_gallery_terms = !empty($javo_have_terms) ? $javo_have_terms : get_terms("item_category", $javo_this_get_term_args); $javo_get_terms_ids = array(); wp_enqueue_scripts('jQuery-Rating'); ob_start(); echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';')); ?> <div id="javo-gall"> <div class="javo-gallery-navi"> <button class="javo-gall-filter" data-filter="all"><?php _e('ALL', 'javo_fr'); ?> </button> <?php foreach ($javo_gallery_terms as $term) { printf('<button class="javo-gall-filter gallery-terms-btn" data-filter=".javo-gallery-term-%s">%s</button>', $term->term_id, strtoupper($term->name)); $javo_get_terms_ids[] = $term->term_id; } ?> </div> <div class="javo-gallery"> <?php $javo_this_gallery_args['tax_query'][] = array('taxonomy' => 'item_category', 'field' => 'term_id', 'terms' => $javo_get_terms_ids); $javo_gallery_posts = new WP_Query($javo_this_gallery_args); if ($javo_gallery_posts->have_posts()) { while ($javo_gallery_posts->have_posts()) { $javo_gallery_posts->the_post(); $javo_pm = new javo_GET_META(get_the_ID()); $javo_this_include_terms = $javo_pm->cat('item_category', false, false, true); $javo_this_terms = ''; if ($javo_this_include_terms != false) { foreach ($javo_this_include_terms as $terms) { $javo_this_terms .= ' javo-gallery-term-' . $terms->term_id; } } else { $javo_this_terms = ' javo-gallery-term-all'; } ?> <div class="javo-gall-mix<?php echo $javo_this_terms; ?> "> <div class="javo-gallery-wrap"> <a href="<?php the_permalink(); ?> "> <div class="javo-gallery-shadow"></div> <?php if (has_post_thumbnail()) { echo get_the_post_thumbnail(get_the_ID(), 'javo-box', array('class' => 'img-responsive')); } else { printf('<img src="%s" class="img-responsive wp-post-image" style="width:100%%; height:244px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png')); } ?> <div class="javo-gallery-term-content-title"> <?php echo get_the_title(get_the_ID()); ?> <!-- <span class="glyphicon glyphicon-th-list"></span> --> </div> <div class="javo-gallery-term-content-inform"> <div class="javo-gallery-term-content-category"> <?php echo $javo_pm->cat('item_category', __('No Category', 'javo_fr')); ?> </div><!-- javo-gallery-term-content-category --> <div class="javo-gallery-term-content-rating"> <?php printf('<div class="javo-gallery-on-hover-rating" data-score="%.1f"></div>', (double) get_post_meta(get_the_ID(), 'rating_average', true)); ?> </div> <!-- javo-gallery-term-content-rating --> </div> <!-- javo-gallery-trem-content-inform --> </a> </div><!-- wrap --> <div class="javo-left-overlay bg-red"> <div class="javo-txt-meta-area admin-color-setting"><i class="glyphicon glyphicon-map-marker"></i> <?php echo $javo_pm->cat('item_location', __("No Location", "javo_fr"), true); ?> </div> <!-- javo-txt-meta-area --> <div class="corner-wrap"> <div class="corner admin-color-setting"></div> <div class="corner-background admin-color-setting"></div> </div> <!-- corner-wrap --> </div> </div> <!-- javo-gallery-term --> <?php } // End While } else { _e('No Items Found.', 'javo_fr'); } // End If wp_reset_query(); ?> </div> </div> <script type="text/javascript"> jQuery(document).ready(function($){ "use strict"; $('.javo-gallery').mixItUp({ selectors:{ filter : '.javo-gall-filter' , target : '.javo-gall-mix' } }); jQuery(function($){ $('.javo-gallery-on-hover-rating').each(function(){ $(this).raty({ starOff: '<?php echo JAVO_IMG_DIR; ?> /star-off-s.png' , starOn: '<?php echo JAVO_IMG_DIR; ?> /star-on-s.png' , starHalf: '<?php echo JAVO_IMG_DIR; ?> /star-half-s.png' , half: true , readOnly: true , score: $(this).data('score') }).css('width', ''); }); $(document).on('click', 'button.filter', function(){ $(window).trigger('resize'); }); }); }); </script> <?php return ob_get_clean(); }
public function javo_events_gallery_function($atts = array(), $content = "") { global $javo_tso; javo_get_script("jquery.mixitup.min.js", "mixitup", "2.1.4"); extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff', 'display_type' => 'parent'), $atts)); $javo_this_gallery_args = array("post_type" => 'jv_events', "post_status" => 'publish', "posts_per_page" => -1); $javo_this_get_term_args = array(); $javo_this_get_term_args['hide_empty'] = false; if ($display_type == 'parent' || $display_type == '') { $javo_this_get_term_args['parent'] = 0; } $javo_events_gallery_posts = new WP_Query($javo_this_gallery_args); $javo_events_gallery_terms = get_terms("jv_events_category", $javo_this_get_term_args); ob_start(); echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';')); ?> <div id="javo-events-gall"> <div class="javo-events-gallery-navi"> <button class="javo-event-gallery-filter" data-filter="all"><?php _e('ALL', 'javo_fr'); ?> </button> <?php foreach ($javo_events_gallery_terms as $term) { printf('<button class="javo-event-gallery-filter gallery-terms-btn" data-filter=".javo-events-gallery-term-%s">%s</button>', $term->term_id, strtoupper($term->name)); } ?> </div> <div class="javo-events-gallery row"> <?php if ($javo_events_gallery_posts->have_posts()) { while ($javo_events_gallery_posts->have_posts()) { $javo_events_gallery_posts->the_post(); $javo_meta_query = new javo_GET_META(get_the_ID()); $javo_this_parent_permalink = get_permalink(get_post_meta(get_the_ID(), 'parent_post_id', true)) . '#item-events'; $javo_this_include_terms = $javo_meta_query->cat('jv_events_category', false, false, true); $javo_this_terms = ''; if ($javo_this_include_terms != false) { foreach ($javo_this_include_terms as $terms) { $javo_this_terms .= ' javo-events-gallery-term-' . $terms->term_id; } } else { $javo_this_terms = ' javo-events-gallery-term-all'; } ?> <div class="col-md-3 javo-event-gallery-mix<?php echo $javo_this_terms; ?> "> <a href="<?php echo $javo_this_parent_permalink; ?> "> <?php if (has_post_thumbnail()) { echo get_the_post_thumbnail(get_the_ID(), 'javo-box'); } else { printf('<img src="%s" class="jv-events-gallery-no-image" style="width:100%%; height:266px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png')); } ?> </a> <div class="javo-events-gallery-term-content-title"><span><?php echo javo_str_cut(get_the_title(), 25); ?> </span></div> <?php if (get_post_meta(get_the_ID(), 'brand', true)) { ?> <div class="event-tag custom-bg-color-setting admin-color-setting"> <?php echo apply_filters('javo_offer_brand_tag', get_post_meta(get_the_ID(), 'brand', true)); ?> </div> <?php } ?> </div> <?php } // End While } else { _e('No Items Found.', 'javo_fr'); } // End If wp_reset_query(); ?> <div class="gap"></div> <div class="gap"></div> </div> </div> <script type="text/javascript"> jQuery(function($){ "use strict"; $('.javo-events-gallery').mixItUp({ selectors:{ target : '.javo-event-gallery-mix' , filter : '.javo-event-gallery-filter' } }); }); </script> <?php return ob_get_clean(); }