-
Notifications
You must be signed in to change notification settings - Fork 6
/
single.php
101 lines (67 loc) · 2.23 KB
/
single.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
get_header();
// Declare global $more for content control
global $more;
// keep a running list of the menu labels for intersection navigation
$menulist[] = sanitize_title( get_bigpicture_intro_menu_label() );
// custom query for posts listed by menu order
$the_query = new WP_Query(array(
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => 10,
) );
// First Loop for the navigation
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
// doth we have a string for the menu item?
$menu_label = get_post_meta( get_the_ID(), '_button_label', true );
// no, use the title, it will be ugly, but they should get the hint
if ( empty( $menu_label ) ) {
$menu_label = get_the_title();
}
// add to navigation mennu
echo '<li><a href="' . get_permalink() . '">' . $menu_label . '</a></li>';
// keep track for later use
$menulist[] = $menu_label;
} // while
echo '</ul></nav></header>';
} // $the_query->have_posts()
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if ( has_post_thumbnail() ) :?>
<?php $more = 0;?>
<section id="top" class="main style1 dark fullscreen">
<div class="content">
<header>
<h2><?php the_title(); ?></h2>
</header>
<?php the_content('');?>
<footer>
<a href="#more" class="button style2 down">More</a>
</footer>
</div>
</section>
<?php endif?>
<section id="more" class="main style3 primary">
<div class="content">
<?php if ( !has_post_thumbnail() ) :?>
<header>
<h2><?php the_title(); ?></h2>
</header>
<?php the_content()?>
<?php else :?>
<?php
$more = 1;
the_content('', TRUE);
?>
<?php endif?>
<?php edit_post_link('Edit This', '<p class="edit-this"><span class="fa fa-pencil-square-o" aria-hidden="true"></span> ', '</p>');?>
</div>
<a href="<?php echo site_url()?>" class="button style2 down anchored">Return</a>
</section>
<?php endwhile;?>
<?php endif; ?>
<?php get_footer(); ?>