• Hi, is there a filter or a setting so that I can create the XML field only of jobs in a specific category or custom taxonomy? Basically, when a user is posting a new job on my site, I want to ask them “Would you like this posting to also be distributed through Jooble?” And if they say yes then it would add the Jooble category, which would add it to the XML feed. Some employers do want distribution through Jooble, but others have communicated that they do not want it, so I’m looking for a solution to make this distribution optional.

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Author nickpagz

    (@npagazani)

    Hey @pnem,

    At the moment there’s no option for this kind of filtering within the plugin itself. Having said that, you may be able to use existing core hooks to modify the feed output. Note, I haven’t tested this code myself, but something like this in a snippets plugin, or in your child theme’s functions.php file should work for the category option you mentioned:

    function limit_rss_feed_to_category($query) {
      if ($query->is_feed && $query->is_main_query()) {
        $query->set('post_type', 'job_listing');
        $query->set('tax_query', array(
            array (
                'taxonomy' => 'job_listing_category',
                'field' => 'slug',
                'terms' => 'my-category-slug',
            )
        ));
      }
      return $query;
    }
    add_filter('pre_get_posts', 'limit_rss_feed_to_category');

    Don’t forget to change the my-category-slug to whatever your jooble specific category slug is – if you’ve set it as a job listing category. If you’ve added a custom field or custom taxonomy then you’ll need to adjust the query accordingly.

    Let me know if that works or not. I can dig into it a bit deeper if needed, depending on how you implement the option to capture the consent to share on jooble.

Viewing 1 replies (of 1 total)
  • The topic ‘Only add jobs in a specific category’ is closed to new replies.