jegtheme

Untitled

Mar 23rd, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.32 KB | None | 0 0
  1. <?php
  2. $jobs = new WP_Query(array(
  3.     'post_type' => 'job',
  4.     'meta_query' => array(
  5.         array(
  6.             'key' => 'company_id',
  7.             'value' => array(get_the_ID()),
  8.             'compare' => 'IN',
  9.         )
  10.     ),
  11.     'orderby' => 'date',
  12.     'order' => 'desc',
  13.     'posts_per_page' => -1,
  14. ));
  15. ?>
  16.  
  17. <div <?php post_class('item company-item'); ?>>
  18.     <div class="row">
  19.         <div class="col-md-2 hidden-sm hidden-xs">
  20.             <div class="img-item">
  21.                 <?php the_post_thumbnail('large') ?>
  22.             </div>
  23.         </div>
  24.         <div class="col-md-10">
  25.             <h3 class="no-margin-top">
  26.                 <a href="<?php the_permalink(); ?>">
  27.                     <?php the_title(); ?>  <i class="fa fa-link color-white-mute font-1x"></i>
  28.                 </a>
  29.             </h3>
  30.  
  31.             <p class="text-truncate "><?php the_excerpt(); ?></p>
  32.             <div>
  33.                 <?php if($jobs->found_posts) :  ?>
  34.                 <a href="<?php the_permalink(); ?>#cp-jobs">
  35.                     <?php  printf (  _n ( 'Available Job', '%1$s Available Jobs', $jobs->found_posts, 'jobplanet-plugin' ) , number_format_i18n( $jobs->found_posts ) ) ; ?>
  36.                 </a>
  37.                 &ndash;
  38.                 <?php endif; ?>
  39.  
  40.                 <?php
  41.                 if(is_user_logged_in() && current_user_can( 'applicant' )) :
  42.  
  43.                 $user_id = get_current_user_id();
  44.                 $follow_company = get_user_meta($user_id, 'follow_company');
  45.                 if($follow_company !== '' && in_array(get_the_ID(), $follow_company)) {
  46.                 ?>
  47.                     <a href="#" data-follow="1" data-id="<?php the_ID(); ?>" class="btn btn-xs btn-theme btn-success follow-company">
  48.                         <?php _e('Follow Company', 'jobplanet-plugin'); ?>
  49.                     </a>
  50.                 <?php
  51.                 } else {
  52.                 ?>
  53.                     <a href="#" data-follow="0" data-id="<?php the_ID(); ?>" class="btn btn-xs btn-theme btn-default follow-company">
  54.                         <?php _e('Follow Company', 'jobplanet-plugin'); ?>
  55.                     </a>
  56.                 <?php
  57.                 }
  58.                
  59.                 endif;
  60.                 ?>
  61.             </div>
  62.         </div>
  63.     </div>
  64. </div><!-- end item listing  -->
Add Comment
Please, Sign In to add comment