This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtemplate-sidebar.php
executable file
·73 lines (60 loc) · 1.65 KB
/
template-sidebar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
* Template Name: Sidebar
* The template for displaying the sidebar template.
*
* @package Designer
* @link https://themebeans.com/themes/designer
*/
get_header();
// META
$content = $post->post_content;
$page_content_layout = get_post_meta( $post->ID, '_bean_page_content_layout', true );
$page_parallax = get_post_meta( $post->ID, '_bean_page_parallax', true ); ?>
<?php
while ( have_posts() ) :
the_post();
?>
<?php
if ( $page_parallax == 'off' ) {
$page_parallax = 'no-parallax'; }
?>
<?php
if ( has_post_thumbnail() ) {
echo '<div class="entry-media ' . esc_attr( $page_parallax ) . '">';
the_post_thumbnail( 'port-full' );
echo '</div>'; }
?>
<?php if ( $content ) { ?>
<div id="post-<?php the_ID(); ?>" <?php post_class( esc_attr( $page_content_layout ) . ' ' . esc_attr( $page_parallax ) ); ?>>
<article class="entry-content main-content fadein
<?php
if ( ! has_post_thumbnail() ) {
echo 'no-media'; }
?>
clearfix">
<?php the_content(); ?>
</article>
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
</div>
<?php } ?>
<?php if ( $page_content_layout != 'content-fullwidth' ) { ?>
<?php if ( is_active_sidebar( 'theme-sidebar' ) ) { ?>
<div class="sidebar fadein <?php echo esc_html( $page_content_layout ); ?> <?php echo esc_html( $page_parallax ); ?> <?php
if ( has_post_thumbnail() ) {
echo 'has-media'; }
?>
">
<?php dynamic_sidebar( 'theme-sidebar' ); ?>
</div>
<?php
}
}
endwhile;
wp_reset_postdata();
get_footer();