Advertisement
awan101

page_employees.php

Jan 26th, 2016
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.24 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  
  5. Template Name: Employees
  6.  
  7. */
  8. if ( get_theme_mod('slider_display') == 1 ) :
  9.     get_header('slider');
  10. elseif ( get_theme_mod('video_display') == 1 ) :
  11.     get_header('video');
  12. elseif ( get_theme_mod('rev_display') == 1 ) :
  13.     get_header('rev');
  14. else :
  15.     get_header();
  16. endif;
  17. ?>
  18.  
  19.  
  20.  
  21.     <div id="primary" class="content-area fullwidth">
  22.         <main id="main" class="site-main" role="main">
  23.  
  24.             <header class="entry-header">
  25.                 <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
  26.             </header><!-- .entry-header -->
  27.  
  28.             <?php
  29.                 $employees = new WP_Query( array(
  30.                     'no_found_rows'       => true,
  31.                     'post_status'         => 'publish',
  32.                     'post_type'           => 'employees',
  33.                     'posts_per_page'      => -1
  34.                 ) );
  35.  
  36.                 if ($employees->have_posts()) :        
  37.             ?>
  38.                 <?php while ( $employees->have_posts() ) : $employees->the_post(); ?>
  39.                     <?php //Get the custom field values
  40.                         $photo = get_post_meta( get_the_ID(), 'wpcf-photo', true );
  41.                         $position = get_post_meta( get_the_ID(), 'wpcf-position', true );
  42.                         $facebook = get_post_meta( get_the_ID(), 'wpcf-facebook', true );
  43.                         $twitter = get_post_meta( get_the_ID(), 'wpcf-twitter', true );
  44.                         $google = get_post_meta( get_the_ID(), 'wpcf-google-plus', true );
  45.                         $linkedin = get_post_meta( get_the_ID(), 'wpcf-linkedin', true );
  46.                         $custom_link = get_post_meta( get_the_ID(), 'wpcf-custom-link', true );
  47.                     ?>
  48.                     <div class="employee col-md-4 col-sm-6 col-xs-6">
  49.                         <?php if ($photo != '') : ?>
  50.                         <?php if ( $custom_link != '' ) : ?>
  51.                          <a href="<?php echo esc_url($custom_link); ?>">
  52.                          <?php endif; ?>
  53.                             <img class="employee-photo wow zoomInDown" src="<?php echo esc_url($photo); ?>" alt="<?php the_title(); ?>">
  54.                             <?php if ( $custom_link != '' ) : ?>
  55.                              </a>
  56.                              <?php endif; ?>
  57.                         <?php endif; ?>
  58.                         <h4 class="employee-name wow fadeInUp"><?php the_title(); ?></h4>
  59.                         <?php if ($position != '') : ?>
  60.                             <span class="employee-position wow fadeInUp"><?php echo esc_html($position); ?></span>
  61.                         <?php endif; ?>
  62.                         <div class="employee-desc wow fadeInUp"><?php the_content(); ?></div>
  63.                         <?php if ( ($facebook != '') || ($twitter != '') || ($google != '') || ($linkedin != '') ) : ?>
  64.                             <div class="employee-social wow fadeInUp">
  65.                                 <?php if ($facebook != '') : ?>
  66.                                     <a href="<?php echo esc_url($facebook); ?>" target="_blank"><i class="fa fa-facebook"></i></a>
  67.                                 <?php endif; ?>
  68.                                 <?php if ($twitter != '') : ?>
  69.                                     <a href="<?php echo esc_url($twitter); ?>" target="_blank"><i class="fa fa-twitter"></i></a>
  70.                                 <?php endif; ?>
  71.                                 <?php if ($google != '') : ?>
  72.                                     <a href="<?php echo esc_url($google); ?>" target="_blank"><i class="fa fa-google-plus"></i></a>
  73.                                 <?php endif; ?>                                        
  74.                                 <?php if ($linkedin != '') : ?>
  75.                                     <a href="<?php echo esc_url($linkedin); ?>" target="_blank"><i class="fa fa-linkedin"></i></a>
  76.                                 <?php endif; ?>
  77.                             </div>
  78.                         <?php endif; ?>
  79.                     </div>
  80.                 <?php endwhile; ?>
  81.  
  82.             <?php moesia_paging_nav(); ?>
  83.  
  84.             <?php else : ?>
  85.  
  86.                 <?php get_template_part( 'content', 'none' ); ?>
  87.  
  88.             <?php endif; ?>
  89.  
  90.  
  91.         </main><!-- #main -->
  92.     </div><!-- #primary -->
  93.  
  94. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement