-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
90 lines (63 loc) · 2.22 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
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
<?php /* Template Name: Loop Posts */
$thumb_id = get_post_thumbnail_id( $id );
if ( '' != $thumb_id ) {
$thumb_url = wp_get_attachment_image_src( $thumb_id, 'actual_size', true );
$image = $thumb_url[0];
}
?>
<?php get_header(); ?>
<main id="main" class="main">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="header" <?php if ( has_post_thumbnail() ) { ?> style="background-image: url(<?php echo $image; ?>);" <?php } ?>>
<div class="ucla campus">
<div class="col span_12_of_12">
<h1 class="entry-title"><?php the_title(); ?></h1> <?php edit_post_link(); ?>
<p class="intro"><?php
$key_values = get_post_custom_values( 'intro' );
foreach ( $key_values as $key => $value ) {
echo $value;
}
?></p>
</div>
</div>
</header>
<div class="ucla campus entry-content">
<div class="col span_12_of_12">
<?php the_content(); ?>
</div>
</div>
<div class="latest-campus">
<div class="ucla campus">
<div class="col span_9_of_12">
<h2 class="mb-32 mt-64">Latest messages to the UCLA community </h2>
<?php
// Example argument that defines three posts per page.
$args = array(
'posts_per_page' => 2
);
// Variable to call WP_Query.
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) :
// Start the Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
// Loop Content
include 'templates/entry-content.php';
// End the Loop
endwhile;
else:
// If no posts match this query, output this text.
_e( 'Sorry, no results match your criteria.', 'textdomain' );
endif;
wp_reset_postdata();
?>
<a class="btn white mb-80 mb-xs-64 mt-32" href="/updates">
<span>Read all updates</span>
</a>
</div>
</div>
</div>
<?php endwhile; endif; ?>
</article>
</main>
<?php get_footer(); ?>