[wpjb_jobs_list]

wpjb-jobs-list

Displays list of jobs (using design similar to the one default jobs list is using), the list of jobs can be modified using multiple parameters.

Available parameters:

  • filter
    Allowed values: active (jobs visible on the job board), expired (jobs that already expired), expiring (jobs that will expire in 5 days), awaiting (jobs that are awaiting approval), new (jobs posted less than 5 days ago), unread (jobs not viewed by admin), inactive (jobs deactivated by admin), all (all jobs)

    Default value is “active”

  • query
    Passing non empty query will return only jobs with matching keyword in title or description

  • category
    Job category ID, will only list jobs from matching category.

    In order to get jobs from multiple categories, you can separate catgory IDs with coma (see second example below).

  • type
    Job type ID, will only list jobs with matching job type
    In order to get jobs from multiple job types, you can separate catgory IDs with coma (see second example below).

  • country
    Country ID, note that only numeric ISO-3166-1 codes are accepted, for example if you wish to display jobs from USA only then valid value will be 840.

  • state
    Allows to search jobs by state (as a country region) (since 4.0.1)
  • location
    Allows to search jobs by country (iso codes and full country name), state, zip code and city

  • is_featured
    Allowed values are -1, 0 and 1,  if is_featured will be set to 1 then only featured jobs will be listed, if is_featured will be set to -1 then only not-featured jobs will be listed. (the default value is 0).

  • employer_id
    Passing employer_id will list only jobs posted by selected employer.

    In order to get jobs from multiple employers, you can separate catgory IDs with coma (see second example below).

  • meta__$key
    Allows to search jobs by cusom fields, for example if you have created custom field named “skills”, you can list jobs with “skills” equal to “PHP” by passing “meta__skills” parameter to the shortcode (see third example below).

  • sort_order
    How jobs should be sorted, the default value is: first by is_featured, next by job_created_at and id.

    Changing sort order requires some PHP knowledge but is not that hard. First you need to find column in wp_wpjb_job table by which you want to sort jobs, lets say it will be descending by expiration date (column job_expires_at), then as a sort value pass “t1.job_expires_at DESC” if you would like sort jobs ascending replace DESC with ASC (see 4th example below)

  • pagination
    Show pagination on site, default value is 1, note that the pagination if enabled will show only if there is more than one page of results.
  • page
    The page number to show, default value is 1, while possible, it is not recommended to change the default value, as this will break pagination

  • count
    Number of jobs per page, the default value is 20, if you change it to 0 then all jobs will be listed on single page.

  • id__not_in
    List of job IDs to exclude from search (since 4.0.1)

  • search_bar
    String either: disabled, enabled or enabled-live. Default value disabled (since 4.1.2)

  • page_id
    (int) ID of a Page to which this shortcode will link to when for example doing a search, by default the value is current page ID (since 4.3.4)

  • redirect_to 
    (string) (default null) you can pass either page ID or an URL starting with http://, when searching user will be redirected to this page / URL, ideally, the page to which user is redirected to should also have [wpjb_jobs_list] shortcode. (since 5.2.0)

  • show_results
    (int) (default 1) change value to 0 if you only wish to show the search form (since 5.2.0)

 

Usage examples:

Find inactive jobs matching keyword “php developer”.

[wpjb_jobs_list filter="inactive" query="php developer"]

Displaying jobs posted in category 1 or 3 (or both).

[wpjb_jobs_list category="1,3"]

Searching for jobs that have Custom Field “skills” with value equal to “PHP”

[wpjb_jobs_list meta__skills="PHP"]

Sort jobs by expiration date and ID

[wpjb_jobs_list sort_order="t1.job_expires_at DESC, t1.id DESC"]

Display search bar only

[wpjb_jobs_list show_results="0"]

CSS Customization

/* Remove logo column */
.wpjb-job-list .wpjb-grid-col.wpjb-col-logo {
 display: none;
}
/* Changed featured row background */
body .wpjb .wpjb-featured {
 background-color: lightgreen;
}

/* Remove name the company */
.wpjb-col-title .wpjb-sub.wpjb-sub-small {
    display: none
}

/* Remove banner "NEW" */
span.wpjb-bulb {
    display: none !important;
}

/*Change text color */
wpjb-job-list .wpjb-col-title a {
    color: red !important;
}

/*Remove name the company and change the color of the name work*/
.wpjb-job-list .wpjb-sub-small {
    display: none !important;
}

/*Remove time work*/
.wpjb-col-location .wpjb-sub.wpjb-sub-small {
    display: none;
}

All the changes from above you can put in your theme CSS file.

  1. what is the shortcode to sort by recent jobs 1st, no matter featured or not.

    thank you

    • Greg
      Reply

      Following shortcode will do this
      [wpjb_jobs_list sort_order=”t1.job_created_at DESC”]

      • Ferdinand
        Reply

        Hi Greg, I tried this code but it didn’t work. Any idea?

        • Pete
          Reply

          Change the ALL capital “DESC” to lowercase “desc” and it will work.

  2. Mateusz
    Reply

    What if I want to list all jobs outside specific country?
    And why there’s no pagination in the results?

    • Greg
      Reply

      Excluding (countries and other params except IDs) is not possible with this shortcode i am afraid. The pagination will be shown only if there is more than one page of results.

    • how to limit the jobs into specific numbers to be posted?

      • Greg
        Reply

        Not sure what do you mean by “specific numbers to be posted”?

    • Greg
      Reply

      This seems to be an issue with coping and pasting the shortcode. Please go to wp-admin / Pages panel and click Edit link next to your “Landing Page”, now in the editor click “Text” tab and look for the [wpjb_jobs_list] shortcode

      Most likely it is inside <pre> or <code> tag, if it is then remove those tags (</pre> and </code> as well) and save the page, it should be ok now.

      • yaoming
        Reply

        thanks for the update, your suggestion fix the problem 🙂

  3. Anton
    Reply

    Is it possible to show only the available categories on a single page? Like one see in the sidebar?

  4. Where do I go to change the [wpjb_jobs_list] number of jobs to 25?

    • Greg
      Reply

      For shortcodes you only change params
      [wpjb_jobs_list count=”25″]

  5. Tejas Paliwal
    Reply

    Hi,
    can I explore the jobs by specific Date? My client want to list according to the specific date.

  6. Greg
    Reply

    Is it possible to sort by a custom field with the shortcode? Or another route?

  7. How to list or search jobs with a specific company category(by business type)?

    • This is not really possible i am afraid, you can list jobs either by job category (using “category” param) or by Employer (using “employer_id”) param.

  8. James
    Reply

    Hi Greg

    I’d like to create pages in my site that show jobs just in that location.

    For example London, Manchester etc

    Is there a short code for that please?

    Thanks

  9. Greg
    Reply

    Hi, you can use wpjb_jobs_list shortcode with location param for this
    [wpjb_jobs_list location=”London”]

    • James
      Reply

      Hi Greg

      Thanks

      I’ve tried that but it doesn’t show any jobs and just says ”
      No job listings found.”

      • Greg
        Reply

        I would need you to send me link to this page and exact shortcode you are using (ideally via email).

        • James
          Reply

          Hi Greg

          Just sent you an email, ignore it I’m an idiot lol.

          All sorted now. Thanks for the excellent customer service as always.

  10. Is there a variable for random sort each time page is reloaded?

    • Greg
      Reply

      Try using this shortcode with param sort_order=”RAND()” this should always display jobs in random order.

      • I just tried it and the page comes up blank with only the filter box.

  11. I got it it looks like this: [wpjb_jobs_list sort_order=’rand()’] works great!!! thanks!

  12. Leon
    Reply

    How can i display the salary for each job?

    If you could please tell me which template file to edit and template tag to add, I can take it from there.

    Many thanks!

  13. Hi Greg
    Is it possible to output the SQL statement that would give me Featured Jobs please? I have tried this but seem to get duplicates when joining jobs, tag and tagged in my query.
    Thanks, Dan

  14. Can you show results with more than 1 country id using a comma to separate?

    • Greg
      Reply

      I am afraid right now you can select all countries or just one.

  15. Darlington
    Reply

    Is there a shortcode for the job list to display feature jobs first?

    • Greg
      Reply

      Actually, the [wpjb_jobs_list] by default displays featured jobs first and “normal” jobs below.

  16. What shortcode should be used to show the jobs that were posted in the past 7 days?

    • Greg
      Reply

      Currently, i am afraid the [wpjb_jobs_list] shortcode does not allow filtering jobs by date like that.

  17. hi Greg, how can I display the search bar only?

    • Greg
      Reply

      Hi, if you are using WPJB 5.2 or newer then you can do that by using [wpjb_jobs_list] with “redirect_to” and “show_results” params like this


      [wpjb_jobs_list redirect_to="https://example.com/jobs-list/" show_results="0"]

      where https://example.com/jobs-list/ is an actual URL of other page on your site with [wpjb_jobs_list] or [wpjb_jobs_search] shortcode (which can display results).

  18. Is there a way to only display the State in the job list? I do not want people seeing the city.

    Thanks
    Dylan

    • Marek
      Reply

      Hi, if you want to make this change, you can use this code snippet:

      add_filter( ‘wpjb_location_display’, ‘my_wpjb_location_display’, 10, 2 );
      function my_wpjb_location_display( $string, $object ) {

      if( $object instanceof Wpjb_Model_Job && is_page( Wpjb_Project::getInstance()->getConfig(“urls_link_job”) ) ) {
      $string = $object->job_state;
      }

      return $string;
      }

      This is a code snippet, and if you are not sure how to use it, you can take a look on our documentation page, where we provided 3 possibilities on how to work with code snippets:
      https://wpjobboard.net/kb/how-to-work-with-code-snippets/

      • This snippet doesn’t appear to be working, I implemented it using the code snippets plugin.

        I was wondering if there was a way to make it so that the “City” field was not required. I would prefer only the state to be shown.

        • Greg
          Reply

          Note the location will be changed only on the page with [wpjb_jobs_list] shortcode set in wp-admin / Settings (WPJB) / Default Pages and URLs panel.

          You can make the City field optional using the Custom Fields drag and drop editor in wp-admin / Settings (WPJB) / Custom Fields panel.

          If you also want to format the location differently in the frontend then you can do that using Locations API https://wpjobboard.net/kb/locations-api/

  19. Is there a way to have a selected category sort latest to oldest within job category widget?

    • Greg
      Reply

      Hi,
      i am afraid not (at least not without modifying original source code) as there isn’t any filter to customize the executed query.

Leave a Reply

Your email address will not be published. Required fields are marked *