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

[ Ask ] Cara edit featured image

Discussion in 'Wordpress' started by domxdio, Aug 14, 2012.

  1. domxdio

    domxdio Newbie

    Joined:
    Sep 2, 2007
    Messages:
    39
    Likes Received:
    1
    ane mau tanya kepada para master wp nih

    gimana cara manggil featured image tp menggunakan kolom custom fileds ....

    ane pengen memasukan gambar manual dgn perintah custom fileds ...
    ane tp gak mau mengunakan bawaannya wp terbaru yg tinggal click " Use as featured image" ..

    ane pengen modif themes dan kadang2 gambar yg mau saya pakai adalah gambar copas url web lain heheheheee :-$


    oh ya satu lagi....
    apakah semua themes yg suport featured image bisa di modif cara manggil nya pakai " custom fileds"
     
    Last edited: Aug 14, 2012
  2. gembel-intelek

    gembel-intelek Lurker

    Joined:
    Mar 29, 2009
    Messages:
    4,341
    Likes Received:
    907
    Location:
    New Coral
    PHP:
    <?php if ( get_post_meta($post->ID'thumb_custom_field'true) ) : ?>
        <a href="<?php the_permalink() ?>" rel="bookmark">
            <img class="thumb" src="<?php echo get_post_meta($post->ID'thumb_custom_field'true?>" alt="<?php the_title(); ?>" />
        </a>
    <?php elseif ( has_post_thumbnail($post->ID)) : ?>
        <a href="<?php the_permalink() ?>" rel="bookmark">
            <?php echo get_the_post_thumbnail($post->ID);
        </
    a>
    <?
    php endif; ?>
    dimana thumb_custom_field adalah key untuk custom field yg dimaksud
    kalo di custom field ga ada, baru nyari di featured image
     
  3. domxdio

    domxdio Newbie

    Joined:
    Sep 2, 2007
    Messages:
    39
    Likes Received:
    1
    makasih....
    itu di taruh di themes ya.... ( index.php ama singgle.php )
    aku cobanya dulu ...
     

Share This Page