/
sponsors.php
executable file
·55 lines (45 loc) · 1.39 KB
/
sponsors.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
<?php /* Template Name: Sponsors */
get_header(); ?>
<div class="content-area">
<div class="main">
<aside>
<?php
$sidebarLoop = new WP_Query(array('post_type' => 'sidebar-items', 'posts_per_page' => -1, 'orderby' =>'meta_value', 'order' => 'ASC', 'meta_key' => 'sidebar-form-order'));
while ($sidebarLoop->have_posts()) {
$sidebarLoop->the_post();
$content = get_the_content();
$url = get_post_meta($post->ID, 'sidebar-form-url', true);
?>
<article class="sidebar-item">
<?php echo $content; ?>
</article>
<?php
}
?>
</aside>
<?php
while (have_posts()) {
the_post();
get_template_part( 'content', 'page' );
} ?>
<section class="sponsors">
<?php
$sponsorsLoop = new WP_QUERY(array('post_type' => 'sponsors', 'posts_per_page' => -1, 'orderby' =>'meta_value', 'order' => 'ASC', 'meta_key' => 'sponsor-form-order'));
while ($sponsorsLoop->have_posts()) {
$sponsorsLoop->the_post();
$title = get_the_title();
$content = get_the_content();
$image = get_the_post_thumbnail($post->ID, 'medium');
?>
<article class="sponsor">
<h3><?php echo $title; ?></h3>
<?php echo $image; ?>
<p><?php echo $content; ?><p>
</article>
<?php }
?>
</section>
<div class="aside-placeholder"></div>
</div>
</div>
<?php get_footer(); ?>