Página de arquivos no WordPress
Muitos tem dificuldade de criar uma página arquivos no wordpress, mas não é um bicho de sete cabeças.
Abra o bloco de notas ou seu editor preferido e adicione o código abaixo:
<?php /* Template Name: Archives */ ?>
<?php get_header(); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="title"><?php the_title(); ?></div>
<div class="entry">
<h2>Últimos 20 posts</h2>
<ul><?php wp_get_archives('type=postbypost&limit=20&format=html'); ?></ul>
<div style="clear:both;"></div><br /><br />
<h2>Categorias</h2>
<?php wp_list_categories('show_count=1&title_li='); ?>
<div style="clear:both;"></div><br /><br />
<h2>Meses</h2>
<ul><?php wp_get_archives('type=monthly&show_post_count=1'); ?></ul>
<div style="clear:both;"></div><br /><br />
<h2>Anos</h2>
<ul><?php wp_get_archives('type=yearly&show_post_count=1'); ?></ul>
<div style="clear:both;"></div><br /><br />
<h2>Tags</h2>
<?php wp_tag_cloud('smallest=8&largest=16&orderby=name&number=10000'); ?>
<div style="clear:both;"></div><br />
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php get_footer(); ?>
Configure o código acima de acordo com o seu css, salve ele com o nome page-archives.php e envie pra pasta do seu tema.
Depois entre no painel do wordpress, vá em “Pages / Add New“, crie uma nova página com o nome Arquivos, por exemplo, e em “Attributes” na opção “Template” selecione “Archives” e depois dê um Publish.
Pronto! Nem precisa escrever nada ali no campo de posts. Visualize a página e veja como ficou.

Trackbacks/Pingbacks