This repository has been archived by the owner on May 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfront-page.php
62 lines (46 loc) · 1.6 KB
/
front-page.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
<?php
get_header();
wpcampus_print_main_callout();
if ( ! have_posts() ) :
wpcampus_print_404();
else :
while ( have_posts() ) :
the_post();
wpcampus_print_article();
endwhile;
endif;
// Display blog posts.
$query_posts = new WP_Query( array(
'post_type' => array( 'post', 'podcast', 'resource', 'video', 'opportunity' ), // @TODO add notification
'posts_per_page' => 5, // @TODO add pagination
'wpc_hide_archive' => true,
));
if ( $query_posts->have_posts() ) :
// Add article meta after header.
add_action( 'wpcampus_after_article_header', 'wpcampus_print_article_meta', 5 );
// Setup article arguments.
$args = array(
'header' => 'h3',
'print_content' => false,
);
add_filter( 'the_title', 'wpcampus_prepend_post_title', 100, 2 );
?>
<div class="wpcampus-front-page-articles">
<h2><?php printf( __( 'From The %s Community', 'wpcampus' ), 'WPCampus' ); ?></h2>
<?php
wpcampus_print_articles( $args, false, $query_posts );
?>
<ul class="button-group">
<li><a href="/announcements/" class="button"><?php _e( 'Announcements', 'wpcampus' ); ?></a></li>
<li><a href="/blog/" class="button"><?php _e( 'Blog', 'wpcampus' ); ?></a></li>
<li><a href="/podcast/" class="button"><?php _e( 'Podcast', 'wpcampus' ); ?></a></li>
<li><a href="/resources/" class="button"><?php _e( 'Resources', 'wpcampus' ); ?></a></li>
<li><a href="/videos/" class="button"><?php _e( 'Videos', 'wpcampus' ); ?></a></li>
</ul>
</div>
<?php
remove_filter( 'the_title', 'wpcampus_prepend_post_title', 100, 2 );
// Reset the main query post data.
wp_reset_postdata();
endif;
get_footer();