Support » Plugin: Jobs for WordPress » Changing single-job template

  • Hi,
    I’m trying to give the single job page a new layout according to the design I received. I want to change some titles (in general, not every time I add a new position) or use a different layout for the page. I copied the template-file to my theme and I can see my changes, but I can’t figure out how I can call every field separate instead of using the standard code (<?php if( function_exists(‘get_job_fields’) ) get_job_fields(); ?>)

    Is there a way to only get one particular field at a time?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Robbert89

    (@robbert89)

    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 1 year ago by Robbert89.
    Robbert89

    (@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 Interactive

    (@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).

    Robbert89

    (@robbert89)

    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"}

    Robbert89

    (@robbert89)

    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 1 year ago by Robbert89.
    • This reply was modified 1 year ago by Robbert89.
    • This reply was modified 1 year ago by Robbert89.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Changing single-job template’ is closed to new replies.