Ejemplo n.º 1
0
    function cs_post_slider($cs_slider_blog_cat, $blog_no_posts)
    {
        global $post, $cs_theme_option;
        if (empty($_GET['page_id_all'])) {
            $_GET['page_id_all'] = 1;
        }
        $args = array('posts_per_page' => "{$blog_no_posts}", 'paged' => $_GET['page_id_all'], 'category_name' => "{$cs_slider_blog_cat}", 'order' => "DESC");
        $custom_query = new WP_Query($args);
        $post_count = $custom_query->post_count;
        if ($custom_query->have_posts()) {
            $slider_pagination = array();
            echo '<div id="sliderbanner">';
            echo '<div class="cycle-slideshow" 
								data-cycle-fx=fade
								data-cycle-timeout=3000
								data-cycle-auto-height=container
								data-cycle-slides="article"
								
								data-cycle-random=false
								data-cycle-pager="#banner-pager"
								data-cycle-pager-template="">';
            while ($custom_query->have_posts()) {
                $custom_query->the_post();
                $image_url_full = cs_get_post_img_src($post->ID, '', '');
                if ($image_url_full != '') {
                    $slider_pagination[] = get_the_title();
                    ?>
									<article class="<?php 
                    echo $post->ID;
                    ?>
">
                                        <?php 
                    if ($image_url_full != '') {
                        ?>
<img src="<?php 
                        echo $image_url_full;
                        ?>
" alt=""><?php 
                    }
                    ?>
                                               <div class="caption">
                                                	<h2><?php 
                    the_title();
                    ?>
</h2>
                                               		<p><?php 
                    cs_get_the_excerpt('113', false);
                    ?>
</p>
                                                	<a href="<?php 
                    the_permalink();
                    ?>
" class="btn cs-bgcolrhvr"><?php 
                    if ($cs_theme_option['trans_switcher'] == "on") {
                        _e('Continue Reading', 'WeStand');
                    } else {
                        echo $cs_theme_option['trans_read_more'];
                    }
                    ?>
</a>
                                               </div> 
                                    </article>
                                <?php 
                }
            }
            echo '</div>';
            echo '</div>';
            if (isset($cs_theme_option['show_slider_pagination']) && $cs_theme_option['show_slider_pagination'] == 'on') {
                $pagination_no = 0;
                echo '<div id="sliderpagination">
				<div class="container">
					<ul id="banner-pager">';
                foreach ($slider_pagination as $slider) {
                    $pagination_no++;
                    $slider_title = substr($slider, 0, 30);
                    if (strlen($slider) > 30) {
                        $slider_title .= "...";
                    }
                    echo '<li>
											<div class="pager-desc">
												<span class="cs-number">' . str_pad($pagination_no, 2, "0", STR_PAD_LEFT) . '</span>
												<span class="cs-desc">' . $slider_title . '</span>
											</div>
										</li>';
                }
                echo '</ul>
				</div>
			</div>';
            }
            cs_cycleslider_script();
        }
        wp_reset_query();
    }
Ejemplo n.º 2
0
     $cs_sidebar_right = $cs_xmlObject->sidebar_layout->cs_sidebar_right;
     if ($cs_layout == "left") {
         $cs_layout = "content-right col-md-9";
     } else {
         if ($cs_layout == "right") {
             $cs_layout = "content-left col-md-9";
         } else {
             $cs_layout = "col-md-12";
         }
     }
 } else {
     $cs_layout = "col-md-12";
 }
 if ($post_xml != "") {
     $cs_xmlObject = new SimpleXMLElement($post_xml);
     $image_url = cs_get_post_img_src($post->ID, $width, $height);
 } else {
     $cs_xmlObject = new stdClass();
     $image_url = '';
     $width = 0;
     $height = 0;
     $image_id = 0;
     $custom_height = 250;
 }
 ?>
 <!--Left Sidebar Starts-->
 <?php 
 if ($cs_layout == 'content-right col-md-9') {
     ?>
     <div class="col-lg-3 col-md-3 col-sm-3"><?php 
     if (!function_exists('dynamic_sidebar') || !dynamic_sidebar($cs_sidebar_left)) {
Ejemplo n.º 3
0
    function widget($args, $instance)
    {
        global $cs_node;
        extract($args, EXTR_SKIP);
        $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
        $select_category = empty($instance['select_category']) ? ' ' : apply_filters('widget_title', $instance['select_category']);
        $showcount = empty($instance['showcount']) ? ' ' : apply_filters('widget_title', $instance['showcount']);
        $thumb = isset($instance['thumb']) ? esc_attr($instance['thumb']) : '';
        if ($instance['showcount'] == "") {
            $instance['showcount'] = '-1';
        }
        echo $before_widget;
        // WIDGET display CODE Start
        if (!empty($title) && $title != ' ') {
            echo $before_title;
            echo $title;
            echo $after_title;
        }
        global $wpdb, $post;
        ?>

				<!-- Recent Posts Start -->

 						<?php 
        wp_reset_query();
        $args = array('posts_per_page' => "{$showcount}", 'post_type' => 'post', 'category_name' => "{$select_category}");
        $custom_query = new WP_Query($args);
        if ($custom_query->have_posts() != "") {
            while ($custom_query->have_posts()) {
                $custom_query->the_post();
                $post_xml = get_post_meta($post->ID, "post", true);
                $cs_xmlObject = new stdClass();
                if ($post_xml != "") {
                    $cs_xmlObject = new SimpleXMLElement($post_xml);
                    $width = 150;
                    $height = 150;
                    $image_url = cs_get_post_img_src($post->ID, $width, $height);
                    if ($image_url == '') {
                        $cs_noimage = 'cs-noimage';
                    } else {
                        $cs_noimage = '';
                    }
                }
                //43
                ?>

									<!-- Upcoming Widget Start -->
									
									<article class="<?php 
                echo $cs_noimage;
                ?>
">

										<?php 
                if ($thumb == "true") {
                    if ($image_url != '') {
                        echo "<figure><img src='" . $image_url . "' alt=''></figure>";
                    }
                }
                ?>
                                        <div class="text">
                                            <h6><a href="<?php 
                the_permalink();
                ?>
"><?php 
                echo substr(get_the_title(), 0, 43);
                if (strlen(get_the_title()) > 43) {
                    echo "...";
                }
                ?>
</a></h6>	
                                            <ul class="post-options">
                                                <li><i class="fa fa-clock-o"></i><?php 
                echo date_i18n(get_option('date_format'), strtotime(get_the_date()));
                ?>
</li>
                                            </ul>
                                        </div>
									</article>                 

								<?php 
            }
            ?>

							<?php 
        } else {
            fnc_no_result_found(false);
        }
        ?>

  				<!-- Recent Posts End -->     

				<?php 
        echo $after_widget;
    }