Passed
Push — master ( e51c9a...41921a )
by Chris
04:16
created

partials/content-page-cover.php (19 issues)

1
<?php
2
/**
3
 * The template used for displaying page content in page.php
4
 *
5
 * @package lsx
6
 */
7
8
?>
9
10
<?php lsx_entry_before(); ?>
11
12
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
13
14
	<?php //lsx_entry_top(); ?>
0 ignored issues
show
No space found before comment text; expected "// lsx_entry_top();" but found "//lsx_entry_top();"
Loading history...
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
Unused Code Comprehensibility introduced by
75% 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...
15
16
	<?php
17
	// On the cover page template, output the cover header.
18
	$cover_header_style   = '';
19
	$cover_header_classes = '';
20
21
	$color_overlay_style   = '';
22
	$color_overlay_classes = '';
23
24
	$image_url = ! post_password_required() ? get_the_post_thumbnail_url( get_the_ID(), 'full' ) : '';
25
26
	if ( $image_url ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
27
		$cover_header_style   = ' style="background-image: url( ' . esc_url( $image_url ) . ' );"';
28
		$cover_header_classes = ' bg-image';
29
	}
30
31
	// Get the color used for the color overlay.
32
	$color_overlay_color = get_theme_mod( 'lsx_cover_template_overlay_background_color' );
33
	if ( $color_overlay_color ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
34
		$color_overlay_style = ' style="color: ' . esc_attr( $color_overlay_color ) . ';"';
35
	} else {
36
		$color_overlay_style = '';
37
	}
38
39
	// Get the fixed background attachment option.
40
	if ( get_theme_mod( 'lsx_cover_template_fixed_background', true ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
41
		$cover_header_classes .= ' bg-attachment-fixed';
42
	}
43
44
	// Get the opacity of the color overlay.
45
	$color_overlay_opacity  = get_theme_mod( 'lsx_cover_template_overlay_opacity' );
46
	$color_overlay_opacity  = ( false === $color_overlay_opacity ) ? 80 : $color_overlay_opacity;
47
	$color_overlay_classes .= ' opacity-' . $color_overlay_opacity;
48
	?>
49
50
	<div class="cover-header <?php echo esc_html( $cover_header_classes ); ?>"<?php echo wp_kses_post( $cover_header_style ); ?>>
51
		<div class="cover-header-inner-wrapper">
52
			<div class="cover-header-inner">
53
				<div class="cover-color-overlay color-accent<?php echo esc_attr( $color_overlay_classes ); ?>"<?php echo wp_kses_post( $color_overlay_style ); ?>></div>
54
55
					<header class="entry-header has-text-align-center">
56
						<div class="entry-header-inner section-inner">
57
58
							<?php
59
60
							if ( has_category() ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
61
								?>
62
63
								<div class="entry-categories">
64
									<div class="entry-categories-inner">
65
										<?php the_category( ' ' ); ?>
66
									</div>
67
								</div>
68
69
								<?php
70
							}
71
72
							the_title( '<h1 class="entry-title">', '</h1>' );
73
74
							if ( is_page() ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
75
								?>
76
77
								<div class="to-the-content-wrapper">
78
79
									<a href="#post-inner" class="to-the-content">
80
										<i class="fa fa-arrow-down" aria-hidden="true"></i>
81
									</a>
82
83
								</div>
84
85
								<?php
86
							} else {
0 ignored issues
show
Blank line found at start of control structure
Loading history...
87
88
								if ( has_excerpt() ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
89
									?>
90
91
									<div class="intro-text section-inner">
92
										<?php the_excerpt(); ?>
93
									</div>
94
95
									<?php
96
								}
97
98
								?>
99
								<div class="entry-meta">
100
									<?php lsx_post_meta_list_top(); ?>
101
								</div><!-- .entry-meta -->
102
								<?php
103
0 ignored issues
show
Blank line found at end of control structure
Loading history...
104
							}
105
							?>
106
107
						</div>
108
					</header>
109
			</div>
110
		</div>
111
	</div>
112
113
	<div id="post-inner" class="entry-content">
114
115
		<?php lsx_entry_inside_top(); ?>
116
117
		<?php
118
			the_content();
119
120
			wp_link_pages( array(
0 ignored issues
show
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
121
				'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
122
				'after'       => '</div></div>',
123
				'link_before' => '<span>',
124
				'link_after'  => '</span>',
125
			) );
0 ignored issues
show
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
126
		?>
127
	</div><!-- .entry-content -->
128
129
	<?php lsx_entry_bottom(); ?>
130
131
</article><!-- #post-## -->
132
133
<?php
134
lsx_entry_after();
135