-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-research.php
61 lines (61 loc) · 1.91 KB
/
template-research.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
<?php
/* Template Name: Research */
$args = [
'post_type' => 'research',
'posts_per_page' => -1,
'order' => 'ASC',
'orderby' => 'title',
'tax_query' => [
[
'taxonomy' => 'research_category',
'field' => 'slug',
'terms' => '',
]
]
];
get_header();
?>
<section class="container">
<div class="mb-3"><?php the_post_thumbnail('full'); ?></div>
<div><?php the_content(); ?></div>
</section>
<div class="row">
<section class="container">
<article class="row mt-5">
<?php
$args['tax_query'][0]['terms'] = 'research-topic';
$posts_query = new WP_Query( $args );
if($posts_query->have_posts()){
while($posts_query->have_posts()){
$posts_query->the_post();
get_template_part( 'template-parts/content/research-item' );
}
}else{
echo "<p>Not found.</p>";
}
wp_reset_query();
?>
</article>
</section>
</div>
<div class="row">
<section class="container">
<article class="row mt-5">
<p>We developed the projects:</p>
<?php
$args['tax_query'][0]['terms'] = 'developed-project';
$posts_query = new WP_Query( $args );
if($posts_query->have_posts()){
while($posts_query->have_posts()){
$posts_query->the_post();
get_template_part( 'template-parts/content/research-item' );
}
}else{
echo "<p>Not found.</p>";
}
wp_reset_query();
?>
</article>
</section>
</div>
<?php get_footer(); ?>