Wordpress – Membuat Komentar dari Author terlihat Beda

Category: 3.Tutorial Wordpress | 15 July 2009 | Comments: 4 Comments

Salah satu dan salah banyak tentang WordPress adalah kemungkinan bagi penggunanya untuk mendesain sedemikian rupa sehingga lebih nyaman dipakai. Pada sesi ini saya akan memberikan tips sederhana agar Komentar dari Penulis terlihat berbeda tampilannya sehingga akan memudahkan reader.

Buka File comments.php kemudian cari baris ini (mungkin baris ini terlihat sedikit berbeda)

1
<li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">

Kemudian rubahlah code tersebut menjadi seperti ini

1
2
<li class="<?php if($comment->comment_author_email == get_the_author_email()) { echo "author-comment"; } else { ?>comment 
<?php echo $oddcomment; } ?>" id="comment-<?php comment_ID();$ix++; ?>">

Seperti terlihat, ada code tambahan yang akan di eksekusi ketika author melakukan komentar bukan? dimana sewaktu author melakukan komentar akan muncul class tambahan author-comment

Langkah selanjutnya adalah memberikan code css untuk author comment tersebut, caranya buka file style.css dan tambahkan kode ini (kode ini terserah tiap pengguna, yang jelas bertujuan membuat tampilan beda dari sang author itu)

1
2
3
4
.author-comment {
	background: #efefef;
	border-bottom: 1px solid #999;
}

Selamat Mencoba…

Dibaca Sebanyak: 709 kali

4 Responses to “Wordpress – Membuat Komentar dari Author terlihat Beda”

  1. thanks infonya … google telah membawaku kesini … keep on post …

  2. Extenze says:

    Keep working ,great job!

  3. thanks mas. patut di coba nih

  4. extenze says:

    It is great to have the ability to read a good quality blog with useful details on topics that plenty are interested on. The fact that the data indicated are all first hand on live experiences even help more. Continue doing what you do as we enjoy reading your work.

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word


Subscribe without commenting