رفتن به مطلب

تغییر نام نمایش مدیر در کامنت ها


پست های پیشنهاد شده

با سلام و احترام

به مدیریت وردپرس خود بروید

کاربران > شناسنامه شما

در این قسمت در فیلد لقب نام دلخواه خود را وارد کنید و از قسمت نمایش عمومی نام مقدار را بر روی نامی که در لقب قرار دادید قرار دهید ، و ذخیره کنید.

موفق باشید

ویرایش شده توسط امیر حسین حبیبی
لینک به ارسال

با سلام و احترام

به مدیریت وردپرس خود بروید

کاربران > شناسنامه شما

در این قسمت در فیلد لقب نام دلخواه خود را وارد کنید و از قسمت نمایش عمومی نام مقدار را بر روی نامی که در لقب قرار دادید قرار دهید ، و ذخیره کنید.

موفق باشید

همین کار

رو کردم اما نشد

لینک به ارسال

پس احتمالا باید قالب ویراش شود

لطفا فایل comment.php را قرار دهید

لینک به ارسال

<?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() )
return;
?>
<div class="comments_box">
<div class="comment-title">

</div>
<div class="comments-inner container">
<div class="send_comment_form">
<?php omidnikrah_comment_form(); ?>
</div>

<?php if ( have_comments() ) : ?>
<div class="users_comments">
<?php wp_list_comments( array( 'callback' => 'omidnikrah_comment', 'style' => '' ) ); ?>
<!-- .commentlist -->

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>

<?php endif; // check for comment navigation ?>





<?php
/* If there are no comments and comments are closed, let's leave a note.
* But we only want the note on posts and pages that had comments in the first place.
*/
if ( ! comments_open() && get_comments_number() ) : ?>
<p class="nocomments"><?php _e( 'Comments are closed.' , 'farsifa' ); ?></p>
<?php endif; ?>
</div>
<?php endif; // have_comments() ?>
</div>
</div>

لینک به ارسال

لطفا این فانکشن هم omidnikrah_comment قرار دهید ممنون میشم

لینک به ارسال

فکر میکنم این باشه :


function omidnikrah_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>

<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<p><?php _e( 'Pingback:', 'omidnikrah' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'omidnikrah' ), '<span class="edit-link">', '</span>' ); ?></p>
<?php
break;
default :
// Proceed with normal comments.
global $post;

//Check Whether the comment is a Respond or Not
global $wpdb;
$get_comment_ID = get_comment_ID();
$respond_query = "SELECT * FROM $wpdb->comments
WHERE comment_ID = {$get_comment_ID}";
$rsp = $wpdb->get_results($respond_query);

?>

<div class="comment row<?php foreach ($rsp as $rs) {
if($rs->comment_parent == 0) : echo ""; else : echo " replied"; endif;

} ?>" id="li-comment-<?php comment_ID(); ?>">

<div class="avatar-reply col">
<?php echo get_avatar( $comment, 100 ); ?>
</div>
<div class="comment-body">
<div class="comment-body-top row">
<a class="author" href="<?php comment_author_url(); ?>" rel="nofollow" title="مشاهده وب سایت <?php comment_author(); ?>"><?php comment_author(); ?></a>
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'نظرتون رو میخونم بعدش میزارم همه ببینن', 'omidnikrah' ); ?></p>
<?php endif; ?>
<span class="date"><?php comment_date(__('jS F, Y','kubrick')) ?> </span>
</div>
<p id="comment-<?php comment_ID(); ?>" class="comment-texttt">

<section class="comment-content">
<?php comment_text(); ?>
<?php edit_comment_link( __( 'Edit', 'omidnikrah' ), '<p class="edit-link">', '</p>' ); ?>
</section><!-- .comment-content -->
<span class="pasokh"><?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'جوابشو بده', 'omidnikrah' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> </span>


</p><!-- #comment-## -->
</div>

</div>
<?php
break;
endswitch; // end comment_type check
}

function omidnikrah_comment_form( $args = array(), $post_id = null ) {
global $id;
if ( null === $post_id )
$post_id = $id;
else
$id = $post_id;
$commenter = wp_get_current_commenter();
$user = wp_get_current_user();
$user_identity = $user->exists() ? $user->display_name : '';
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$fields = array(
'author' => '<input class="send-form-input" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '"' . $aria_req . ' placeholder="اسمتون چیه؟ ">',
'email' => '<input class="send-form-input" id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '"' . $aria_req . ' placeholder="ایمیلتون رو میدین! ">',
'url' => '<input class="send-form-input" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" placeholder="اگر سایت یا وبلاگی دارین آدرسش رو بدین ببینیم ">',
);
$defaults = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_field' => '<textarea class="comment-texttt" id="comment" name="comment" aria-required="true" placeholder=" خب میگفتین !!"></textarea>',
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
'id_form' => 'commentform',
'id_submit' => 'submit',
'title_reply' => __( 'Leave a Reply' ),
'title_reply_to' => __( 'Leave a Reply to %s' ),
'cancel_reply_link' => __( 'Cancel reply' ),
'label_submit' => __( 'Post Comment' ),
);
$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
if ( comments_open( $post_id ) ) :
do_action( 'comment_form_before' ); ?>
<div id="respond">
<small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small>
<div style="position:relative;">
<?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
<?php echo $args['must_log_in']; ?>
<?php do_action( 'comment_form_must_log_in_after' ); ?>
<?php else : ?>
<form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>">
<?php do_action( 'comment_form_top' ); ?>
<?php if ( is_user_logged_in() ) : ?>
<script>
$("#respond").addClass("comment-as-logged-in-user");
</script>
<?php echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); ?>
<?php do_action( 'comment_form_logged_in_after', $commenter, $user_identity ); ?>
<?php else : ?>
<?php
do_action( 'comment_form_before_fields' );
foreach ( (array) $args['fields'] as $name => $field ) {
echo apply_filters( "comment_form_field_{$name}", $field ) . "\n";
}
do_action( 'comment_form_after_fields' );
?>
<?php endif; ?>
<?php echo apply_filters( 'comment_form_field_comment', $args['comment_field'] ); ?>
<?php echo $args['comment_notes_after']; ?>

<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="ارسال دیدگاه" class="send_comment_form_submit">
<?php comment_id_fields( $post_id ); ?>

<?php do_action( 'comment_form', $post_id ); ?>
</form>
<?php endif; ?>
</div>
</div><!-- #respond -->
<!-- www.20script.ir -->
<?php else : do_action( 'comment_form_comments_closed' ); endif; }?>

لینک به ارسال

این هم مشکلی نداره!

ببینم شما بعد این که اون کاری که گفتم رو انجام دادید بروز رسانی هم کردید اطلاعاتتون رو ؟

لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...