<?php get_header(); ?> <ul class="double-cloumn clearfix"> <li id="left-column"> <ul class="blog-main-post-container clearfix"> <?php if (have_posts()) { while (have_posts()) { the_post(); setup_postdata($post); get_template_part("/functions/fetch-list"); } } else { ocmx_no_posts(); } ?> </ul> <?php motionpic_pagination("clearfix", "pagination clearfix"); ?> </li> <?php get_sidebar(); ?> </ul> <?php get_footer();
/** @see WP_Widget::widget */ function widget($args, $instance) { extract($args); global $woocommerce; $instance_defaults = array('excerpt_length' => 80, 'post_thumb' => 1); $instance_args = wp_parse_args($instance, $instance_defaults); extract($instance_args, EXTR_SKIP); if (isset($instance["title"])) { $title = esc_attr($instance["title"]); } if (isset($instance["title_link"])) { $title_link = esc_attr($instance["title_link"]); } // Setup the post filter if it's defined if (isset($postfilter) && isset($instance[$postfilter])) { $filterval = esc_attr($instance[$postfilter]); } else { $filterval = 0; } // Set the base query args if (isset($postfilter) && $postfilter != "" && $filterval != "0") { $args = array("post_type" => $posttype, "posts_per_page" => $post_count, "tax_query" => array(array("taxonomy" => $postfilter, "field" => "slug", "terms" => $filterval))); } else { $args = array("post_type" => $posttype, "posts_per_page" => $post_count); } $loop = new WP_Query($args); $count = 0; $numposts = 0; ?> <?php if (isset($title)) { ?> <h4 class="widgettitle"> <a href="<?php if (isset($title_link)) { echo $title_link; } ?> "><?php echo $title; ?> </a> </h4> <?php } ?> <ul class="double-cloumn clearfix"> <li id="left-column"> <ul class="blog-main-post-container clearfix"> <?php if ($loop->have_posts()) { while ($loop->have_posts()) { $loop->the_post(); global $post; $args = array('postid' => $post->ID, 'width' => 550, 'height' => 309, 'hide_href' => false, 'exclude_video' => $post_thumb, 'imglink' => false, 'imgnocontainer' => true, 'resizer' => '550x309'); $image = get_obox_media($args); $link = get_permalink($post->ID); ?> <li class="post"> <?php if ($image != "" && $post_thumb != "none") { ?> <div class="post-image fitvid"> <?php echo $image; ?> </div> <?php } ?> <h5 class="date"> <?php if (get_option("ocmx_meta_date") != "false") { echo date_i18n('d F Y', strtotime($post->post_date)); } ?> , <?php _e("written by", "ocmx"); ?> <?php the_author_posts_link(); ?> </h5> <h2 class="post-title"><a href="<?php echo $link; ?> "><?php the_title(); ?> </a></h2> <div class="copy clearfix"> <?php if (isset($show_excerpts) && $show_excerpts != "false") { the_excerpt(); ?> <p><a href="<?php echo $link; ?> " class="action-link"><?php _e("Continue Reading →", "ocmx"); ?> </a></p> <?php } ?> </div> </li> <?php } } else { ocmx_no_posts(); wp_reset_postdata(); } ?> </ul> </li> <?php get_sidebar(); ?> </ul> <?php }