-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
203 lines (146 loc) · 6.05 KB
/
index.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<?php
/**
* Página única do tema Deveras Simples.
*
* @package Deveras_Simples
* @since 0.1
*/
/**
* Configurações do tema
*/
if (!function_exists('prepara_tema')) :
function prepara_tema()
{
/*
* Carrega o "text-domain", o que permite que o tema seja traduzido.
*
* Todos os itens traduzíveis de um tema devem ser escritos em Inglês
* por força das melhores práticas do WordPress. Este tema terá alguns
* itens que poderão mudar de acordo com o idioma. Eles estarão escritos
* em Inglês, mas vou incluir um arquivo de tradução para PT-BR e PT-PT.
*
*
*/
load_theme_textdomain('deveras-simples', get_template_directory() . '/languages');
// Habilita o RSS.
add_theme_support('automatic-feed-links');
// Permite que o WordPress gerencie o título da página.
add_theme_support('title-tag');
}
add_action('after_setup_theme', 'prepara_tema');
endif;
?>
<!-- Declarações de linguagem e idioma obrigatórias -->
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<!-- Cabeçalho padrão HTML -->
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<header id="cabecalho" class="site-header">
<div class="site-header-container">
<div class="site-header-bloginfo">
<div class="site-header-bloginfo-title">
<?php
if (is_front_page() && is_home()) :
?>
<h1 class="site-title">
<a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
</h1>
<?php
else :
?>
<p class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"
rel="home"><?php bloginfo('name'); ?></a></p>
<?php
endif;
?>
</div>
<div class="site-header-bloginfo-description">
<?php echo get_bloginfo('description'); ?>
</div>
</div>
</div>
</header>
<main class="site-main">
<div class="site-content">
<div class="coluna-central">
<?php
if (have_posts()) : // Início do ciclo principal ("The Loop")
while (have_posts()) :
the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header>
<?php
if (is_singular()) :
the_title('<h1 class="entry-title">', '</h1>');
else :
the_title('<h2 class="entry-title"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h2>');
endif;
?>
<?php
if ('post' === get_post_type()) :
?>
<div class="entry-meta">
<?php _e('by', 'deveras-simples'); ?> <?php the_author(); ?>
<?php _e('on', 'deveras-simples'); ?> <?php the_date(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header>
<div class="entry-content">
<?php
if (is_singular()) :
// Se é o artigo individual, mostra o conteúdo.
the_content();
else :
// Se é o índice de artigos, mostra o resumo.
the_excerpt();
endif;
?>
</div>
<footer>
<?php
// Se é o artigo individual, exibe a navegação entre posts.
if (is_singular())
the_post_navigation(
array(
'prev_text' => __('« %title', 'deveras-simples'),
'next_text' => __('%title »', 'deveras-simples'),
'screen_reader_text' => __('Continue Reading', 'deveras-simples'),
)
);
?>
</footer>
</article>
<?php
endwhile; // Fim da ciclo principal
the_posts_pagination(
array(
'mid_size' => 2,
'prev_text' => __('« ', 'deveras-simples'),
'next_text' => __(' »', 'deveras-simples'),
'screen_reader_text' => __('Continue Reading', 'deveras-simples'),
)
);
endif;
?>
</div>
</div>
</main><!-- .site-main -->
<footer id="rodape" class="site-footer">
<div class="site-footer-info">
<div class="creditos">
<?php echo __('Copyright © ', 'deveras-simples') . date('Y') . ', ' . get_bloginfo('name') . '. ' . __('All rights reserved.', 'deveras-simples'); ?>
</div>
</div>
</footer>
<?php
wp_footer();
?>
</body>
</html>