Guest User

Untitled

a guest
Jan 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. // Display jobs after career page
  2. function ragm_display_jobs() {
  3. if (is_page('careers')) { ?>
  4. <h2 class="page-title" id="current-openings">Current Openings</h2>
  5. <?php
  6. // Reset Post Data
  7. wp_reset_postdata();
  8.  
  9. // The Query
  10. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  11. $args = array (
  12. 'post_type' =>'job',
  13. 'status' => 'published',
  14. 'posts_per_page' => 2,
  15. 'paged' => $paged,
  16. 'meta_query' => array(
  17. array (
  18. 'key' => '_RAGM_Job_Expires',
  19. 'value' => date('y-m-d'),
  20. 'compare' => '>=',
  21. 'type' => 'DATE'
  22. )
  23. )
  24. );
  25. $posts = new WP_Query($args);
  26.  
  27. // The Loop
  28. while ( $posts->have_posts() ) : $posts->the_post();
  29. $id = get_the_id();
  30. $jobtype = get_the_term_list($id, 'position', '', ', ', '');
  31. $jobDescription = get_post_meta($id, '_RAGM_Job_Position_Description',true);
  32. $joblocation = get_the_term_list($id, 'location', '', ', ', '');
  33. $jobExpires = get_post_meta($id,'_RAGM_Job_Expires',true);
  34.  
  35. ?>
  36. <div id="post-<?php echo $id; ?>" class="hentry post job-post">
  37. <h2 class="entry-title job-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  38. <div class="entry-meta job-meta"><span class="jobType"><?php echo $jobtype; ?></span> Position posted on <?php the_time('m/d/y'); ?>. Position located in <span class="jobLocation"><?php echo $joblocation; ?></span></div>
  39. <div class="entry-content job-content">
  40. <p class="jobDescription"><?php echo $jobDescription; ?></p>
  41. </div></div>
  42.  
  43. <?php endwhile; ?>
  44. <div class="nav-below navigation clearfix"> <div class="nav-previous">Previous: <?php next_posts_link( 'Newer Jobs',0 ) ?></div><div class="nav-next">Next:<?php previous_posts_link( 'Older Jobs',0 ) ?></div></div>
  45.  
  46. <?php // Reset Post Data
  47. wp_reset_postdata();
  48.  
  49. }
  50. }
  51. add_action('headway_page_content_close','ragm_display_jobs');
  52.  
  53. ?>
Add Comment
Please, Sign In to add comment