Completed
Push — master ( ed31a0...606182 )
by Md. Mozahidur
02:28
created

single.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * The template for displaying all single posts.
4
 *
5
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
6
 *
7
 * @package Lighthouse
8
 */
9
10
get_header(); ?>
11
12
	<div class="title-wrapper">
13
		<div class="container blog-wrapper">
14
			<div class="row">
15
			<div class="col-xs-12">
16
				<h1 class="entry-title">Lighthouse News Centre</h1> <div class="back-to"> <span> | </span><a href="<?php echo get_site_url(); ?>/news-centre">back</a></div>
17
			</div>
18
			</div>
19
		</div>
20
	</div>
21
	<div id="primary" class="container content-area wider-wrapper">
22
		<div class="row">
23
			<div class="col-md-9 content-listing">
24
			
25
				<main id="main" class="site-main" role="main">
26
27
				<?php
28
				while ( have_posts() ) : the_post();
29
30
					$thumb_feature = wp_get_attachment_image_src( get_post_thumbnail_id(), 'lighthouse_feature_img');
31
					$url_feature = $thumb_feature[0];
32
				?> 
33
34
				<div class="post-img">
35
				<img class="img-responsive" src="<?php echo $url_feature; ?>">
36
				</div>
37
38
				<?php
39
				get_template_part( 'template-parts/content', get_post_format() );
40
41
					//the_post_navigation();
42
43
					// If comments are open or we have at least one comment, load up the comment template.
44
					// if ( comments_open() || get_comments_number() ) :
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
45
					// 	comments_template();
46
					// endif;
47
48
				endwhile; // End of the loop.
49
				?>
50
51
				</main><!-- #main -->
52
						
53
				<div class="post-slider row">
54
					<div class="col-xs-12">
55
						<h2>Related Artices</h2>
56
					</div>
57
						<div id="related-posts" class="owl-carousel">
58
							<?php
59
							 $postslist = get_posts('numberposts=99&order=DESC&orderby=date');
60
							 foreach ($postslist as $post) :
61
							    setup_postdata($post);
62
							 ?>
63
							 <div class="col-xs-12">
64
							 <div class="entry">
65
66
								<div class="thumbnail thumbnail-hover">
67
								<?php
68
									$thumb_post = wp_get_attachment_image_src( get_post_thumbnail_id(), 'lighthouse_related_post');
69
									$url_post = $thumb_post[0];
70
								?>
71
									<img class="img-responsive" src="<?php echo $url_post; ?>">
72
									<a href="<?php the_permalink() ?>" title="<?php  the_title_attribute() ?>" class="overlay"></a>
73
								</div>
74
75
							 <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
76
								<span class="date">
77
								<i class="fa fa-clock-o"></i>
78
								<?php the_time(get_option('date_format')) ?>
79
								</span>
80
							 </div>
81
							 </div>
82
							 <?php endforeach; ?>
83
84
						</div>
85
				</div>
86
87
88
			</div><!-- .blog-listing -->
89
		<div class="col-md-3 sidebar" role="complementary">
90
			<?php dynamic_sidebar( 'blog_widgets' ); ?>
91
		</div>
92
		</div><!-- .row -->
93
	</div><!-- #primary -->
94
95
<?php
96
get_sidebar();
97
get_footer();
98