Displaying fields
To get or display a job post field inside the loop or in the individual job post page template, we have two simple functions: get_jobpost()
and the_jobpost()
.
get_jobpost('field')
Returns the value of a specific field. Returns false
if value is not found.
Intuitive and powerful, this function can be used to load the value of any field from any location.
Parameters
$field
(string) (Required) The field name.$job_post_id
(Optional) The job post ID. Defaults to the current post.
Examples
Get a value from the current post
This example shows how to load the value of field ‘title’ from the current job post.
By current post we mean either inside of a loop, or inside an individual job post template.
Get a value from a specific post
This example shows how to load the value of field ‘title’ from the job post with ID = 24592.
Check if value exists
This example shows how to check if a value exists for a field.
the_jobpost()
Displays the value of a specific field.
Intuitive and powerful, this function can be used to output the value of any field from any location. Please note that this function is the same as echo get_jobpost()
.
Parameters
$field
(string) (Required) The field name.$job_post_id
(Optional) The job post ID. Defaults to the current post.
Examples
Display a value from the current post
This example shows how to display the value of field ‘title’ from the current job post.
Display a value from a specific post
This example shows how to display the value of field ‘title’ from the job post with ID = 123.
Check if value exists
This example shows how to check if a value exists for a field.
But it is probably better to do something like this:
Last updated