Changeset 8950 for sites/trunk/jobs.wordpress.net/public_html/wp-content/themes/jobswp/content-home.php
- Timestamp:
- 06/13/2019 10:31:41 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/jobs.wordpress.net/public_html/wp-content/themes/jobswp/content-home.php
r88 r8950 6 6 if ( $job_categories ) : 7 7 8 // Groups jobs according to job category. 9 foreach ( $job_categories as $i => $category ) { 10 $job_category_jobs[ $category->slug ] = Jobs_Dot_WP::get_jobs_for_category( $category ); 11 $latest_post = $job_category_jobs[ $category->slug ][0]; 12 // Add key for sorting. 13 $job_categories[ $i ]->latest_post_date = $latest_post ? $latest_post->post_date : '0'; 14 } 15 16 // Sort job categories according to recency of latest post. 17 $job_categories = wp_list_sort( $job_categories, [ 'latest_post_date' => 'DESC', 'name' => 'ASC' ] ); 18 19 // Display the categories and their jobs. 8 20 foreach ( $job_categories as $category ) { 9 $posts = Jobs_Dot_WP::get_jobs_for_category( $category );21 $posts = $job_category_jobs[ $category->slug ]; 10 22 11 23 //Display the name of the category, whether there are jobs or not
Note: See TracChangeset
for help on using the changeset viewer.