categoria exibe posts de outra categoria
-
olá pessoal,
o problema é o seguinte:
tenho duas categorias: DICAS e FOTOS.
Na pagina inicial, são exibidos resumos de 3 post de cada.
http://viviamlafeta.com.br/1/Ao clicar em algum artigo ele exibe o artigo em sua categoria, tudo certinho.
Ex:
http://viviamlafeta.com.br/1/dicas/leo-semper-tellus-vitae-cursus-turpis/ (POST DE DICAS)
http://viviamlafeta.com.br/1/fotos/mariana-santana-16-dias/ (POST DE FOTOS)Até ai tudo bem, o problema é que quando clico no ítem DICAS do menu, que leva até a categoria DICAS, ele exibe os posts da categoria FOTOS.
http://viviamlafeta.com.br/1/dicas/Quando testo o link da categoria FOTOS tá tudo certinho. Mas em dicas dá esse erro.
Já conferi na postagem se marquei a categoria certa e está tudo ok.Segue código da index, category e single:
INDEX.PHP
<?php get_header(); ?> <div id="content"> <div class="fotos-index-out"> <div class="titulo">FOTOS</div> <?php query_posts('cat=fotos&posts_per_page=3'); ?> <?php while ( have_posts() ) : the_post() ?> <div class="fotos-index"> <a href="<?php the_Permalink()?> "><?php the_post_thumbnail(); ?></a> <a href="<?php the_Permalink()?> "><?php the_title(); ?></a> </div> <?php endwhile; ?> </div> <div class="clear"></div> <div class="index-dicas"> <div class="index-dicas-in"> <div class="titulo">DICAS</div> <div class="dicas-um"> <?php get_template_part( 'nav', 'above' ); ?> <?php query_posts('showposts=3&cat=1'); ?> <?php while ( have_posts() ) : the_post() ?> <div class="tipo-post"> <?php the_post_thumbnail(); ?> <?php get_template_part( 'entry' ); ?> <p class="leia-mais"><a href="<?php the_Permalink()?> ">Leia mais >> </a></p> </div> <?php endwhile; ?> </div> </div> </div> </div> <?php get_footer(); ?>
CATEGORY.PHP
<?php get_header(); ?> <div id="content"> <div class="dicas2"> <div class="titulo"><?php global $post; $categoria = get_the_category($post->id); $nomeCategoria = $categoria[0]->cat_name; echo $nomeCategoria; ?></div> <div class="dicas2-in"> <?php $query = new WP_Query('posts_per_page=1' . '&paged=' . $paged); ?> <?php if ($query->have_posts()): while ($query->have_posts()) : $query->the_post();?> <!-- Início Loop do wodpress --> <h1><?php the_title();?></h1><!-- Permalink chama o link do post completo e The_title pega o titulo --> <p><?php the_content(__('Leia mais'));?></p> <div id="comments"> <h3><a href="http://twitter.com/home?status=<?php the_title(); ?> -> <?php the_permalink() ?> RT @XXXXXXXX">Compartilhe no Twitter</a><a class="fb-comment" href="http://www.facebook.com/share.php?u=<?php the_permalink() ?>&t=<?php the_title(); ?>">Curta no Facebook</a><?php comments_number(__(''), __('1 Comment'), __('% Comments')); ?> » <a href="<?php the_permalink(); ?>#postcomment" title="<?php _e("Leave a comment"); ?>">Ver/Comentar</a></h3></div> <?php endwhile; else:?> <?php endif;?>
SINGLE.PHP
<?php get_header(); ?> <article id="content"> <div class="dicas2"> <div class="titulo"><?php global $post; $categoria = get_the_category($post->id); $nomeCategoria = $categoria[0]->cat_name; echo $nomeCategoria; ?></div> <div class="dicas2-in"> <?php get_template_part( 'nav', 'above-single' ); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h1><?php the_title();?></h1> <?php the_content(); ?> <?php comments_template('', true); ?> <?php endwhile; endif; ?> <?php get_template_part( 'nav', 'below-single' ); ?> </div> </div> </div> <?php get_footer(); ?>
Alguém pode me ajudar neste problema?
Abraço
- O tópico ‘categoria exibe posts de outra categoria’ está fechado para novas respostas.