Modifying jobs list table columns
Job board templating engine was designed to allow easily modify job board layout, most common request is to change columns that are displayed on the default jobs list. This is possible to do but only in job board templates.
Before going any further please read Introduction to templates article, it explains how to properly modify WPJB templates so you can easily upgrade plugin in future.
Two files are responsible for displaying jobs list:
- /wpjobboard/templates/job-board/index.php – contains jobs list table scheme (columns and headers) and alert subscription form, if you will be adding or deleting column you will want to modify this file
- /wpjobboard/templates/job-board/index-item.php – this file is used “inside” index.php template it contains actual table rows, that is information about selected job.
Inside the index-item.php template file you have access to Wpjb_Model_Job object. This object public properties and methods you can use are described in Wpjb_Model_Job class reference article.
Displaying company logo before job title. In the index-item.php find line <td class=”wpjb-column-title”> and after it add
<?php if($job->getLogoUrl()): ?> <img src=<?php esc_attr_e($job->getLogoUrl()) ?> alt="" /> <?php endif; ?>
Displaying job description excerpt (first 250 characters of description without HTML), open index-item.php and in a place where you want to display excerpt add
<?php esc_html_e(substr(strip_tags($job->job_description), 0, 250)) ?>
Displaying salary Custom Field (assuming you earlier added such custom field)
<?php esc_html_e($job->meta->salary->value()) ?>
Displaying first category title and URL (this will work the same for job types just replace “category” with “type”)
<?php esc_html_e($job->getTag()->category->title) ?> <?php esc_html_e(wpjb_link_to("category", $job->getTag()->category)) ?>