Exemplo n.º 1
0
        cs_posted_on();
        ?>
 
                          <p><?php 
        echo cs_get_the_excerpt($default_excerpt_length, true);
        ?>
</p>
                      </div>
                     <!-- Text End -->
                  </article>
						
                <?php 
    }
    // If no content, include the "No posts found" template.
} else {
    fnc_no_result_found();
}
?>
                  
        		</div>
                  <?php 
$qrystr = '';
// pagination start
if ($custom_query->found_posts > get_option('posts_per_page')) {
    if (isset($_GET['page_id'])) {
        $qrystr .= "&page_id=" . $_GET['page_id'];
    }
    if (isset($_GET['author'])) {
        $qrystr .= "&author=" . $_GET['author'];
    }
    if (isset($_GET['tag'])) {
Exemplo n.º 2
0
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
        $get_post_slug = isset($instance['get_post_slug']) ? esc_attr($instance['get_post_slug']) : '';
        $showcount = isset($instance['showcount']) ? esc_attr($instance['showcount']) : '';
        if (empty($showcount)) {
            $showcount = '4';
        }
        // WIDGET display CODE Start
        echo $before_widget;
        wp_reset_query();
        if (!empty($title) && $title != ' ') {
            echo $before_title . $title . $after_title;
        }
        global $wpdb, $post;
        //$term = get_term( $get_names_events, 'event-category' );
        if ($get_post_slug != '') {
            date_default_timezone_set('UTC');
            $current_time = current_time('Y-m-d H:i', $gmt = 0);
            $newterm = get_term_by('slug', $get_post_slug, 'event-category');
            $args = array('posts_per_page' => $showcount, 'post_type' => 'events', 'event-category' => "{$get_post_slug}", 'post_status' => 'publish', 'meta_key' => 'cs_event_from_date_time', 'meta_value' => $current_time, 'meta_compare' => ">", 'orderby' => 'meta_value', 'order' => 'ASC');
            $custom_query = new WP_Query($args);
            if ($custom_query->have_posts() != "") {
                $cs_counter_events = 0;
                while ($custom_query->have_posts()) {
                    $custom_query->the_post();
                    $cs_counter_events++;
                    $cs_event_from_date = get_post_meta($post->ID, "cs_event_from_date", true);
                    $year_event = date("Y", strtotime($cs_event_from_date));
                    $month_event = date("M", strtotime($cs_event_from_date));
                    $day_event = date("d", strtotime($cs_event_from_date));
                    $cs_event_meta = get_post_meta($post->ID, "cs_event_meta", true);
                    if ($cs_event_meta != "") {
                        $cs_event_meta = new SimpleXMLElement($cs_event_meta);
                        $event_start_time = $cs_event_meta->event_start_time;
                        $event_end_time = $cs_event_meta->event_end_time;
                    }
                    $cs_event_loc = get_post_meta($cs_event_meta->event_address, "cs_event_loc_meta", true);
                    ?>

                         <!-- Events Widget Start -->
						<article>
                            <div class="calendar-date">
                                <span><?php 
                    echo date_i18n('d', strtotime($cs_event_from_date));
                    ?>
</span>
                                <?php 
                    echo date_i18n('M', strtotime($cs_event_from_date));
                    ?>
                            </div>
                            <div class="text">
                                <h2 class="cs-post-title"><a href="<?php 
                    echo get_permalink();
                    ?>
" class="cs-colrhvr"><?php 
                    echo substr(get_the_title(), 0, 21);
                    if (strlen(get_the_title()) > 21) {
                        echo "...";
                    }
                    ?>
</a></h2>
                                <ul class="post-options">
                                
                                    <li><i class="fa fa-map-marker"></i><?php 
                    echo get_the_title((int) $cs_event_meta->event_address);
                    ?>
</li>
                                </ul>
                            </div>
                        </article>
                        

                        <!-- Events Widget End -->		

 						<?php 
                }
                ?>

                        						

 					<?php 
            } else {
                fnc_no_result_found(false);
            }
        }
        // endif of Category Selection
        echo $after_widget;
        // WIDGET display CODE End
    }