pustakakoran

Menampilkan Post dari Spesifik Category/Tags

May 31st, 2017
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. =====================
  2. BERDASARKAN KATEGORI
  3. =====================
  4. <ul class="posts">
  5. <?php query_posts('cat=5&showposts=10'); while (have_posts()) : the_post(); ?>
  6. <li><a href='<?php the_permalink() ?>'><?php the_title(); ?></a></li>
  7. <?php endwhile; ?>
  8.  
  9. <?php wp_reset_query(); ?>
  10. </ul>
  11.  
  12. ==================
  13. BERDASARKAN TAGS
  14. ==================
  15. <ul class="posts">
  16. <?php query_posts('cat=5&showposts=10&tag=demo'); while (have_posts()) : the_post(); ?>
  17. <li><a href='<?php the_permalink() ?>'><?php the_title(); ?></a></li>
  18. <?php endwhile; ?>
  19.  
  20. <?php wp_reset_query(); ?>
  21. </ul>
  22.  
  23. Sumber: http://alijafarian.com/how-to-display-wordpress-posts-for-a-specific-category/
RAW Paste Data