Title: Multiple loop in jobs shortcode
Last modified: August 31, 2016

---

# Multiple loop in jobs shortcode

 *  Resolved [simonkro](https://wordpress.org/support/users/simonkro/)
 * (@simonkro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/)
 * Hi,
 * I would like to modify the shortcode [jobs] and add multiple loops. I figured
   out that this has to be done by overwriting the function “output_jobs( $atts )”
   in “class-wp-job-manager-shortcodes”.
 * But when I modify this part of the function, nothing happens:
 *     ```
       if ( $jobs->have_posts() ) : ?>
   
       				<?php get_job_manager_template( 'job-listings-start.php' ); ?>
   
       				<?php while ( $jobs->have_posts() ) : $jobs->the_post(); ?>
       					<?php get_job_manager_template_part( 'content', 'job_listing' ); ?>
       				<?php endwhile; ?>
   
       				<?php get_job_manager_template( 'job-listings-end.php' ); ?>
       ```
   
 * Can you please give me a hint how I can modify the code to add multiple loops?
 * Thanks,
    Simon
 * [https://wordpress.org/plugins/wp-job-manager/](https://wordpress.org/plugins/wp-job-manager/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Contributor [Adam Heckler](https://wordpress.org/support/users/adamkheckler/)
 * (@adamkheckler)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053564)
 * Sorry, but we aren’t able to help with custom code requests like this. You may
   want to look into one of these services:
 * [http://jobs.wordpress.net/](http://jobs.wordpress.net/)
 * [http://studio.envato.com/](http://studio.envato.com/)
 * [https://codeable.io/](https://codeable.io/)
 * Thanks!
 *  Thread Starter [simonkro](https://wordpress.org/support/users/simonkro/)
 * (@simonkro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053597)
 * I understand that you don’t provide help with custom code. But can you please
   give me a hint where to start? Point me some direction…
 *  Plugin Contributor [Adam Heckler](https://wordpress.org/support/users/adamkheckler/)
 * (@adamkheckler)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053618)
 * I really don’t know. 🙁 I’m not a PHP developer myself.
 * Sorry I can’t be of more help here!
 *  Thread Starter [simonkro](https://wordpress.org/support/users/simonkro/)
 * (@simonkro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053681)
 * Mmh, how’s about your colleague, Mike Jolley? Can he give me a hint?
 *  Plugin Author [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053682)
 * I could if I actually understood what you’re attempting but I don’t. More loops?
   A loop needs a query first. And why would you need multiple loops anyway? Why
   not have multiple shortcodes?
 *  Thread Starter [simonkro](https://wordpress.org/support/users/simonkro/)
 * (@simonkro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053706)
 * I want to separate featured jobs and not featured jobs on the same page. Featured
   posts should be displayed first and then not featured jobs in a new row.
 * If I do this by multiple shortcodes, I can’t filter both types of jobs with the
   same filter, because filters only filter the jobs which belong to their shortcode.
   Second problem, if there are no featured jobs, a message shows up “No jobs available”.
   But below it shows not featured jobs. Looks strange for visitors.
 * That’s why I need two loops in the same shortcode. One for featured jobs, one
   for not featured jobs. I would like to query featured jobs and remove these for
   query of not featured jobs.
 *  Plugin Contributor [Adam Heckler](https://wordpress.org/support/users/adamkheckler/)
 * (@adamkheckler)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053735)
 * > I want to separate featured jobs and not featured jobs on the same page. Featured
   > posts should be displayed first and then not featured jobs in a new row.
 * I don’t understand why you think you need two loops to do this. Featured jobs
   are, by default, displayed above non-featured jobs already. Screenshot:
 * [http://d.pr/i/bmlg/4Obp8lPM](http://d.pr/i/bmlg/4Obp8lPM)
 * The job with the yellow background is featured, the jobs in white are not.
 * Is there some issue with that on your site?
 *  Thread Starter [simonkro](https://wordpress.org/support/users/simonkro/)
 * (@simonkro)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053769)
 * I use the theme Listable, which displays three jobs/listings in the same row:
   [https://pixelgrade.com/demos/listable/listings-no-map/](https://pixelgrade.com/demos/listable/listings-no-map/).
 * I customized the theme so that it doesn’t display an image on listing pages for
   not featured jobs/listings. But, if featured listings and not featured listings
   show up in the same row, the design of non featured listings is broken. Because
   instead of the image there is only white space.
 * That’s why I want not featured listings to appear on the next row after all featured
   jobs.
 *  Plugin Contributor [Adam Heckler](https://wordpress.org/support/users/adamkheckler/)
 * (@adamkheckler)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053775)
 * > I customized the theme so that it doesn’t display an image on listing pages
   > for not featured jobs/listings. But, if featured listings and not featured 
   > listings show up in the same row, the design of non featured listings is broken.
   > Because instead of the image there is only white space.
 * This probably means that something in your custom code is causing that bug. I’d
   recommend fixing that instead of trying to work around it by having multiple 
   loops or whatever.
 * Also, if I scroll through your site right now, it seems everything is displaying
   fine. Is this because it’s working now, or do you just not have any featured 
   jobs at the moment?
 *  Thread Starter [simonkro](https://wordpress.org/support/users/simonkro/)
 * (@simonkro)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053779)
 * The link I posted was the preview of the theme. Here you can see my site: [http://prntscr.com/a4yfjr](http://prntscr.com/a4yfjr).
 * First row contains only non-featured listings. Second two non-featured listings
   and one featured listing with image. As you see the problem is not caused by 
   my customisation. It’s just the default design, which doesn’t fit to my plans.
 * Trust me, I need two loops to separate featured listings and non-featured listings
   in different row. It would be great if you guys could give me a hint how to customise
   your jobs shortcode.
 *  Plugin Contributor [Adam Heckler](https://wordpress.org/support/users/adamkheckler/)
 * (@adamkheckler)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053780)
 * If you’re convinced you need multiple loops, that’s fine, it’s just not something
   we can help with (as noted above). We can’t provide assistance with such in-depth
   customizations. Sorry! 🙁

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Multiple loop in jobs shortcode’ is closed to new replies.

 * ![](https://ps.w.org/wp-job-manager/assets/icon-256x256.gif?rev=2975257)
 * [WP Job Manager](https://wordpress.org/plugins/wp-job-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-job-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-job-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-job-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-job-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-job-manager/reviews/)

 * 11 replies
 * 3 participants
 * Last reply from: [Adam Heckler](https://wordpress.org/support/users/adamkheckler/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/multiple-loop-in-jobs-shortcode/#post-7053780)
 * Status: resolved