<?php
/**
 * Template part for displaying services section
 *
 * @package Conference Event Planner
 * @subpackage conference_event_planner
 */

?>
<?php $conference_event_planner_static_image = get_stylesheet_directory_uri() . '/assets/images/sliderimage.png'; ?>

<?php if(get_theme_mod('conference_event_planner_services_show_hide', true) != ''){ ?>
<div id="services" class="mt-5">
  <div class="container">
    <?php if( get_theme_mod( 'conference_event_planner_news_heading' ) != '' ) { ?>
      <h3 class="text-center mb-4"><?php echo esc_html( get_theme_mod( 'conference_event_planner_news_heading','' ) ); ?></h3>
    <?php } ?>
    <div class="row">
      <?php
        $conference_event_planner_post_category = get_theme_mod('conference_event_planner_services_section_category');
        if($conference_event_planner_post_category){
          $conference_event_planner_page_query = new WP_Query(array( 'category_name' => esc_html( $conference_event_planner_post_category ,'conference-event-planner')));?>
          <?php while( $conference_event_planner_page_query->have_posts() ) : $conference_event_planner_page_query->the_post(); ?>
            <div class="col-lg-4 col-md-6 col-sm-6">
              <div class="custom_block text-center my-3">
                <div class="services-heading">
                  <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
                </div>
                <div class="services-inner">
                  <?php if(has_post_thumbnail()) { ?><?php the_post_thumbnail(); ?><?php } else {echo ('<img src="'.$conference_event_planner_static_image.'">'); } ?>
                </div>
                <div class="service-body">
                  <div class="services_p">
                   <p><?php echo wp_trim_words( get_the_content(),15 );?></p> 
                    <div class="demo-box">
                    <div class="box-btn">
                    <a href="<?php the_permalink(); ?>"><?php esc_html_e('View More','conference-event-planner'); ?>     <i class="fas fa-arrow-right"></i></a>
                  </div>
                </div>
                  </div>
                </div>
              </div>
            </div>
          <?php endwhile;
          wp_reset_postdata();
        }
      ?>
    </div>
  </div>
</div>
 <?php } ?>