'', ), $atts); extract($a); $swiftstaff_paged = (get_query_var('paged') ) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'swift_jobs', 'post_status' => 'publish', 'posts_per_page' => 10, 'paged' => $swiftstaff_paged, 'orderby' => 'date', 'order' => 'DESC' ); $cat_array = !empty($category) ? explode(",", $category) : ''; if ($cat_array) { $args['tax_query'] = array(array('taxonomy' => 'swift_jobs_category', 'field' => 'slug', 'terms' => $cat_array)); } $swift_staff_jobs_list = new WP_Query($args); $hiringOrg = get_bloginfo('name'); $op .= '
'; if ($swift_staff_jobs_list->have_posts()): while ($swift_staff_jobs_list->have_posts()) : $swift_staff_jobs_list->the_post(); $swift_job_location = get_the_term_list(get_the_ID(), 'swiftstaff_location_tag', '', ', ', ''); $swift_job_location = strip_tags($swift_job_location); $op .= '
' . get_the_term_list(get_the_ID(), 'swift_jobs_tag', '
  • ', '
  • ', '
') . '
' . get_the_date('Y-m-d') . '
'. $hiringOrg .'
TELECOMMUTE
' . $swift_job_location .'
'; endwhile; else : $op .= '

No jobs found....yet

'; endif; $op .= '
'; wp_reset_postdata(); return $op; } } /** * Shortcode : [swift_staff_list] * - Display list of swift staff. */ add_shortcode('swift_staff_list', 'swift_staff_list_callback'); if (!function_exists('swift_staff_list_callback')) { function swift_staff_list_callback($atts) { $op = ''; $a = shortcode_atts(array(), $atts); extract($a); $swiftstaff_paged = (get_query_var('paged') ) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'swift_staffs', 'post_status' => 'publish', 'posts_per_page' => 10, 'paged' => $swiftstaff_paged, 'orderby' => 'date', 'order' => 'ASC' ); $swift_staff_list = new WP_Query($args); $op .= '
'; if ($swift_staff_list->have_posts()): while ($swift_staff_list->have_posts()) : $swift_staff_list->the_post(); $op .= '
'; if (has_post_thumbnail()) { $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium'); $op .= '
'; } $op .= '
'; $op .= ' '; if (get_post_meta(get_the_ID(), 'swift_staff_job_title', true)) { $op .= ''; } $op .= '
'; endwhile; else : $op .= '

No staff list found.

'; endif; $op .= '
'; wp_reset_postdata(); return $op; } }