<!--<div class="heds-area col-xs-12 col-sm-2 col-lg-2"><?php // _e('Time Due', 'shipme') ?> </div>--> </div> <?php while (have_posts()) { the_post(); ?> <?php shipme_get_regular_job_post('zubs' . $i % 2); $i++; ?> <?php } // if (function_exists('wp_pagenavi')): // echo '<li class="widget-container widget_text "> <div class="my-only-widget-content " >'; // wp_pagenavi(); // echo '</div></li>'; // endif; // // else: // // echo '<li class="widget-container widget_text "> <div class="my-only-widget-content " >'; // echo __('No jobs posted and active on the site yet.', "shipme");
function widget($args, $instance) { extract($args, EXTR_SKIP); $nr = $instance['nr']; $title = $instance['title']; echo $before_widget; ?> <div class="widget-home-latest" > <div class="widget-full-inner-latest"> <?php if ($instance['title']) { echo $before_title . apply_filters('widget_title', $instance['title']) . $after_title; } ?> <?php if (empty($nr) || !is_numeric($nr)) { $nr = 5; } global $wpdb; $querystr = "\n\t\t\t\t\tSELECT distinct wposts.* \n\t\t\t\t\tFROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta\n\t\t\t\t\tWHERE wposts.ID = wpostmeta.post_id\n\t\t\t\t\tAND wpostmeta.meta_key = 'closed' \n\t\t\t\t\tAND wpostmeta.meta_value = '0' AND \n\t\t\t\t\twposts.post_status = 'publish' \n\t\t\t\t\tAND wposts.post_type = 'job_ship' \n\t\t\t\t\tORDER BY wposts.post_date DESC LIMIT " . $nr; $pageposts = $wpdb->get_results($querystr, OBJECT); ?> <?php $i = 0; if ($pageposts) { ?> <?php global $post; ?> <?php foreach ($pageposts as $post) { ?> <?php setup_postdata($post); ?> <?php shipme_get_regular_job_post('zubs1'); ?> <?php } ?> <?php } else { ?> <?php $no_p = 1; ?> <div class="padd100"><p class="center"><?php _e("Sorry, there are no posted jobs yet.", 'shipme'); ?> </p></div> <?php } ?> </div> </div> <?php echo $after_widget; }