Auto Excerpt Posts Wordpress

Discussion in 'WordPress' started by Fahmi, Sep 13, 2014.

  1. Fahmi

    Fahmi Newbie

    Joined:
    Dec 5, 2012
    Messages:
    1,719
    Likes Received:
    159
    Trophy Points:
    63
    Google+:
    Logika Auto Exceprt Wordpress sama Blogspot sebenarnya tidak jauh berbeda, sama sama menggunakan istilah tag conditional gitu yah, iseng saya mencoba Auto Exceprt Wordpress menggunakan function dan merubah content.php

    Berikut cara nya :

    1. Function.php , baris berikut untuk menambahkan link readmore :
    Code:
    function new_excerpt_more($more) {
           global $post;
        return '<a class="moretag" href="'. get_permalink($post->ID) . '"> [read more]...</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');
    
    2. Lalu Content.php , sederhananya dengan conditional tag versi wordpress, jika page search, home, categori, arsip dan tag tampilkan excerpt dan jika lainnya tampilkan full :

    Code:
    <?php if ( is_search() || is_home() || is_category() || is_archive() || is_tag() ) : ?>
               
    // Tampilkan Excerpt
        <?php the_excerpt(); ?>
    
    <?php else : ?>
    
    // Tampilkan Full
    
    <?php the_content(); ?>
    
    <?php endif; ?>
    Itu hanya sebuah contoh saja, kamu bisa memasukkan beberapa markup dari template kamu sendiri :D

    Referensi :

    http://codex.wordpress.org/Excerpt

    :)
     
  2. Ardilas

    Ardilas Super Level

    Joined:
    Feb 18, 2013
    Messages:
    4,243
    Likes Received:
    317
    Trophy Points:
    83
    Google+:
    Lagi otak-atik WP yah. Saya sudah lama tidak pegang WP. Hahaha.
     
  3. Fahmi

    Fahmi Newbie

    Joined:
    Dec 5, 2012
    Messages:
    1,719
    Likes Received:
    159
    Trophy Points:
    63
    Google+:
    Iya, enak yaah udah lama gk lihat WP pas kmaren ada update aja ramai kan ke Wordpress 4 :D
     
  4. fikrishare

    fikrishare Member

    Joined:
    May 1, 2014
    Messages:
    109
    Likes Received:
    7
    Trophy Points:
    18
    Google+:
    blog saya udah bawaan theme :D
     
  5. Fahmi

    Fahmi Newbie

    Joined:
    Dec 5, 2012
    Messages:
    1,719
    Likes Received:
    159
    Trophy Points:
    63
    Google+:
    :D yah memang enak kalau sudah bawaan theme , kalau masih awal kan bingung masa harus insert melulu dari postingan hehehe
     
  6. Ardilas

    Ardilas Super Level

    Joined:
    Feb 18, 2013
    Messages:
    4,243
    Likes Received:
    317
    Trophy Points:
    83
    Google+:
    Jadi pingin pake nih. Kebetulan lagi bikin situs baru :)
    Kalau master kayak Mas @Fahmi pasti punya tantangan tersendiri buat obrak-abrik theme yang ada :)
     
  7. Fahmi

    Fahmi Newbie

    Joined:
    Dec 5, 2012
    Messages:
    1,719
    Likes Received:
    159
    Trophy Points:
    63
    Google+:
    Ada free theme kualitas bagus nih :D mau gk?
     
  8. wulandari

    wulandari Member

    Joined:
    Aug 10, 2014
    Messages:
    302
    Likes Received:
    25
    Trophy Points:
    28
    Google+:
    om bagi om
     
  9. debays

    debays Active Member

    Joined:
    Jul 18, 2014
    Messages:
    1,409
    Likes Received:
    58
    Trophy Points:
    48
    ga ngerti kode2 seperti ini, jadi numpang nyimak dulu ah..
     
  10. Yulia Atmawati

    Yulia Atmawati New Member

    Joined:
    Sep 13, 2014
    Messages:
    12
    Likes Received:
    4
    Trophy Points:
    3
  11. Yusuf.S

    Yusuf.S Well-Known Member

    Joined:
    May 4, 2014
    Messages:
    1,155
    Likes Received:
    100
    Trophy Points:
    63
    Google+:
  12. Lano pratama

    Lano pratama Member

    Joined:
    Aug 26, 2014
    Messages:
    124
    Likes Received:
    3
    Trophy Points:
    18
    Google+:
    Jujur ko ane lebih suka pake blogspot yah ketimbang wp, ntah kenapa padahal banyak orang bilang enakan pake wp
     
  13. Fahmi

    Fahmi Newbie

    Joined:
    Dec 5, 2012
    Messages:
    1,719
    Likes Received:
    159
    Trophy Points:
    63
    Google+:
    Wah ini kayaknya khusus SelfHosted deh :D
     
  14. Yusuf.S

    Yusuf.S Well-Known Member

    Joined:
    May 4, 2014
    Messages:
    1,155
    Likes Received:
    100
    Trophy Points:
    63
    Google+:
    Yahh sayang banget
     
  15. Heru Firmansyah

    Heru Firmansyah Member

    Joined:
    Aug 24, 2014
    Messages:
    154
    Likes Received:
    4
    Trophy Points:
    18
    responsive akan terlihat lebih mantap tuh kalau pake plugin dan widget yang keren, boleh dicoba:)
     
  16. ripal

    ripal New Member

    Joined:
    Sep 6, 2014
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    6
  17. Heru Firmansyah

    Heru Firmansyah Member

    Joined:
    Aug 24, 2014
    Messages:
    154
    Likes Received:
    4
    Trophy Points:
    18
    sebagai referensi untuk menambah wawasan juga pengetahuan, kita dapat belajar dari beberapa tutorial yang membahas mengenai WP, silahkan dicoba..:)
     
  18. ripal

    ripal New Member

    Joined:
    Sep 6, 2014
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    6
    sipaa masss ;)
     
  19. Grant Verleend

    Grant Verleend Active Member

    Joined:
    Sep 10, 2014
    Messages:
    1,234
    Likes Received:
    35
    Trophy Points:
    48
    Google+:
    Anak indonesia gak kalah kreative dengan anak luar negeri
     
  20. Ardilas

    Ardilas Super Level

    Joined:
    Feb 18, 2013
    Messages:
    4,243
    Likes Received:
    317
    Trophy Points:
    83
    Google+:
    Boleh.
     
Loading...
Similar Threads - Auto Excerpt Posts
  1. Priana Saputra
    Replies:
    0
    Views:
    1,129

Share This Page