• Resolved sbrakni

    (@sbrakni)


    Hello,

    I have a website where WP Job Manager is installed to show job offers, recently we wanted to sync our job board on WordPress with our Jobaffinity which is a service that publishes job offers on different websites for you.

    For this to happen, we created a user in our wordpress for Jobaffinity that can publish articles.

    What we need to do is create a template that loops on Articles and selects only the ones posted by Jobaffinity to show them on WP Job Manager, problem is that we don’t know what post_type to put in our code, and if in the end WP Job Manager posts are considered as article or not?

    Here is the code we put in our template:

    <?php
    /*
     * Template Name: Jobaffinity Job Listings
     */
    
    get_header();
    
    // Remplacez '293' par l'ID réel de l'utilisateur Jobaffinity, si nécessaire.
    $author_id = '293';
    
    // Préparez la requête pour les offres d'emploi
    $args = array(
        'post_type' => 'job_application', // Spécifiez le type de publication personnalisé de WP Job Manager
        'author' => $author_id,       // Filtre par ID d'auteur, si nécessaire
        'posts_per_page' => -1        // -1 pour afficher tous les posts. Ajustez selon le besoin.
    );
    
    $job_query = new WP_Query($args);
    
    if ($job_query->have_posts()) : 
        while ($job_query->have_posts()) : $job_query->the_post();
            // Affichez ici le contenu de chaque offre d'emploi
            // Par exemple, le titre et un lien vers l'offre complète
            echo '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
            the_excerpt(); // Affiche un extrait de l'offre d'emploi
        endwhile;
    else :
        echo '<p>Aucune offre d\'emploi trouvée.</p>';
    endif;
    
    // Réinitialiser les données de la requête
    wp_reset_postdata();
    
    get_footer();
    ?>
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Peter Kiss (a11n)

    (@yscik8)

    Hi there!

    Jobs have the job_listing post type, and yes, they are stored as posts and can be queried with WP_Query or get_posts. Here is the source for the class setting up the post type.

    Thread Starter sbrakni

    (@sbrakni)

    Hello Peter,

    Thank you for your response, in fact my problem is that the Jobaffinity posts (the multi-publication platform for job offers) go to the articles of my WordPress, I do not know how to make WP Job Manager read the articles or import these articles on the plugin, as it seems like Articles are separate from what WP job manager can display.

    I would be very grateful if you can help me on this one, best regards.

    Plugin Support Joash

    (@joashrajin)

    Hi there!

    As per our?Support Policy, I am afraid that assistance with this kind of issue falls outside our support’s scope. We won’t be in a position to provide further help with any modifications or guidance on this, but you can consider hiring a developer to assist you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem to filter articles’ is closed to new replies.