Arquivo category.php
-
Amigos preciso de uma ajuda, seguinte estou iniciando em WP. Estou desenvolvendo um tema do zero, neste tema eu tenho um menu que exibe as categorias criadas no painel. Agora eu estou tentando pegar os posts de cada categoria com o arquivo category.php, porém ele não me retorna nada e na aba do navegador aparece a informação de Página não encontrada.
Ao pesquisar pude ver que a url nos casos que funciona fica algo do tipo, localhost/nomedapagina/?cat=numerodacategoria, e no meu caso fica diferente dessa forma http://localhost/wordpress/index.php/category/games/ e não lista os posts. Alguém pode me ajudar?
Este é o código:
<?php get_header(); ?><div id=”container”>
<div id=”content”>
<div class=”main-category”>
<div id=”title-category”><span><?php single_cat_title(); ?></span></div>-
<?php if(have_posts()): while(have_posts()): the_post(); ?>
-
“><?php the_post_thumbnail(); ?>
<span>Visualizações <?php if(function_exists(‘the_views’)) { the_views(); } ?> | Comentarios <?php the_comments_number(‘0′,’1′,’%’); ?></span>
<h1>“><?php the_title(); ?></h1>
<p><?php the_excerpt_rereload(30,”); ?></p>
<?php endwhile; else: ?>
<?php endif; ?></div>
</div><!—/ fim content –>
<?php get_sidebar(); ?>
</div><!–/ fim container –>
<?php get_footer(); ?>
-
“><?php the_post_thumbnail(); ?>
- O tópico ‘Arquivo category.php’ está fechado para novas respostas.