[Tips] Menampilkan Hanya Judul Artikel Di Halaman Archive
Dalam 2 minggu terakhir ini, ada 3 orang yg menanyakan bagaimana cara menampilkan judul artikel atau posting saja di halaman archive (kategori). Salah satunya via PM di forum. Dan karena sejak gempa lalu entah kenapa cuma bisa akses forum pake HP, jadi sekalian aja di-post di sini.
Pada intinya, untuk menampilkan hanya judul artikel saja di halaman kategori adalah dengan memodifikasi template Archive dan menghilangkan pemanggilan fungsi the_content(). Sebagai contoh akan digunakan theme bawaan Wordpress, yaitu Kubrick.
- Buka archive.php menggunakan text editor atau melalui Presentation - Themes Editor - Archives.
- Cari bagian looping Wordpress.
< ?php while (have_posts()) : the_post(); ?>
<div class=”post”>
<h3 id=”post-< ?php the_ID(); ?>“><a href=”< ?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to < ?php the_title(); ?>“>< ?php the_title(); ?></a></h3>
<small>< ?php the_time('l, F jS, Y') ?></small>
<div class=”entry”>
< ?php the_content() ?>
</div>
<p class=”postmetadata”>Posted in < ?php the_category(', ') ?> | < ?php edit_post_link('Edit', '', ' | '); ?> < ?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
< ?php endwhile; ?></a> - Hilangkan baris berikut:
<div class="entry">
< ?php the_content() ?>
</div>sehingga menjadi:
< ?php while (have_posts()) : the_post(); ?>
<div class=”post”>
<h3 id=”post-< ?php the_ID(); ?>“><a href=”< ?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to < ?php the_title(); ?>“>< ?php the_title(); ?></a></h3>
<small>< ?php the_time('l, F jS, Y') ?></small>
<p class=”postmetadata”>Posted in < ?php the_category(', ') ?> | < ?php edit_post_link('Edit', '', ' | '); ?> < ?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
</div>
< ?php endwhile; ?>Simpan dan lihat hasilnya.
- Untuk benar2 menyisakan judul artikel saja, ubah menjadi sebagai berikut:
< ?php while (have_posts()) : the_post(); ?>
<div class=”post”>
<h3 id=”post-< ?php the_ID(); ?>“><a href=”< ?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to < ?php the_title(); ?>“>< ?php the_title(); ?></a></h3>
</div>
< ?php endwhile; ?>
Semoga bermanfaat :)
PPS: CAN membuka lowongan gelombang kedua untuk posisi content writer (fulltime). Baca detilnya di sini.







Thanks mas cosa…ini sangat bermanfaat buat saya…mas, kalo cara menampilkan summary aja gimana yah? kok saya coba gak bisa aktif:( sorry pemula wordpress neh;)
@didin
maksudnya summary itu yg kyk gmn ya? excerpt?
mas, kalo mo yg ditampiling di depan hasil posting kategori tertentu saja gimana?
mohon bantuannya
udah dicobain…e malah tampilan theme nya kacau balau :(
kayaknya perlu ditambahin pointnya:
is_home,is_cat,is_archive,is_single, etc.
soalnya tersesat juga gara2 variable itu :D
kali aja om KIDS bisa lengkapin nih code, abis ini punya ana jg berantakan
Mas Cosa new bie nih … tolong donk ulas tentang chanel ?
halo mas Khoresh. maksudnya chane itu apa chanel google adsense ya? kalau itu sih gunanya untuk memudahkan kita aja mengetahui performance google adsense kita. jadi kita bisa tau CTR masing-masing kode yang kita pasang. cara buatnya di halaman google adsense setup
mas..kasi cara buat navigasi di archive kategori donk
yg gini nieh…
Pages (6): [1] 2 3 4 » … Last »
itu pake plugin WP page navi. bisa dilihat di
http://www.lesterchan.net/portfolio/programming.php
makasi mass…that was fast…
You’re welcome. Mumpung lagi ngejar setoran he he
mas cosa, gmn cara buat kategori yang isinya archive di group per bulan, trims
http://www.cosaaranda.com/menyulap-halaman-archives-wordpress-menjadi-sitemap.htm
mas cosa, cuman mau sedikit koreksi.
itu codenya seharusnya bukan
“>” rel=”bookmark” title=”Permanent Link to “>
Posted in |
dan untuk benar2 menyisakan judul artikel saja, ubah menjadi sebagai berikut:
“>” rel=”bookmark” title=”Permanent Link to “>
tapi sayang ya mas cosa, sekarang themes-themes yang mendukung widget kayaknya sudah tidak menyertakan file archive.php lagi. saya sudah pakai beberapa themes yang ternyata tidak menggunakan archive.php. kalau sudah begini, gimana dong?
hahah LOL so what the problem, if the themes doesnt have a archives file, just made by your self, just simple like that
all file on themes actually same except the
header.php
footer.php
sidebar.php
comment.php
searchform.php
beside of that the main file like
index.php
singles.php
search.php
archives.php
style.css
all same, what make different is modification on
for example, if in the searh result you want to show the news but dont wanna show (READMORE) link, you just change the_content() into the_excerpt() and many more, just use ur imagination
^^
ps : if u want most simple themes u also can only add 3 file to make themes
index.php
comment.php
style.css
and here we go, you already have the themes
mas aku udah coba upload archives.php dari themes defaultnya wp, tapi hasilnya kok jadi aneh tulisan judul archivesnya tumpang tindih ama headernya gmn ya..
Bung Cosa, blog saya kok aneh ya. Kalau saya baca artikel nya Bung Cosa ini, kan masih ada widget2 seperti category, rchives, dll.
Sedangkan punya saya, begitu saya pilih salah satu post, widget2 ini ilang semua. Kan nanti visitor jadi kesasar, dan ga bisa awet baca semua blog saya. Gimana ya caranya?
Mohon petunjuk, maklum newbie..
Matur nuwun atas tipsnya… bisa bekerja dengan baik.