New Landing How can we help? Themeforest Theme Support Dante Get categories for current job PHP

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Dante
  • #93106
    simpology
    Member
    Post count: 8

    Hello, i think the title says it all, i’m trying to get the category of the current job can you help pls.

            $queryArgs = array(
                'post_type' => 'jobs',
                'post_status' => 'publish',
            );
            global $post;
            $jobs =  new WP_Query($queryArgs);
            while($jobs->have_posts()){
                $jobs->the_post();
                //how do i get the category of the current job
            }

    Thank you

    #93239
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    I guess something like the code bellow will return you all the assigned job categories of that job.

    
    $jobs_category =  get_the_terms($jobs->ID, 'jobs-category');
    

    – Rui

    #93249
    simpology
    Member
    Post count: 8

    Thank you very much.

    #93286
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Thanks Rui

    – Kyle

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register