|
1 | 1 | <?php |
2 | 2 | get_header(); |
3 | 3 |
|
4 | | -$layout = get_theme_mod( 'projects_layout_view', 'mansonry' ); |
| 4 | +$layout = get_theme_mod( 'projects_layout_view', 'mansonry' ); |
5 | 5 | $layout_class = shapely_get_layout_class(); |
6 | 6 |
|
7 | 7 | $item_classes = 'post-snippet col-md-3 col-sm-6 project'; |
8 | 8 | if ( 'mansonry' == $layout ) { |
9 | 9 | $item_classes .= ' masonry-item'; |
10 | 10 | } |
11 | 11 |
|
| 12 | +if ( 'sidebar-left' == $layout_class ) : |
| 13 | + get_sidebar(); |
| 14 | +endif; |
12 | 15 | ?> |
13 | | - <?php |
14 | | - if ( 'sidebar-left' == $layout_class ) : |
15 | | - get_sidebar(); |
16 | | - endif; |
17 | | - ?> |
18 | 16 | <div id="primary" class="content-area col-md-8 mb-xs-24 <?php echo esc_attr( $layout_class ); ?>"> |
19 | 17 | <main id="main" class="site-main" role="main"> |
20 | 18 |
|
|
29 | 27 | </div> |
30 | 28 | </div> |
31 | 29 | <?php endif ?> |
32 | | - |
| 30 | + |
33 | 31 | <div class="<?php echo 'mansonry' == $layout ? 'masonry masonryFlyIn' : ''; ?>"> |
34 | 32 | <?php |
35 | 33 | /* Start the Loop */ |
|
41 | 39 | $project_types = wp_get_post_terms( $post->ID, 'jetpack-portfolio-type', $projects_args ); |
42 | 40 |
|
43 | 41 | $thumbnail_url = get_the_post_thumbnail_url( get_the_ID(), 'full' ); |
44 | | - $item_style = ''; |
| 42 | + $item_style = ''; |
45 | 43 | if ( 'mansonry' != $layout ) { |
46 | 44 | $item_style = 'background-image: url(' . $thumbnail_url . ')'; |
47 | 45 | } |
48 | | - ?> |
| 46 | + ?> |
49 | 47 |
|
50 | 48 | <article id="post-<?php the_ID(); ?>" <?php post_class( $item_classes ); ?>> |
51 | | - <div class="image-tile inner-title hover-reveal text-center" style="<?php echo $item_style; ?>"> |
52 | | - <?php |
53 | | - if ( has_post_thumbnail() ) { |
54 | | - ?> |
55 | | - <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> |
56 | | - <?php |
57 | | - if ( 'mansonry' == $layout ) { |
58 | | - the_post_thumbnail( 'medium' ); |
59 | | - } |
| 49 | + <div class="image-tile inner-title hover-reveal text-center" style="<?php echo $item_style; ?>"> |
| 50 | + <?php |
| 51 | + if ( has_post_thumbnail() ) { |
60 | 52 | ?> |
61 | | - <div class="title"> |
62 | | - <?php |
63 | | - the_title( '<h5 class="mb0">', '</h5>' ); |
64 | | - if ( ! empty( $project_types ) ) { |
65 | | - echo '<span>' . implode( ' / ', $project_types ) . '</span>'; |
66 | | - } |
67 | | - ?> |
68 | | - </div> |
| 53 | + <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> |
| 54 | + <?php |
| 55 | + if ( 'mansonry' == $layout ) { |
| 56 | + the_post_thumbnail( 'medium' ); |
| 57 | + } |
| 58 | + ?> |
| 59 | + <div class="title"> |
| 60 | + <?php |
| 61 | + the_title( '<h5 class="mb0">', '</h5>' ); |
| 62 | + if ( ! empty( $project_types ) ) { |
| 63 | + echo '<span>' . implode( ' / ', $project_types ) . '</span>'; |
| 64 | + } |
| 65 | + ?> |
| 66 | + </div> |
69 | 67 | </a> |
70 | 68 | <?php |
71 | | - } |
72 | | - ?> |
| 69 | + } |
| 70 | + ?> |
73 | 71 | </div> |
74 | 72 | </article><!-- #post-## --> |
75 | 73 | <?php |
|
87 | 85 |
|
88 | 86 | </main><!-- #main --> |
89 | 87 | </div><!-- #primary --> |
90 | | - <?php |
91 | | - if ( 'sidebar-right' == $layout_class ) : |
92 | | - get_sidebar(); |
93 | | - endif; |
94 | | - ?> |
95 | 88 | <?php |
| 89 | +if ( 'sidebar-right' == $layout_class ) : |
| 90 | + get_sidebar(); |
| 91 | +endif; |
| 92 | + |
96 | 93 | get_footer(); |
0 commit comments