<?php 
/* Template Name: single-service */ 
get_header();

?> 
<?php
if (have_posts()) : while (have_posts()) : the_post();
$title=get_the_title();
$single_banner=get_field('single_banner');
$thumb_id = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'servicebig-thumb', true);
$thumb_url = $thumb_url_array[0];
$download_brochure=get_field('download_brochure');
$download_company_details=get_field('download_company_details');
$post_slug = $post->post_name;
?>
 <div class="breadcrumb-area text-center shadow dark text-light bg-cover" style="background-image: url(<?php echo $single_banner['url'];?>);">

        <div class="container">

            <div class="row">

                <div class="col-lg-8 offset-lg-2">

                    <h1><?php  echo $title;?></h1>

                    <ul class="breadcrumb">

                        <li><a href="<?php echo site_url('service');?>"><i class="fas fa-home"></i> Services</a></li>

                        <li class="active">Single</li>

                    </ul>

                </div>

            </div>

        </div>

    </div>

    <!-- End Breadcrumb -->



    <!-- Star Services Details Area

    ============================================= -->

    <div class="services-details-area default-padding">

        <div class="container">

            <div class="services-details-items">

                <div class="row">

                    

                    <div class="col-lg-4 services-sidebar">

                        <!-- Single Widget -->

                        <div class="single-widget services-list">

                            <h4 class="widget-title">Services List</h4>

                            <div class="content">

                               
							   
							    <ul>
                                    <?php 
									      $args=array(
										                 'post_type'=>'service',
														 'post_status'=>'publish',
														 'post_per_page'=> -1
													 );
										  $all_service = new WP_Query($args);
										  while($all_service->have_posts()):$all_service -> the_post(); 
										  $service_title=get_the_title();
										  $service_permalink=get_the_permalink();
										  $service_slug = get_post_field( 'post_name', get_post() );
									?>	  			 
                                    <li <?php if($service_slug==$post_slug):?>class="current-item"<?php endif;?>><a href="<?php  echo $service_permalink;?>"><?php  echo $service_title;?></a></li>
                                    <?php endwhile;?>
                                    

                                </ul>
								
								
								

                            </div>

                        </div>

                        <!-- End Single Widget -->

                        <div class="single-widget quick-contact text-light" style="background-image: url(<?php echo get_template_directory_uri();?>/assets/img/800x800.png);">

                            <div class="content">

                                <i class="fas fa-phone"></i>

                                <h4>Need any help?</h4>

                                <p>

                                    We are here to help our customer any time. You can call on 24/7 To Answer Your Question.

                                </p>

                                <h2>(012) 6679545</h2>

                            </div>

                        </div>

                        <!-- Single Widget -->
                       <?php if($download_brochure||$download_company_details):?>
                        <div class="single-widget brochure">

                            <h4 class="widget-title">Brochure</h4>

                            <ul>
                                <?php if($download_brochure):?>
                                <li><a href="<?php echo $download_brochure;?>"><i class="fas fa-file-pdf"></i> Download Brochure </a></li>
                                <?php endif;if($download_company_details):?>
                                <li><a href="<?php echo $download_company_details;?>"><i class="fas fa-file-pdf"></i> Company Details </a></li>
                                <?php endif;?>
                            </ul>

                        </div>

                        <!-- End Single Widget -->
                     <?php endif;?>
                    </div>



                    <div class="col-lg-8 services-single-content">

                        <img src="<?php echo $thumb_url;?>" alt="Thumb">

                        <h2><?php echo $title;?></h2>

                        <p>

                           <?php the_content();?>

                        </p>

                        

                    </div>



                </div>

            </div>

        </div>

    </div>

    <!-- End Services Details Area -->
<?php endwhile; endif;?>

<?php get_footer();?>
