Menampilkan image dengan custom field di WordPress 2.7.1

March 25th, 2009 § 2,254 comments

Menampilkan image thumbnail dari setiap post di halaman depan blog. Untuk WordPress 2.7.1

Contoh:

hd film

despicable me move
buy scarface film on dvd

1a

screenshot from

fast five on dvd

Pada WP Admin, pilihlah salah satu post yang akan dibuatkan image thumbnail-nya untuk dimunculkan di halaman depan.

watch braveheart full film good quality
watch harry potter and the deathly hallows: part 1 hd
the shining move
mars needs moms the movie to download
dvd season of the witch

  1. Dalam menu edit sebuah post, buatkan custom field pada sebuah post dengan key “the_excerpt_image ” pada menu custom field di bagian bawah halaman edit post.
  2. 2

  3. Upload image dengan ukuran thumbnail (besar pixel width dan height bebas sesuai theme), lalu gunakan fungsi upload pada wp-admin untuk meletakkan image tersebut di wp-content/uploads.
  4. Copy URL image location dari hasil upload tersebut. Contoh url location:  http://localhost/wordpress27/wp-content/uploads/2009/01/sony_ericsson_w902_thumb.jpg
  5. Pada custom field dengan key “the_excerpt_image” yang tadi dibuat, buatkan code html untuk menampilkan image pada kolom value di sebelahnya. Contoh: <img src="" alt=""/>
  6. Paste url location image-nya di tag src=”". Contoh: <img src="http://localhost/wordpress27/wp-content/uploads/2009/01/sony_ericsson_w902_thumb.jpg" alt="image"/>
  7. Klik tombol Update post untuk menyimpan hasil editing barusan.
  8. Pada menu admin, bukalah Editor yang ada di dalam menu Appereance untuk mengedit file themes.
  9. Pilih file index.php (Main index template). Kita akan menambahkan sebaris code php untuk menampilkan image di dalam custom field tadi.
  10. Di dalam file index.php, temukan baris code <?php if (have_posts()) : while (have_posts()) : the_post(); ?>.  Baris ini adalah baris awal fungsi loop wordpress yang menampilkan semua post di halaman depan. Sebelumnya, pastikan CHMOD file index.php ke 777 untuk membuat file ini editable. Lalu copy code ini:

//show small image from custom field

$key="the_excerpt_pict";

echo get_post_meta($post->ID, $key, true);
?>


dan kemudian paste di dalam loop dimana thumbnail image tadi akan dimunculkan. Contoh:

the clinic movie on dvd

<?php if (have_posts()) : ?>

watch no strings attached online

<?php while (have_posts()) : the_post(); ?>

where can i buy sin city the film

<div <?php post_class() ?> id="post-<?php the_ID(); ?>">

<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>

<div class="entry">
<?php

//show small image from custom field the_excerpt_pict

$key="the_excerpt_pict";

echo get_post_meta($post->ID, $key, true);

?>


<?php the_content('Read the rest of this entry &raquo;'); ?>

</div>

download the chronicles of narnia: the voyage of the dawn treader movies

<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p>
</div>

<?php endwhile; ?>

<?php else : ?>


notes:  loop di atas diambil dari index.php dari themes default wordpress

10. Klik tombol Update file untuk menyimpan hasil editing pada file index.php barusan.

download the king’s speech film in hd formats

11. Refresh halaman depan blog Anda untuk melihat hasilnya.

§ 2,254 Responses to Menampilkan image dengan custom field di WordPress 2.7.1"

  • PanDe Baik says:

    Damn ! tadi lupa nanyain cara instalasi WP 2.7. di BLoG nok….

  • Radi says:

    Wah terimakasih atas ilmunya, ini yang saya cari…

  • Gobi says:

    Terima Kasih banyak om noviar , berkat artikel ini, 19 jam ku hari ini tidak sia2.
    susah sekali abis ngubek2 Google selama 2 harian ternyata seperti ini caranya bikin thumbnail post

    Terima kasih sekali lagi

    gb

  • azzaam says:

    siiplah, thanks banget and salam kenal :)

  • Webcam Sex says:

    That’s because we just don’t fall for their lines, Susan, we fall for their sad stories and they all have one. The sad story turns off our bullshit meter and that’s when we’re ripe to fall for the same, old lines and same, old song sung by a different singer, in a different key, with a different tune, and a different name, while believing that he’s different and not like all the others, when he is. Women are just saps and suckers

  • Menampilkan image dengan custom field di wordpress.. WTF? :)

  • lig tv izle says:

    Yazılarınızı daha sık yazmanızı isterim Her Geldiğimizde güncel Yazı Görmek bizi Sevindirir.

  • Tattoo Fonts says:

    Good post however , I was wanting to know if you could write a litte more on this subject? I’d be very thankful if you could elaborate a little bit further. Bless you!

  • Gema Mcnees says:

    Did you all attending how considerably typewritten this send is? I mingy, it is cleared that the illustrator wants to inform us then influence, which is a big . I can definitely attention that behindhand product there lies several hempen . I would also convey that with each placard, you also code one inquiry to your readers, in impose to get more opinions, and to make for few pleasant discussions on here!

  • Hi everyone I read the information you shared here and I wanted to say you guys need to continue to add more content. It’s extremely interesting to us readers and I will likely be back. I will post with my online buddies. Keep it up!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

What's this?

You are currently reading Menampilkan image dengan custom field di WordPress 2.7.1 at viar ms.

meta