<?php
/**
 * The Template for displaying all single Service.
 *
 * @package advance-education-pro
 */
get_header(); 
get_template_part( 'template-parts/banner' );?>
<?php while ( have_posts() ) : the_post();
    $data= get_post_meta( $post->ID);?>
<div class="courses_details">  
    <div class="container">
        <div class="row">
            <div class="col-lg-9 col-md-12">
                <h3><?php the_title() ?></h3>
                <div id="courses_single_page" class="image-box media">
                    <?php the_post_thumbnail(); ?>
                </div>
                <p class="mt-3"><?php the_content();?></p>  
                <div class="price">
                    <?php if(get_post_meta($post->ID,'course_duration',true)!= ''){ ?>
                            <div class="meta-class1 mb-3"><strong><?php _e('Duration: ','advance-education-pro');?></strong> <?php echo esc_html(get_post_meta($post->ID,'course_duration',true)); ?></div>
                    <?php }?>  
                    <?php if(get_post_meta($post->ID,'degree_level',true)!= ''){ ?>
                            <div class="meta-class1 mb-3"><strong><?php _e('Degree: ','advance-education-pro');?></strong> <?php echo esc_html(get_post_meta($post->ID,'degree_level',true)); ?></div>
                    <?php }?> 
                    <?php if(get_post_meta($post->ID,'price',true)!= ''){ ?>
                            <div class="meta-class1 mb-3"><strong><?php _e('Price: ','advance-education-pro');?></strong> <?php echo esc_html(get_post_meta($post->ID,'price',true)); ?></div>
                    <?php }?> 
                    <?php if(get_post_meta($post->ID,'professors_name',true)!= ''){ ?>
                            <div class="meta-class1 mb-3"><strong><?php _e('Professor Name: ','advance-education-pro');?></strong> <?php echo esc_html(get_post_meta($post->ID,'professors_name',true)); ?></div>
                    <?php }?>
                    <?php if(get_post_meta($post->ID,'students',true)!= ''){ ?>
                            <div class="meta-class1 mb-3"><strong><?php _e('Students: ','advance-education-pro');?></strong> <?php echo esc_html(get_post_meta($post->ID,'students',true)); ?></div>
                    <?php }?> 
                    <?php if(get_post_meta($post->ID,'custom_link',true) !='') { $custom_link = get_post_meta($post->ID,'custom_link',true); } else {
                    $custom_link = get_the_permalink(); } ?>
                    <?php if(get_post_meta($post->ID,'apply_now',true)){?>
                            <div class="apply-now"><a href="<?php echo esc_url($custom_link); ?>"class="apply"><?php echo esc_html(get_post_meta($post->ID,'apply_now',true)); ?></a></div>
                    <?php } ?>
                </div>                   
                      
                <div class="post_pagination mt-4">
                    <?php the_post_navigation( array(
                        'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'advance-education-pro' ) . '</span> ' .
                            '<span class="screen-reader-text">' . __( 'Next post:', 'advance-education-pro' ) . '</span> ' .
                            '<span class="post-title">%title</span>',
                        'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'advance-education-pro' ) . '</span> ' .
                            '<span class="screen-reader-text">' . __( 'Previous post:', 'advance-education-pro' ) . '</span> ' .
                            '<span class="post-title">%title</span>',
                    ) );?>
                </div>
            </div>   
            <div class="col-lg-3 col-md-12" id="sidebar">
                <?php dynamic_sidebar('sidebar-1'); ?>
            </div>   
            <div class="clearfix"></div>
            <?php endwhile; // end of the loop. ?> 
        </div>    
    </div>
</div>
<?php get_footer(); ?>