PluginProbe
JobWP – Job Board Plugin for WordPress | Job Listings, Career Page & Applications / 1.3
JobWP – Job Board Plugin for WordPress | Job Listings, Career Page & Applications v1.3
2.5.0 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 All 33 releases
jobwp / front / view / listing.php

listing.php in JobWP – Job Board Plugin for WordPress | Job Listings, Career Page & Applications 1.3, at front/view/listing.php

99 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 global $post;
7
8 $jobwpListingContent = $this->jobwp_get_listing_content_settings();
9 //print_r( $jobwpListingContent );
10 foreach ( $jobwpListingContent as $option_name => $option_value ) {
11 if ( isset( $jobwpListingContent[$option_name] ) ) {
12 ${"" . $option_name} = $option_value;
13 }
14 }
15
16 $jobwpListingStyles = $this->jobwp_get_listing_styles_settings();
17 foreach ( $jobwpListingStyles as $option_name => $option_value ) {
18 if ( isset( $jobwpListingStyles[$option_name] ) ) {
19 ${"" . $option_name} = $option_value;
20 }
21 }
22
23 // Main Query Arguments
24 $jobwpQueryArrParams = array(
25 'post_type' => 'jobs',
26 'post_status' => 'publish',
27 'orderby' => 'date',
28 'order' => 'DESC',
29 'meta_query' => array(
30 array(
31 'key' => 'jobwp_status',
32 'value' => 'active',
33 'compare' => '='
34 ),
35 ),
36 );
37
38 // Load Styling
39 include JOBWP_PATH . 'assets/css/listing.php';
40 // Load Search Panel
41 include JOBWP_PATH . 'front/view/search.php';
42
43 $jobwpQueryArr = apply_filters( 'jobwp_front_main_query_array', $jobwpQueryArrParams );
44
45 $jobwpJobs = new WP_Query( $jobwpQueryArr );
46 ?>
47 <div class="jobwp-listing-body-container">
48 <?php
49 if ( $jobwpJobs->have_posts() ) {
50
51 while ( $jobwpJobs->have_posts() ) {
52
53 $jobwpJobs->the_post();
54
55 $jobwp_experience = get_post_meta( $post->ID, 'jobwp_experience', true );
56 $jobwp_deadline = get_post_meta( $post->ID, 'jobwp_deadline', true );
57 $jobwpDateDiff = date_diff( date_create( date('Y-m-d') ), date_create( $jobwp_deadline ) );
58 $jobwpDateDiffNumber = $jobwpDateDiff->format("%R%a");
59
60 if ( $jobwpDateDiffNumber > -1 ) {
61 $jobwpDeadline = date( 'd M, Y', strtotime( $jobwp_deadline ) );
62 } else {
63 $jobwpDeadline = __( 'Closed', JOBWP_TXT_DOMAIN );
64 }
65 ?>
66 <div class="jobwp-item">
67 <h3 class="jobwp-job-title"><a href="<?php the_permalink(); ?>" class="jobwp-job-title-a"><?php the_title(); ?></a></h3>
68 <?php
69 if ( ! $jobwp_list_display_overview ) {
70 ?>
71 <p class="jobwp-overview-excerpt">
72 <?php echo wp_trim_words( get_the_content(), esc_html( $jobwp_list_overview_length ), '...' ); ?>
73 </p>
74 <?php
75 }
76 ?>
77 <div class="jobwp-bottom">
78 <p class="jobwp-list-bottom-item pull-left">
79 <i class="fa fa-briefcase" aria-hidden="true"></i>
80 <strong class="primary-color"><?php esc_html_e( $jobwp_list_exp_lbl_txt ); ?>:</strong> <span class="ng-binding"><?php esc_html_e( $jobwp_experience ); ?> <?php _e('Years', JOBWP_TXT_DOMAIN); ?></span></p>
81 <p class="jobwp-list-bottom-item pull-right">
82 <i class="fa fa-calendar-o" aria-hidden="true"></i>
83 <strong class="primary-color"><?php esc_html_e( $jobwp_list_deadline_lbl_txt ); ?>:</strong> <span class="ng-binding"><?php esc_html_e( $jobwpDeadline ); ?></span></p>
84 </div>
85 <div class="clear"></div>
86 </div>
87 <?php
88 }
89 }
90 else {
91 ?>
92 <p class="jobwp-no-jobs-found"><?php _e('No Jobs found', JOBWP_TXT_DOMAIN); ?></p>
93 <?php
94 }
95
96 // Reset Post Data
97 wp_reset_postdata();
98 ?>
99 </div>