1. Halo Guest, pastikan Anda selalu menaati peraturan forum sebelum mengirimkan post atau thread baru.

[ASK] Design Blog post excerpt problem

Discussion in 'Desain Web & Grafis' started by wahyusetyobudi, Jan 20, 2012.

  1. wahyusetyobudi

    wahyusetyobudi Ads.id Starter

    Joined:
    Feb 10, 2011
    Messages:
    83
    Likes Received:
    0
    Saya mau tanya, saya kan lagi oprek2 theme, nah di default theme itu gak ada post excerpt yang dipanggil (karena theme wallpaper), nah saya ingin ngerubah theme itu jadi theme buat article, saya panggil excerpt dengan :

    <?php the_content_rss('', TRUE, '', 40); ?>

    Script itu bisa berjalan dengan bagus di Firefox, tapi d browser lain tetep gak bisa batesin manggil 40 kata aja, ada saran gak gan gmana enaknya?
     
  2. PHDLover

    PHDLover Super Hero

    Joined:
    Mar 13, 2011
    Messages:
    752
    Likes Received:
    546
    bukannya bisa pake kode the_excerpt aja gan.. :hmm:
     
  3. wahyusetyobudi

    wahyusetyobudi Ads.id Starter

    Joined:
    Feb 10, 2011
    Messages:
    83
    Likes Received:
    0
    kalo pake itu gak bisa dilimit gan, yang diambil 55 kata pertama.

    kalo 55 kata itu terlalu banyak buat di theme blog saya..
     
  4. gembel-intelek

    gembel-intelek Lurker

    Joined:
    Mar 29, 2009
    Messages:
    4,341
    Likes Received:
    907
    Location:
    New Coral
    By default, excerpt length is set to 55 words. To change excerpt length using excerpt_length filter, add the following code to functions.php file in your theme:

    PHP:
    function custom_excerpt_length$length ) {
    return 
    40

    add_filter'excerpt_length''custom_excerpt_length'999 ); 

    http://codex.wordpress.org/Function_Reference/the_excerpt

    By default, excerpt more string at the end is set to '[...]'. To change excerpt more string using excerpt_more filter, add the following code to functions.php file in your theme:

    PHP:
    function new_excerpt_more($more) {
     return 
    '[.....]'

    add_filter('excerpt_more''new_excerpt_more'); 
    Place this in a theme's functions.php to make the "read more" link to the post
    PHP:
    function new_excerpt_more($more) {
     global 
    $post;   
    return 
    '<a href="'get_permalink($post->ID) . '">Read the Rest...</a>'

    add_filter('excerpt_more''new_excerpt_more'); 
     
  5. irulsastra

    irulsastra Newbie

    Joined:
    Jun 30, 2008
    Messages:
    22
    Likes Received:
    0
    Location:
    yogyakarta
    kalo pengin gampang cari aja pluginnya:D
     

Share This Page