Optional:
In your (child)theme’s folder, make a folder “jobs”.
Inside that folder, copy the single-jobs.php from the plugin.
Wordpress will then use the single-jobs.php from there and you can safely edit this file.
Then inside the single-jobs.php you have several options depending on your needs:
option 1 get single field via post_meta:
<?php echo get_post_meta( get_the_ID(), 'position_title', true );?>
option 2 get single field via post custom:
<?php if( function_exists('get_job_fields') ) {
$title = get_post_custom_values($key = 'position_title');
echo $title[0];
}
?>
option 3: get all fields via post custom
$custom = get_post_custom();
foreach($custom as $key => $value) {
echo $key.': '.$value.'<br />';
}
-
This reply was modified 3 years, 10 months ago by
Robbert89.
Ah, seems that the schema’s are not submitted this way…
So, still no solution to this problem i guess.
Will dive deeper into this as i am encountering the same problem 🙁
Plugin Author
BlueGlass
(@blueglassinteractive)
Hi @thessav
Hi @robbert89
basically all as @robbert89 said, but to output schema add <?php echo JobSingleView::printSchema(); ?>
at the end of your code (but before footer of the site).
Ahh thats great, but i think i miss something.
When i use <?php echo JobSingleView::printSchema(); ?>
The script tag outputs just: {"@context":"http:\/\/schema.org","@type":"JobPosting"}
Ahh, in class-job-single.php there is this comment (line 856):
// This must be at the end,
as we combine it with 2 functions above
echo JobSingleView::printSchema();
So if i combine those three functions in my templates single-jobs.php like this:
JobSingleView::get_job_fields( 'sort-left', $post->ID );
JobSingleView::get_job_fields( 'sort-right', $post->ID );
echo JobSingleView::printSchema();
I can print the schema and all json is printed in the script tag.
-
This reply was modified 3 years, 10 months ago by
Robbert89.
-
This reply was modified 3 years, 10 months ago by
Robbert89.
-
This reply was modified 3 years, 10 months ago by
Robbert89.