-
Notifications
You must be signed in to change notification settings - Fork 0
/
front-page.php
170 lines (152 loc) · 6.26 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
/**
* The front page template file.
*
* @package Flacso
*/
get_header(); ?>
<section class="feature featured-intro">
<div class="container">
<div class="row">
<div class="col-md-3">
<?php flacso_the_menu(); ?>
</div>
<div class="col-md-9">
<?php
// Featured Page via Customizer
$page_id = (int) get_theme_mod( 'flacso_featured_page' );
if ( $page_id > 0 ) :
$featured_page = new WP_Query( array( 'page_id' => $page_id ) );
if ( $featured_page->have_posts() ) : while ( $featured_page->have_posts() ) : $featured_page->the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'clear hentry--no-margin' ); ?>>
<div class="row">
<div class="col-sm-4 col-md-4">
<header class="entry-header">
<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-image">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_post_thumbnail( 'featured' ); ?></a>
</div><!-- .entry-image -->
<?php endif; ?>
</header><!-- .entry-header -->
</div>
<div class="col-sm-8 col-md-8">
<?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
<div class="entry-content entry-content--summary">
<?php the_excerpt(); ?>
</div><!-- .entry-content -->
<a href="<?php the_permalink(); ?>" class="read-more pull-right"><?php _e( 'Read more', 'flacso' ); ?><span class="more-sign">+</span></a>
</div>
</div><!-- .row -->
</article><!-- #post-## -->
<?php
endwhile; endif;
elseif ( current_user_can( 'edit_theme_options' ) ) : ?>
<div class="alert alert-info" role="alert">
<?php
global $wp_customize;
if ( isset( $wp_customize ) ) {
echo 'Você pode destacar uma página de seu interesse no menu à sua esquerda, dentro da opção <em>Front Page Content</em>. Aqui, será mostrado o resumo dessa página e, se houver, a sua imagem destacada.';
}
else {
echo 'Você pode destacar uma página de seu interesse. Aqui, será mostrado o resumo dessa página e, se houver, a sua imagem destacada. <a href="' . admin_url( 'customize.php' ) . '" class="alert-link">Faça isso agora.</a>';
}
?>
</div><!-- .alert.alert-info -->
<?php
endif;
?>
</div>
</div><!-- .row -->
</div><!-- .container -->
</section><!-- .featured-intro -->
<section class="wrapper feature featured-category">
<div class="container">
<div class="row">
<div class="col-md-12">
<h4 class="area-title area-title--secondary">Biblioteca</h4>
<?php
// Search for pages that use Library Page Template
$page_library = flacso_get_page_by_post_template( 'page-templates/library.php' );
$page_library_permalink = "#";
if(is_array($page_library))
{
foreach ( $page_library as $page ) {
// Flacso's library doesn't have a parent
if ( $page->post_parent == 0 ) {
$page_library_permalink = get_permalink( $page->ID );
}
}
}
flacso_the_publication_types(true); ?>
<div class="col-md-2 read-more--prefix">
<div class="read-more-content">
<?php _e('Look', 'flacso'); ?> <a href="<?php echo $page_library_permalink; ?>" class="read-more"><?php _e( 'Full Library', 'flacso' ); ?><span class="more-sign more-sign--alternate">+</span></a>
</div>
</div>
</div>
</div><!-- .row -->
</div><!-- .container -->
</section><!-- .featured-category-->
<section class="wrapper feature featured-links">
<div class="container">
<div class="row">
<div class="col-md-12">
<h4 class="area-title">Destaques</h3>
<div class="col-md-1 col-sm-1 col-xs-2 banners-cycle-button banners-cycle-prev" >
<div class="banners-cycle-ball" id="banners-cycle-prev">
</div>
</div>
<div class="col-md-10 col-sm-10 col-xs-8 banners-widget-area">
<?php
if ( is_active_sidebar( 'sidebar-banners' ) )
{
dynamic_sidebar( 'sidebar-banners' );
}
?>
</div>
<div class="col-md-1 col-sm-1 col-xs-2 banners-cycle-button" >
<div class="banners-cycle-ball" id="banners-cycle-next">
</div>
</div>
</h4>
</div><!-- .row -->
</div><!-- .container -->
</section><!-- .featured-links -->
<section class="wrapper feature featured-news">
<div class="container">
<div class="row">
<div class="col-md-12">
<h4 class="area-title">Notícias</h3>
<?php
$noticias_page = get_page_by_title( 'Notícias' );
$noticias_permalink = ( ! empty( $noticias_page ) ) ? $noticias_page->guid : '';
?>
<a href="<?php echo $noticias_permalink; ?>" class="read-more read-more--absolute"><?php _e( 'Read more', 'flacso' ); ?><span class="more-sign">+</span></a>
</div>
<?php
$noticias = new WP_Query( array ( 'posts_per_page' => 3, 'ignore_sticky_posts' => true ) );
if ( $noticias->have_posts() ) : while ( $noticias->have_posts() ) : $noticias->the_post(); ?>
<div class="col-md-4">
<article id="post-<?php the_ID(); ?>" <?php post_class( 'hentry--columns clear' ); ?>>
<header class="entry-header">
<?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; ?>
<div class="entry-meta">
<?php the_category(' '); ?>
</div><!-- .entry-meta -->
<?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
</header><!-- .entry-header -->
<div class="entry-content entry-content--summary">
<?php the_excerpt(); ?>
</div><!-- .entry-content -->
<a href="<?php the_permalink(); ?>" class="read-more pull-right"><?php _e( 'Read more', 'flacso' ); ?><span class="more-sign">+</span></a>
</article><!-- #post-## -->
</div>
<?php endwhile; endif; ?>
</div><!-- .row -->
</div><!-- .container -->
</section><!-- .featured-news -->
<?php get_footer(); ?>