Facebook
From Sole Echidna, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 231
  1. <!-- =========================
  2.      Page Breadcrumb  
  3. ============================== -->
  4. <?php get_header(); ?>
  5. <!--==================== Newsup breadcrumb section ====================-->
  6. <!-- =========================
  7.      Page Content Section      
  8. ============================== -->
  9. <main id="content">
  10.     <!--container-->
  11.     <div class="container-fluid">
  12.       <!--row-->
  13.       <div class="row">
  14.         <!--col-md-->
  15.         <?php
  16.                     $newsup_single_page_layout = get_theme_mod('newsup_single_page_layout','single-align-content-right');
  17.                     if($newsup_single_page_layout == "single-align-content-left")
  18.                     { ?>
  19.                     <aside class="col-md-3">
  20.                         <?php get_sidebar();?>
  21.                     </aside>
  22.                     <?php } ?>
  23.                     <?php if($newsup_single_page_layout == "single-align-content-right"){
  24.                     ?>
  25.                     <div class="col-md-9">
  26.                     <?php } elseif($newsup_single_page_layout == "single-align-content-left") { ?>
  27.                     <div class="col-md-9">
  28.                     <?php } elseif($newsup_single_page_layout == "single-full-width-content") { ?>
  29.                      <div class="col-md-12">
  30.                      <?php } ?>
  31.                       <?php if(have_posts())
  32.                         {
  33.                       while(have_posts()) { the_post(); ?>
  34.             <div class="mg-blog-post-box">
  35.               <div class="mg-header">
  36.                 <?php $newsup_single_post_category = esc_attr(get_theme_mod('newsup_single_post_category','true'));
  37.                   if($newsup_single_post_category == true){ ?>
  38.                 <div class="mg-blog-category">
  39.                       <?php newsup_post_categories(); ?>
  40.                 </div>
  41.                 <?php } ?>
  42.                 <h1 class="title single"> <a title="<?php the_title_attribute( array('before' => esc_html_e('Permalink to: ','newsup'),'after'  => '') ); ?>">
  43.                   <?php the_title(); ?></a>
  44.                 </h1>
  45.  
  46.                 <div class="media mg-info-author-block">
  47.                   <?php $newsup_single_post_admin_details = esc_attr(get_theme_mod('newsup_single_post_admin_details','true'));
  48.                   if($newsup_single_post_admin_details == true){ ?>
  49.                   <a class="mg-author-pic" href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"> <?php echo get_avatar( get_the_author_meta( 'ID') , 150); ?> </a>
  50.                 <?php } ?>
  51.                   <div class="media-body">
  52.                     <?php $newsup_single_post_admin_details = esc_attr(get_theme_mod('newsup_single_post_admin_details','true'));
  53.                   if($newsup_single_post_admin_details == true){ ?>
  54.                     <h4 class="media-heading"><span><?php esc_html_e('By','newsup'); ?></span><a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"><?php the_author(); ?></a></h4>
  55.                     <?php } ?>
  56.                     <?php $newsup_single_post_date = esc_attr(get_theme_mod('newsup_single_post_date','true'));
  57.                     if($newsup_single_post_date == true){ ?>
  58.                     <span class="mg-blog-date"><i class="fa fa-clock-o"></i>
  59.                       <?php echo get_the_date('M'); ?> <?php echo get_the_date('j,'); ?> <?php echo get_the_date('Y'); ?></span>
  60.                     <?php }
  61.                     $newsup_single_post_tag = esc_attr(get_theme_mod('newsup_single_post_tag','true'));
  62.                     if($newsup_single_post_tag == true){
  63.                     $tag_list = get_the_tag_list();
  64.                     if($tag_list){ ?>
  65.                     <span class="newsup-tags"><i class="fa fa-tag"></i>
  66.                       <a href="<?php the_permalink(); ?>"><?php the_tags('', ', ', ''); ?></a>
  67.                     </span>
  68.                   <?php } } ?>
  69.                   </div>
  70.                 </div>
  71.               </div>
  72.               <?php
  73.               $single_show_featured_image = esc_attr(get_theme_mod('single_show_featured_image','true'));
  74.               if($single_show_featured_image == true) {
  75.               if(has_post_thumbnail()){
  76.               the_post_thumbnail( '', array( 'class'=>'img-responsive' ) );
  77.                } }?>
  78.               <article class="small single">
  79.                 <?php the_content(); ?>
  80.                 <?php newsup_edit_link(); ?>
  81.                 <?php  newsup_social_share_post($post); ?>
  82.               </article>
  83.             </div>
  84.                       <?php } $newsup_enable_single_post_admin_details = esc_attr(get_theme_mod('newsup_enable_single_post_admin_details',true));
  85.             if($newsup_enable_single_post_admin_details == true) { ?>
  86.            <div class="media mg-info-author-block">
  87.             <a class="mg-author-pic" href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"><?php echo get_avatar( get_the_author_meta( 'ID') , 150); ?></a>
  88.                 <div class="media-body">
  89.                   <h4 class="media-heading"><?php esc_html_e('By','newsup'); ?> <a href ="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"><?php the_author(); ?></a></h4>
  90.                   <p><?php the_author_meta( 'description' ); ?></p>
  91.                 </div>
  92.             </div>
  93.             <?php } $newsup_enable_single_post_comments = esc_attr(get_theme_mod('newsup_enable_single_post_comments',true));
  94.                   if($newsup_enable_single_post_comments == true) {
  95.                   if (comments_open() || get_comments_number()) :
  96.                   comments_template();
  97.                   endif; } ?>
  98.  
  99.                   <?php  $newsup_enable_related_post = esc_attr(get_theme_mod('newsup_enable_related_post','true'));
  100.                     if($newsup_enable_related_post == true){ ?>
  101.               <div class="mg-featured-slider p-3 mb-4">
  102.                         <!--Start mg-realated-slider -->
  103.                         <div class="mg-sec-title">
  104.                             <!-- mg-sec-title -->
  105.                             <?php $newsup_related_post_title = get_theme_mod('newsup_related_post_title', esc_html__('Related Post','newsup'))?>
  106.                             <h4><?php echo esc_html($newsup_related_post_title);?></h4>
  107.                         </div>
  108.                         <!-- // mg-sec-title -->
  109.                            <div class="row">
  110.                                 <!-- featured_post -->
  111.                                   <?php
  112.                                   global $post;
  113.                                   $categories = get_the_category($post->ID);
  114.                                   $number_of_related_posts = 3;
  115.  
  116.                                   if ($categories) {
  117.                                   $cat_ids = array();
  118.                                   foreach ($categories as $category) $cat_ids[] = $category->term_id;
  119.                                   $args = array(
  120.                                   'category__in' => $cat_ids,
  121.                                   'post__not_in' => array($post->ID),
  122.                                   'posts_per_page' => $number_of_related_posts, // Number of related posts to display.
  123.                                   'ignore_sticky_posts' => 1
  124.                                    );
  125.                                   $related_posts = new wp_query($args);
  126.  
  127.                                   while ($related_posts->have_posts()) {
  128.                                   $related_posts->the_post();
  129.                                   global $post;
  130.                                   $url = newsup_get_freatured_image_url($post->ID, 'newsup-featured');
  131.                                   ?>
  132.                                     <!-- blog -->
  133.                                   <div class="col-md-4">
  134.                                     <div class="mg-blog-post-3 minh back-img"
  135.                                     <?php if(has_post_thumbnail()) { ?>
  136.                                     style="background-image: url('<?php echo esc_url($url); ?>');" <?php } ?>>
  137.                                       <div class="mg-blog-inner">
  138.                                           <?php $newsup_enable_single_post_category = esc_attr(get_theme_mod('newsup_enable_single_post_category','true'));
  139.  
  140.                                             if($newsup_enable_single_post_category == true){ ?>
  141.                                             <div class="mg-blog-category"> <?php newsup_post_categories(); ?>
  142.                                           </div> <?php } ?>
  143.                                             <h4 class="title"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute( array('before' => 'Permalink to: ','after'  => '') ); ?>">
  144.                                               <?php the_title(); ?></a>
  145.                                              </h4>
  146.                                             <div class="mg-blog-meta">
  147.                                             <?php $newsup_enable_single_post_date = esc_attr(get_theme_mod('newsup_enable_single_post_date','true'));
  148.                                                 if($newsup_enable_single_post_date == true){
  149.                                             ?>
  150.                                               <span class="mg-blog-date"><i class="fa fa-clock-o"></i>
  151.                                               <?php echo get_the_date('M'); ?> <?php echo get_the_date('j,'); ?> <?php echo get_the_date('Y'); ?></span>
  152.                                             <?php } $newsup_enable_single_post_admin = esc_attr(get_theme_mod('newsup_enable_single_post_admin','true'));
  153.                                               if($newsup_enable_single_post_admin == true) {?>
  154.                                             <a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"> <i class="fa fa-user-circle-o"></i> <?php the_author(); ?></a>
  155.                                             <?php } ?> </div>
  156.                                         </div>
  157.                                     </div>
  158.                                   </div>
  159.                                     <!-- blog -->
  160.                                     <?php }
  161.                 }
  162.                 wp_reset_postdata();
  163.                 ?>
  164.                             </div>
  165.                            
  166.                     </div>
  167.                     <!--End mg-realated-slider -->
  168.                   <?php } } ?>
  169.       </div>
  170.        <?php if($newsup_single_page_layout == "single-align-content-right") { ?>
  171.       <!--sidebar-->
  172.           <!--col-md-3-->
  173.             <aside class="col-md-3">
  174.                   <?php get_sidebar();?>
  175.             </aside>
  176.           <!--/col-md-3-->
  177.       <!--/sidebar-->
  178.       <?php } ?>
  179.     </div>
  180.   </div>
  181. </main>
  182. <?php get_footer(); ?>