Forum Replies Created

Viewing 1 replies (of 1 total)
  • hi,I want to show 10 jobs for each category separately at Homepage.
    I used the following commands:
    <div id=”box1″>
    <?php
    $rokesh_query = new WP_Query(array(‘post_status’ =>’publish’,’post_type’ =>’job_listing’,’order’ =>’descending’,’orderby’ =>’ID’,’category’ =>’22’,’posts_per_page’ =>’10’,’offset’ =>’2′,’paged’ => (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1));
    ?>
    <?php if($rokesh_query->have_posts()) :
    while($rokesh_query->have_posts()) : $rokesh_query->the_post();?>
    <div class=”emp-item-right”>
    <span>“>
    <?php the_title(); ?>

    </span>
    </div>
    <div class=”emp-item-left”>
    <div class=”empdate”>
    <i class=”fa-empdate”></i>
    <span> <?php the_time(‘y-m-d’) ?></span>
    </div>
    <div class=”empstate”>
    <i class=”fa-emploc”></i>
    <span><?php the_job_location( false ); ?></span>
    </div>
    </div>
    <?php endwhile;endif;?>
    <?php wp_reset_query(); ?>
    </div>
    I’ve used the above code on the page, but all posts are displayed while I want to show just post related to a particular class is displayed.
    If possible, and if possible, and if the code is wrong, modify it
    thanks

Viewing 1 replies (of 1 total)