Advertisement
pusatdata

WP Flexithemes: Membuat Template Single

May 14th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. Kalau Membuat Template Category, Tags, dan Archive tapa perlu Plugin.
  2. Untuk Membuat Template Post harus Menggunakan Plugin.
  3.  
  4. Cara membuat single template flexithemes
  5.  
  6. 1. Instal plugin: https://wordpress.org/plugins/single-post-template/
  7.  
  8. 2. copy post.php menjadi post-single-slug.php, letakkan kode berikut paling atas:
  9. <?php
  10. /*
  11. Single Post Template: post-single-slug
  12. Description: This part is optional, but helpful for describing the Post Template
  13. */
  14. ?>
  15.  
  16. 3. copy single.php menjadi single-slug.php
  17.  
  18. 4. edit single-slug.php, ganti seperti berikut:
  19.  
  20. <?php
  21. if (have_posts()) : while (have_posts()) : the_post();
  22. /**
  23. * Find the post formatting for the single post (full post view) in the post-single.php file
  24. */
  25. get_template_part('post-single-SLUG', 'single-SLUG');
  26. endwhile;
  27.  
  28. else :
  29. get_template_part('post-single-SLUG', 'noresults');
  30. endif;
  31. ?>
  32.  
  33. 5. Pilihan template muncul pasa saat kita posting.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement