From 9a93d0e84f00458a8dbc1f03d2a2ab5622b8a3b5 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 19 Dec 2014 08:25:44 -0500 Subject: [PATCH] Add end class to last item in list display of the jobs --- controllers/front.php | 7 +++++++ views/front/jobList.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/controllers/front.php b/controllers/front.php index 15d4068..5f023f3 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -478,9 +478,12 @@ class glm_employment_front } } $jobs = get_posts($args); + $totalJobs = count($jobs); $current_url = add_query_arg($wp->query_string, '', home_url($wp->request)); + $iterator = 1; foreach ($jobs as $job) { $custom = get_post_custom($job->ID); + $job->end = false; $job->glm_jobs_startdate = $custom['glm_jobs_startdate'][0]; $job->glm_jobs_enddate = $custom['glm_jobs_enddate'][0]; $job->glm_jobs_contact = $custom['glm_jobs_contact'][0]; @@ -493,6 +496,10 @@ class glm_employment_front $job->href = $current_url . ((strpos($current_url, '?')) ? '&' : '?') . "job=" . $job->ID; + if ($iterator == $totalJobs) { + $job->end = true; + } + ++$iterator; } include $this->frontViewDir . '/jobList.php'; return; diff --git a/views/front/jobList.php b/views/front/jobList.php index 71db430..1cd1cc4 100644 --- a/views/front/jobList.php +++ b/views/front/jobList.php @@ -2,7 +2,7 @@

List Jobs

-
+

post_title;?>

Status: glm_jobs_status;?>
Full Job Description
-- 2.17.1