-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate-new-content.php
148 lines (131 loc) · 4.81 KB
/
template-new-content.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
/* Template Name: What's New? Page Template */
global $helpers;
get_header();
$post_id = get_the_ID();
$dominant_color = get_post_meta( $post_id, 'dominant_color', true );
$dominant_color_css = str_replace('[', 'background-color:rgb(', $dominant_color);
$dominant_color_css = str_replace(']', ')', $dominant_color_css);
?>
<main role="main" class="container-fluid m-0 p-0">
<h1 class="text-center post-title mt-5"><span><?php the_title(); ?></span></h1>
<div class="thumbnail-wrapper" style="<?php echo $dominant_color_css; ?>">
<?php
$post_thumbnail_id = get_post_thumbnail_id();
the_post_thumbnail('post-thumbnail', ['data-src' => get_the_post_thumbnail_url( $post_thumbnail_id ),'class' => 'lazy-load expand-image', 'title' => get_post($post_thumbnail_id)->post_title ]);
?>
</div>
<div class="container">
<article id="post-<?php echo $post_id; ?>" <?php post_class(); ?>>
<div class="post-content">
<!--
<ul class="btn-list mt-5 text-sm-left text-md-center">
<li>
<a class="btn" href="#blog">Botwiki blog</a>
</li>
<li>
<a class="btn" href="#bots">New bots</a>
</li>
<li>
<a class="btn" href="#resources">New resources</a>
</li>
</ul>
-->
<?php
echo get_post_field( 'post_content', $post_id);
?>
<h2 id="blog">
<a class="pilcrow-link" href="#blog">
<span class="link">Botwiki blog</span>
<span class="pilcrow">¶</span>
</a>
</h2>
<?php
global $wp_query;
$wp_query = new WP_Query( array(
'post_type' => 'post',
'posts_per_page' => '6',
'post_status' => 'publish',
'orderby' => 'publish_date',
'order' => 'DESC'
) );
get_template_part('loop');
?>
<ul class="btn-list mt-0">
<li>
<a class="btn" href="/blog/">Visit blog</a>
</li>
</ul>
<h2 id="bots">
<a class="pilcrow-link" href="#bots">
<span class="link">New bots</span>
<span class="pilcrow">¶</span>
</a>
</h2>
<?php
global $wp_query;
$wp_query = new WP_Query( array(
'post_type' => 'bot',
'posts_per_page' => '6',
'post_status' => 'publish',
'meta_key' => 'bot_is_featured',
'meta_value' => 'on',
'meta_compare' => 'IN',
'orderby' => 'publish_date',
'order' => 'DESC',
) );
get_template_part('loop');
?>
<ul class="btn-list mt-0">
<li>
<a class="btn" href="/bots/">Browse all</a>
</li>
<li>
<a class="btn" href="/random-bot/">Random bot</a>
</li>
<li>
<a class="btn" href="/submit-your-bot/">Add your bot</a>
</li>
</ul>
<h2 id="resources">
<a class="pilcrow-link" href="#resources">
<span class="link">New resources</span>
<span class="pilcrow">¶</span>
</a>
</h2>
<?php
global $wp_query;
$wp_query = new WP_Query( array(
'post_type' => 'resource',
'posts_per_page' => '6',
'post_status' => 'publish',
'orderby' => 'publish_date',
'order' => 'DESC',
// 'tax_query' => array(
// array(
// 'taxonomy' => 'resource_type',
// 'field' => 'slug',
// 'terms' => array('tutorial'),
// 'operator' => 'NOT IN'
// )
// )
) );
get_template_part('loop');
?>
<ul class="btn-list mt-0">
<li>
<a class="btn" href="/resources/">Browse all</a>
</li>
<li>
<a class="btn" href="/submit-resource/">Add your resource</a>
</li>
</ul>
<div class="text-muted mb-5">
<p>Note: If you recently submitted a bot or a resource, please give us some time to review it against <a href="/botwiki-submission-guidelines/"><u>our guidelines</u></a>.</p>
<p>Thank you!</p>
</div>
</div>
</article>
</div>
</main>
<?php get_footer(); ?>