Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Display jobs after career page
- function ragm_display_jobs() {
- if (is_page('careers')) { ?>
- <h2 class="page-title" id="current-openings">Current Openings</h2>
- <?php
- // Reset Post Data
- wp_reset_postdata();
- // The Query
- $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- $args = array (
- 'post_type' =>'job',
- 'status' => 'published',
- 'posts_per_page' => 2,
- 'paged' => $paged,
- 'meta_query' => array(
- array (
- 'key' => '_RAGM_Job_Expires',
- 'value' => date('y-m-d'),
- 'compare' => '>=',
- 'type' => 'DATE'
- )
- )
- );
- $posts = new WP_Query($args);
- // The Loop
- while ( $posts->have_posts() ) : $posts->the_post();
- $id = get_the_id();
- $jobtype = get_the_term_list($id, 'position', '', ', ', '');
- $jobDescription = get_post_meta($id, '_RAGM_Job_Position_Description',true);
- $joblocation = get_the_term_list($id, 'location', '', ', ', '');
- $jobExpires = get_post_meta($id,'_RAGM_Job_Expires',true);
- ?>
- <div id="post-<?php echo $id; ?>" class="hentry post job-post">
- <h2 class="entry-title job-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
- <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>
- <div class="entry-content job-content">
- <p class="jobDescription"><?php echo $jobDescription; ?></p>
- </div></div>
- <?php endwhile; ?>
- <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>
- <?php // Reset Post Data
- wp_reset_postdata();
- }
- }
- add_action('headway_page_content_close','ragm_display_jobs');
- ?>
Add Comment
Please, Sign In to add comment