-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfront-page.php
112 lines (94 loc) · 3.55 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
* The front page template
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package Público
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<div class="row">
<section class="site-news site__section clearfix">
<div class="medium-7 columns">
<div class="site-news__main">
<?php
$do_not_repeat = 0;
$noticias = new WP_Query( array (
'posts_per_page' => 1,
'ignore_sticky_posts' => true,
'post__in' => get_option( 'sticky_posts' ),
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-video' ),
'operator' => 'NOT IN'
)
)
) );
if ( $noticias->have_posts() ) : while ( $noticias->have_posts() ) : $noticias->the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'hentry--columns clear' ); ?>>
<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-image">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_post_thumbnail( 'archive' ); ?></a>
</div><!-- .entry-image -->
<?php endif; ?>
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
<?php publico_posted_on(); ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_excerpt(); ?>
</div>
</article><!-- #post-## -->
<?php $do_not_repeat = $post->ID; ?>
<?php endwhile; wp_reset_postdata(); endif; ?>
</div>
</div>
<div class="medium-5 columns">
<div class="site-news__aside">
<?php
$noticias_aside = new WP_Query( array (
'posts_per_page' => 4,
'ignore_sticky_posts' => true,
'post__not_in' => array( $do_not_repeat ),
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-video' ),
'operator' => 'NOT IN'
)
)
) );
if ( $noticias_aside->have_posts() ) : while ( $noticias_aside->have_posts() ) : $noticias_aside->the_post(); ?>
<a class="aside__link" href="<?php the_permalink(); ?>" rel="bookmark">
<article id="post-<?php the_ID(); ?>" <?php post_class( 'flag clearfix' ); ?>>
<div class="flag__image">
<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-image">
<?php the_post_thumbnail( 'thumbnail' ); ?>
</div><!-- .entry-image -->
<span class="posted-on"><?php the_time('d|m'); ?></span>
<?php endif; ?>
</div>
<div class="flag__body flag__body--padded">
<h2 class="entry-title"><?php the_title(); ?></h2>
</div>
</article><!-- #post-## -->
</a>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<a href="<?php echo get_permalink( get_option( 'page_for_posts' ) ); ?>" class="button wide"><?php _e( 'Read other posts', 'publico' ); ?></a>
<?php endif; ?>
</div>
</div>
</section>
</div>
<?php get_sidebar( 'social-engagement' ); ?>
<?php get_sidebar( 'content-secondary' ); ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>