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

the_content(); Tolong dong..

Discussion in 'Wordpress' started by zebadee, Oct 15, 2014.

  1. zebadee

    zebadee Ads.id Starter

    Joined:
    Apr 29, 2011
    Messages:
    73
    Likes Received:
    1
    gan.. ane mau nampilin content yang di single.php di adain di image.php atau di attachment.php,
    ane udah tambah <?php the_content(); ?> sekitar loop di image.php tpp gagal euy... ada yang bisa bantu gak ya..

    mksh
     
  2. amild

    amild Ads.id Pro

    Joined:
    Nov 29, 2012
    Messages:
    347
    Likes Received:
    71
    Location:
    Makassar
    Coba edit seperti ini untuk menampilkan kontennya gan
    PHP:
    <?php if (have_posts()) : while (have_posts()) : the_post();?>
    <?php the_content
    (); ?>
    <?php 
    endwhile; endif; ?>
     
    Last edited: Oct 15, 2014
  3. nichpakaich

    nichpakaich Ads.id Fan

    Joined:
    Dec 7, 2009
    Messages:
    112
    Likes Received:
    5
    Location:
    Medan
    mening di paste image.php dan single.php nya disini..
    tapi menurut ane, mening agan cari orang yang bisa php aja biar lebih cepet :)

    Sekdar saran, kalau bisa jangan full content artikel, tapi excerpt aja ;)

    semoga berguna.
     
  4. golekdollar

    golekdollar Ads.id Fan

    Joined:
    Jun 19, 2013
    Messages:
    122
    Likes Received:
    3
    coba di paste skrip single anda kesini gan biar kita cek bareng2 :D
     
  5. Aldy's Web Designer

    Aldy's Web Designer Ads.id Starter

    Joined:
    Jul 21, 2012
    Messages:
    53
    Likes Received:
    0
    Location:
    Skyscrapper
    Harus di ambil dulu function nya gan kyknya.. dari functions.php tujuanya ngasih tau file yg agan include klo si image.php atau attachment.php adalah bagian dari hierarchy ..
     
  6. nasdin

    nasdin Super Hero

    Joined:
    May 28, 2013
    Messages:
    806
    Likes Received:
    182
    PHP:
    function attachmentExcerpt($content){
        global 
    $post;
        if (
    is_attachment()){
            
    $content get_post$post->post_parent );
            
    $content wp_trim_words$content->post_content 80 '');
        }
        return 
    $content;
    }
    add_filter('the_content','attachmentExcerpt');
    kalo di image.php atawa attachment.php udah ada the_content harusnya nanti bakal ada excerpt dari single post
     

Share This Page