• Resolved mahdikashani

    (@mahdikashani)


    Dear support,

    I hope that you’re doing well.
    I want to customize the jobs page and show respective job category(s) instead of published date for each job listings on Jobs page (where you can see all job offers). Is there any code that I can replace with <?php the_job_publish_date(); ?> to show the job category?

    I’m looking forward to hearing from you
    Thanks in advance

Viewing 7 replies - 1 through 7 (of 7 total)
  • @mahdikashani
    you can do this via inserting this lines of code into the content-job_listing.php template
    <li class="job-category <?php echo get_the_job_category() ? sanitize_title( get_the_job_category()->slug ) : ''; ?>"><?php the_job_category(); ?></li>

    then upload the template to this directory on your server to keep this upgrade save
    your_childtheme/job_manager/content-job_listing.php

    Thread Starter mahdikashani

    (@mahdikashani)

    Thanks for your reply @braehler .

    I tried that but unfortunately it didn’t work.

    @mahdikashani
    then just try this, maybe my snippet is way to close to our theme
    <?php the_job_category(); ?>

    Thread Starter mahdikashani

    (@mahdikashani)

    Thanks again @braehler , but apparently it’s an undefined function, as I get this error: PHP Fatal error: Uncaught Error: Call to undefined function the_job_category()
    Didn’t you define this function somewhere on your own?

    @mahdikashani
    hey, no I dod not, but I′m using this litte plugin here, to show different colors on each category and it works out
    https://github.com/tripflex/wp-job-manager-cat-colors
    And did you enable the categories in the settigns?

    • This reply was modified 4 years, 3 months ago by braehler.
    Thread Starter mahdikashani

    (@mahdikashani)

    @braehler
    Hey, I have installed the plugin you told. But still it doesn’t work ??

    [14-Dec-2020 09:37:10 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function get_the_job_category() in /home/jobestoo/public_html/wp-content/themes/jobestoon/job_manager/content-job_listing.php:40
    Stack trace:
    #0 /home/jobestoo/public_html/wp-includes/template.php(732): require()
    #1 /home/jobestoo/public_html/wp-content/plugins/wp-job-manager/wp-job-manager-template.php(88): load_template('/home/jobestoo/...', false)
    #2 /home/jobestoo/public_html/wp-content/plugins/wp-job-manager/includes/class-wp-job-manager-ajax.php(260): get_job_manager_template_part('content', 'job_listing')
    #3 /home/jobestoo/public_html/wp-includes/class-wp-hook.php(287): WP_Job_Manager_Ajax->get_listings('')
    #4 /home/jobestoo/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
    #5 /home/jobestoo/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #6 /home/jobestoo/public_html/wp-content/plugins/wp-job-manager/includes/class-wp-job-manager-ajax.php(114): do_action('job_manager_aja...')
    #7 /home/jobestoo/public_html/wp-includes/ in /home/jobestoo/public_html/wp-content/themes/jobestoon/job_manager/content-job_listing.php on line 40

    And yes, the categories in the settigns is enabled.

    • This reply was modified 4 years, 2 months ago by mahdikashani.
    Plugin Support bindlegirl (a11n)

    (@bindlegirl)

    I’m marking this as resolved since it’s been over 2 weeks with no response. If you still need help with this, please feel free to mark it ‘not resolved’ again.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Showing job category on jobs page’ is closed to new replies.