← WordPress

Problema ao remover posts de uma categoria

Lida 2618 vezes

Offline

ragnarock 
Membro
Mensagens 208 Gostos 1
Feedback +1

Troféus totais: 27
Trófeus: (Ver todos)
Tenth year Anniversary Nineth year Anniversary Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2

Estou a tentar remover post de uma categoria (cat id = 52) da listagem inicial de todos os posts.
Só quero que os posts daquela categoria sejam vistos quando estamos de facto a listar todos os posts dessa categoria, ou quando usamos o search

meti la este codigo:
Código: [Seleccione]
<?php
if (is_home())
  
query_posts('cat=-52');
?>
mas isto tem um problema...quando mudo de pagina...ele fica com os posts da 1ª pagina a mesma... alguém tem ideia de como se pode resolver isto?
Offline

ragnarock 
Membro
Mensagens 208 Gostos 1
Feedback +1

Troféus totais: 27
Trófeus: (Ver todos)
Tenth year Anniversary Nineth year Anniversary Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2

informação adicional aquele codigo esta no index.php assim:
(para saberem onde esta +-)

Código: [Seleccione]
<?php if (have_posts()) : ?>

<?php
if (is_home())
  
query_posts('cat=-52');
?>


<?php while (have_posts()) : the_post(); ?>
Offline

Ricardo75 
Membro
Mensagens 1660 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Deve ser apenas a falta do $query_string:

Código: (php) [Seleccione]
<?php
  
if (is_home())
  
query_posts($query_string.'cat=-52');
?>
Offline

ragnarock 
Membro
Mensagens 208 Gostos 1
Feedback +1

Troféus totais: 27
Trófeus: (Ver todos)
Tenth year Anniversary Nineth year Anniversary Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2

era mesmo isso, tks