Top Ad unit 728 × 90

Cara Edit Comment WordPress (Custom)

Bagaimana Cara Membuat Custom Comment di WordPress ? Cara nya cukup simpel kok .
Pertama – tama , kita buat dulu file baru php dengan nama comments.php 
Terus masukikan script dibawah ini ke comments.php 

<div class='disqusmen'>

<h3 id='comments'><?php comments_number( '0 Comments' ); ?></h3>
<div style="font-size: 12px; background: #e7e7e7; padding: 10px; border: 1px solid #ddd;">Maaf jika komentar yang ditujukan kepada admin tidak/belum ditanggapi. Mungkin saat itu admin sedang asik nonton JAV </div>
<div class="comment-form">
            <h3 id='comments'> Leave a Reply </h3>
          <?php if (function_exists('wp_list_comments')) : ?>
<?php
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if ( post_password_required() ) { ?>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
?>
<!-- EDIT MULAI DARI SINI YAH -- >
<?php if ( have_comments() ) : ?>

<?php else : // bagian ini notif jika tidak ada komentar sama sekali ?>
<?php if ('open' == $post->comment_status) : ?>
<?php endif; ?>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>

<div class="respond"><a name="respond"></a> <div class="cancel-comment-reply"> <?php cancel_comment_reply_link(); ?> <div class="clr"></div>
</div>

<?php if ( get_option('comment_registration') && !$user_ID ) : ?> <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
<?php else : ?>


<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?> <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Log out &raquo;</a></p>

<?php else : ?>
<?php endif; ?>

<p><textarea name="comment" id="comment" placeholder="Join the Discussion..." cols="100%" rows="10" tabindex="4"></textarea></p>
<input type="text" name="author" id="author" placeholder="Name" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?>
<p><input type="text" name="email" id="email" placeholder="Email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
<div class="kaskusonclick" style="margin-top: 20px;"><span id="kaskusemoticonslink" style="cursor: pointer; margin: 10px 2px; width: 130px; font-size: 13px; color: #333; background: #ddd; padding: 7px; text-align: center" onclick="kaskusemoticonsclink()">[+] Lihat Emoticon</span><button name="submit" type="submit" id="submit">Post Comment</button></div>
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; ?>
</div>
<?php endif; ?><?php else: ?><?php // jangan hapus bagian line ini !
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {
?>
<p class="nocomments">This post is password protected. Enter the password to view comments.<p>
<?php
return;
}
}

$oddcomment = 'comment1';
?>
<h2>Comments<?php comments_number('', ' (1)', ' (%)' );?></h2>
<?php comments_number('<p>No Comments</p>', '', '' );?>
<?php if ($comments) : $first = true; ?>
<?php foreach ($comments as $comment) : ?>
<div class="<?php echo $oddcomment; ?><?php if ($first) { echo ' first'; $first = false; } ?>" id="comment-<?php comment_ID() ?>">
<div class="commentdetails">
<p class="commentauthor"><?php comment_author() ?></p>
<?php if ($comment->comment_approved == '0') : ?>
<em>Your comment is awaiting moderation.</em>
<?php endif; ?>
<p class="commentdate"><?php comment_date('F jS, Y') ?> at <?php comment_time() ?> <?php edit_comment_link('Edit Comment','',''); ?>
</p>
</div>
<?php dp_gravatar(); ?>
<br class="break" />
<?php comment_text() ?>
</div>
<?php endforeach;  ?>
<?php endif; ?>
<h2 id="respond">d</h2>
<?php if ('open' == $post->comment_status) : ?>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>
<?php else : ?>
<p><input size="36" type="text" name="author" /> Name <span class="required">*</span></p>
<p><input size="36" type="text" name="email" /> Mail <span class="required">*</span></p>
<?php endif; ?>
<p><textarea rows="12" cols="42" name="comment"></textarea></p>
<p><button name="submit" type="submit" id="submit" tabindex="5">Submit Comment</button>
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; ?>
<?php endif; ?>

<?php endif; ?>
<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
<ol class="commentlist">
<?php wp_list_comments(); ?>
</ol>
</div></div>
"Pelajari Struktur Script komentar di atas dengan teliti"
Lalu, pergi ke single.php / single-page.php , Jika kalian tidak menemukan kode seperti inisilahkan tambahkan kode dibawah ini di template anda

Note : ini adalah Kode untuk Menampilkan Script Komentar tadi
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php echo get_post_meta($post->ID, "embed", true); ?>
<?php comments_template(); ?>
<?php endwhile; endif; ?>
Menambahkan CSS lalu masukkan ke style.css

/* Custom Comment CSS */
.disqusmen {padding: 10px;margin: 10px 0px;background: #F2F2F2 none repeat scroll 0% 0%;border: 1px solid #ddd;border-top-left-radius: 10px;border-top-right-radius: 10px;}
.comment a{color:#51504a;text-decoration:none;}
.commentlist li .avatar{float:left;background:#fff;margin-right:10px;border:3px solid #eee;border-radius:99px;width:42px;height:42px;}
.commentlist cite,.commentlist cite a{font-weight:bold;font-style:normal;font-size:14px;color:#555;display:block;overflow:hidden;text-overflow:ellipsis;padding-top:15px;}
.commentlist p{font-weight:normal;line-height:1.5em;text-transform:none;}
#commentform p{}
.commentmetadata{font-weight:normal;float:right;font-size:11px;}
h3.comments{padding:0;margin:40px auto 20px;color:#444444;}
h3#comments{padding:0;margin:10px 0 10px 0px;color:#555;font-size:1.17em;font-family:arial;width:100%;}
#respond{margin:0;padding:0;color:#555;font-family:arial;}
h3.respond{padding:0;margin:10px 0 10px 0px;color:#444444;}
#respond h3{font-size:1.17em;width:100%;padding:0;margin:10px 10px 10px 0px;color:#444444;}
.alt{margin:0;padding:10px;}
.commentlist{padding:0;text-align:justify;margin:0;font-family:arial;}
.commentlist li{background-position:right bottom;background-repeat:no-repeat;background-color:#FFF;margin:0px 0px 10px;padding:10px;list-style:outside none none;border:1px dotted #DDD;box-shadow:1px 2px 3px #CCC;}
.commentlist li ul li{background-color:#FFFFFF;margin-right:-5px;margin-left:10px;margin-top:10px;border:none;box-shadow:none;}
.comment-author{min-height:60px;border-bottom:1px solid #CCC;}
.commentlist p{margin:10px 5px 10px 0;}
.children{padding:0;}
#commentform p{margin:5px 0 0 0px;}
.nocomments{text-align:center;margin:0;padding:0;}
.commentmetadata{margin:-44px 0px;display:block;}input{font-family:"Trebuchet MS";width:170px;padding:2px;margin:5px 5px 1px 0;}
#author,#email{height:25px;width:200px!important;font-size:14px;border:2px solid #CCC!important;border-radius:5px;padding:13px 5px!important;}
#cancel-comment-reply-link{font-size:11px;margin:0px 10px;}
.comment-notes{display:none;}
#commentform{margin:5px 10px 25px 0;}textarea{width: 98%;height: 80px;border-radius: 5px;border: 2px solid #CCC;font-size: 15px;padding: 10px 5px;}
#respond:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
#commentform #submit{margin:0px 0px 5px auto;float:right;background:#333;border:1px solid #333;color:#eee;font-size:14px;cursor:pointer;border-radius:5px;width:130px;}.reply{width:44px;padding:2px;text-align:center;color:#888;border:1px solid #DDD;background:#FAFAFA;}
.reply a{color:#777;}
.says{display:none;}
Cara Edit Comment WordPress (Custom) Reviewed by Admin on 02.03 Rating: 5

Tidak ada komentar:

All Rights Reserved by ARAWED © 2014 - 2017
Website by GIU-Developers

Formulir Kontak

Nama

Email *

Pesan *

Diberdayakan oleh Blogger.