← WordPress

widget duma categoria

Lida 1641 vezes

Offline

Rafix 
Membro
Mensagens 343 Gostos 1
Troféus totais: 21
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Quero fazer um widget com os nomes dos posts que tenho numa categoria com os respectivos links...existe alguma forma de fazer isto, que não manualmente?
 :-P
Offline

rtbfreitas 
Equipa
Mensagens 1497 Gostos 9
Feedback +24

Troféus totais: 30
Trófeus: (Ver todos)
Windows User Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4

Não sei se existe algum plugin/widget para o que pretendes, mas podes sempre criar um widget com PHP:

Código: [Seleccione]
<ul>
 <?php $recent = new wp_query("cat=1&showposts=5"); while($recent->have_posts()) : $recent->the_post();?>
  <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
 <?php endwhile; ?>
</ul>

O que esse código faz, é ir buscar os últimos 5 posts da categoria com ID=1, é isso que pretendes?
Offline

Rafix 
Membro
Mensagens 343 Gostos 1
Troféus totais: 21
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Já consegui me arranjar com aquele código :D

 :obrigado: