-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfront-page.php
More file actions
77 lines (49 loc) · 1.65 KB
/
front-page.php
File metadata and controls
77 lines (49 loc) · 1.65 KB
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
74
75
76
77
<?php get_header(); ?>
<main id="main" class="ww<?php echo ( get_field( 'fade_in' ) ? ' fade-slide' : '' ); ?>">
<?php if ( is_home() ): ?>
<?php if ( have_posts() ): ?>
<?php while ( have_posts() ): the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php else: ?>
<?php
// Build new WordPress query
// Request all slides that are in the slider
//
$q_slides = new WP_Query( array(
'post_type' => 'slides',
'meta_key' => 'position',
'meta_value' => 'slider',
'orderby' => 'menu_order',
'order' => 'ASC',
));
?>
<?php if ( $q_slides->have_posts() ): ?>
<section class="slidesjs">
<?php while ( $q_slides->have_posts() ): $q_slides->the_post(); ?>
<?php get_template_part( 'block', ( get_field( 'layout' ) === 'solid' ? 'thumbnail' : get_field( 'layout' ) ) ); ?>
<?php endwhile; ?>
</section>
<?php endif; ?>
<?php
// Build new WordPress query
// Request all slides not in the slider position
//
$q_blocks = new WP_Query(array(
'post_type' => 'slides',
'meta_key' => 'position',
'meta_compare' => '!=',
'meta_value' => 'slider',
'orderby' => 'menu_order',
'order' => 'ASC',
));
?>
<?php if ( $q_blocks->have_posts() ): ?>
<?php while ( $q_blocks->have_posts() ): $q_blocks->the_post(); ?>
<?php get_template_part( 'block', ( get_field( 'layout' ) === 'solid' ? 'thumbnail' : get_field( 'layout' ) ) ); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php endif; ?>
</main>
<?php get_footer(); ?>