} else { $taxonomy = 'category'; $args_cat = array(); $post_type = 'post'; } $args = array('post_type' => $post_type, 'paged' => $_GET['page_id_all'], 'post_status' => 'publish', 'order' => 'DESC'); $args = array_merge($args_cat, $args); $custom_query = new WP_Query($args); ?> <?php if ($custom_query->have_posts()) { ?> <?php while ($custom_query->have_posts()) { $custom_query->the_post(); $image_url = cs_attachment_image_src(get_post_thumbnail_id($post->ID), 342, 193); $post_class = ''; if ($image_url == '') { $post_class = ' no-image'; } $event_from_date = get_post_meta($post->ID, "cs_event_from_date", true); ?> <article id="post-<?php the_ID(); ?> " <?php post_class($post_class); ?> >
'); }); </script> <?php } } cs_addthis_script_init_method(); while ($custom_query->have_posts()) { $custom_query->the_post(); $event_from_date = get_post_meta($post->ID, "cs_event_from_date", true); $year_event = date_i18n("Y", strtotime($event_from_date)); $month_event = date_i18n("m", strtotime($event_from_date)); $month_event_c = date_i18n("M", strtotime($event_from_date)); $date_event = date_i18n("d", strtotime($event_from_date)); $image_url = cs_attachment_image_src(get_post_thumbnail_id($post->ID), $width, $height); if ($image_url == '') { $noimg = ' no-image'; } else { $noimg = ''; } $cs_event_meta = get_post_meta($post->ID, "cs_event_meta", true); if ($cs_event_meta != "") { $cs_event_meta = new SimpleXMLElement($cs_event_meta); $inside_event_gallery = $cs_event_meta->inside_event_gallery; $event_start_time = $cs_event_meta->event_start_time; $event_end_time = $cs_event_meta->event_end_time; $event_all_day = $cs_event_meta->event_all_day; } ?>
function widget($args, $instance) { extract($args, EXTR_SKIP); global $wpdb, $post; $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']); $get_names_gallery = isset($instance['get_names_gallery']) ? esc_attr($instance['get_names_gallery']) : ''; $showcount = isset($instance['showcount']) ? esc_attr($instance['showcount']) : ''; if (empty($showcount)) { $showcount = '12'; } // WIDGET display CODE Start echo $before_widget; if (strlen($get_names_gallery) != 1 || strlen($get_names_gallery) != 0) { echo $before_title . $title . $after_title; } if ($get_names_gallery != '') { // galery slug to id start $get_gallery_id = ''; $args = array('name' => $get_names_gallery, 'post_type' => 'cs_gallery', 'post_status' => 'publish', 'showposts' => 1); $get_posts = get_posts($args); if ($get_posts) { $get_gallery_id = $get_posts[0]->ID; } // galery slug to id end if ($get_gallery_id != '') { $cs_meta_gallery_options = get_post_meta($get_gallery_id, "cs_meta_gallery_options", true); if ($cs_meta_gallery_options != "") { $cs_xmlObject = new SimpleXMLElement($cs_meta_gallery_options); if ($showcount > count($cs_xmlObject)) { $showcount = count($cs_xmlObject); } ?> <ul class="gallery-list lightbox"> <?php for ($i = 0; $i < $showcount; $i++) { $path = $cs_xmlObject->gallery[$i]->path; $title = $cs_xmlObject->gallery[$i]->title; $social_network = $cs_xmlObject->gallery[$i]->social_network; $use_image_as = $cs_xmlObject->gallery[$i]->use_image_as; $video_code = $cs_xmlObject->gallery[$i]->video_code; $link_url = $cs_xmlObject->gallery[$i]->link_url; $image_url = cs_attachment_image_src($path, 150, 150); $image_url_full = cs_attachment_image_src($path, 0, 0); ?> <li> <a <?php if ($title != '') { echo 'data-title="' . $title . '"'; } ?> href="<?php if ($use_image_as == 1) { echo $video_code; } elseif ($use_image_as == 2) { echo $link_url; } else { echo $image_url_full; } ?> " target="<?php if ($use_image_as == 2) { echo '_blank'; } else { echo '_self'; } ?> " data-rel="<?php if ($use_image_as == 1) { echo "prettyPhoto"; } elseif ($use_image_as == 2) { echo ""; } else { echo "prettyPhoto[gallery1]"; } ?> "><?php echo "<img width='60' height='60' src='" . $image_url . "' data-alt='" . $title . "' alt='' />"; ?> </a> </li> <?php } ?> </ul> <?php } } else { fnc_no_result_found(false); } } // endif of Category Selection ?> <?php echo $after_widget; // WIDGET display CODE End }
function cs_flex_slider($width, $height, $slider_id) { global $cs_node, $cs_theme_option, $cs_counter_node; $cs_counter_node++; if ($slider_id == '') { $slider_id = $cs_node->slider; } if ($cs_theme_option['flex_auto_play'] == 'on') { $auto_play = 'true'; } else { if ($cs_theme_option['flex_auto_play'] == '') { $auto_play = 'false'; } } $cs_meta_slider_options = get_post_meta("{$slider_id}", "cs_meta_slider_options", true); ?> <!-- Flex Slider --> <div id="flexslider<?php echo $cs_counter_node; ?> "> <div class="flexslider" style="display: none;"> <ul class="slides"> <?php $cs_counter = 1; $cs_xmlObject_flex = new SimpleXMLElement($cs_meta_slider_options); foreach ($cs_xmlObject_flex->children() as $as_node) { $image_url = cs_attachment_image_src($as_node->path, $width, $height); ?> <li> <figure> <img src="<?php echo $image_url; ?> " alt=""> <?php if ($as_node->title != '' && $as_node->description != '' || $as_node->title != '' || $as_node->description != '') { ?> <figcaption> <div class="container"> <?php if ($as_node->title != '') { ?> <h2 class="colr"> <?php if ($as_node->link != '') { echo '<a href="' . $as_node->link . '" target="' . $as_node->link_target . '">' . $as_node->title . '</a>'; } else { echo $as_node->title; } ?> </h2> <?php } ?> <?php if ($as_node->description != '') { ?> <p> <?php echo substr($as_node->description, 0, 220); if (strlen($as_node->description) > 220) { echo "..."; } ?> </p> <?php } ?> </div> </figcaption> <?php } ?> </figure> </li> <?php $cs_counter++; } ?> </ul> </div> </div> <?php cs_enqueue_flexslider_script(); ?> <!-- Slider height and width --> <!-- Flex Slider Javascript Files --> <script type="text/javascript"> jQuery(document).ready(function(){ var speed = <?php echo $cs_theme_option['flex_animation_speed']; ?> ; var slidespeed = <?php echo $cs_theme_option['flex_pause_time']; ?> ; jQuery('#flexslider<?php echo $cs_counter_node; ?> .flexslider').flexslider({ animation: "<?php echo $cs_theme_option['flex_effect']; ?> ", // fade slideshow: <?php echo $auto_play; ?> , slideshowSpeed:speed, animationSpeed:slidespeed, prevText:"<em class='fa fa-long-arrow-left'></em>", nextText:"<em class='fa fa-long-arrow-right'></em>", start: function(slider) { jQuery('.flexslider').fadeIn(); } }); }); </script> <?php }
<div class="gallerysec gallery"> <ul class="<?php echo $cs_node->layout; ?> lightbox clearfix"> <?php if ($cs_meta_gallery_options != "") { for ($i = $limit_start; $i < $limit_end; $i++) { $path = $cs_xmlObject->gallery[$i]->path; $title = $cs_xmlObject->gallery[$i]->title; $social_network = $cs_xmlObject->gallery[$i]->social_network; $use_image_as = $cs_xmlObject->gallery[$i]->use_image_as; $video_code = $cs_xmlObject->gallery[$i]->video_code; $link_url = $cs_xmlObject->gallery[$i]->link_url; $image_url = cs_attachment_image_src($path, 343, 228); $image_url_full = cs_attachment_image_src($path, 0, 0); ?> <li> <a data-title="<?php if ($title != "") { echo $title; } ?> " href="<?php if ($use_image_as == 1) { echo $video_code; } elseif ($use_image_as == 2) { echo $link_url; } else { echo $image_url_full; }