Passed
Push — add/cover-template-update ( ca0bef...ba8c8e )
by Virginia
09:49 queued 04:07
created

partials/content-page-cover.php (8 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(); ?>
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 ) {
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 ) {
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 ) ) {
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() ) {
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() ) {
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 {
87
88
								if ( has_excerpt() ) {
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
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(
121
				'before'      => '<div class="lsx-postnav-wrapper"><div class="lsx-postnav">',
122
				'after'       => '</div></div>',
123
				'link_before' => '<span>',
124
				'link_after'  => '</span>',
125
			) );
126
		?>
127
	</div><!-- .entry-content -->
128
129
	<footer class="footer-meta clearfix">
130
		<?php if ( has_tag() || class_exists( 'LSX_Sharing' ) || ( function_exists( 'sharing_display' ) || class_exists( 'Jetpack_Likes' ) ) ) : ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
131
			<div class="post-tags-wrapper">
132
				<?php lsx_content_post_tags(); ?>
133
134
				<?php
135
				if ( class_exists( 'LSX_Sharing' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
136
					lsx_content_sharing();
137
				} else {
138
					if ( function_exists( 'sharing_display' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
139
						sharing_display( '', true );
140
					}
141
142
					if ( class_exists( 'Jetpack_Likes' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
143
						$custom_likes = new Jetpack_Likes();
144
						echo wp_kses_post( $custom_likes->post_likes( '' ) );
145
					}
146
				}
147
				?>
148
		<?php endif ?>
149
	</footer><!-- .footer-meta -->
150
151
	<?php lsx_entry_bottom(); ?>
152
153
</article><!-- #post-## -->
154
155
<?php
156
lsx_entry_after();
157