رفتن به مطلب

مشکل در نظرات قالب نشان ندادن نام ایمیل این حرفا


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

سلام

دوستان برای قالب یه قسمت نظرات اضافه کردم اما وقتی

comments.php

رو اضافه کردم

اون قسمت های نام ایمیل ادرس سایت اینا نشون داده نمیشه و دکمه ارسال هم کار نمیکنه

من کدهارو قرار دادم ببینید کجا من اشتباه کردم از صبح منو اسیر خودش کرده


<div class="comments">
<div class="comments-box"> <?php if(have_comments()) : ?>
<ol class="commentlist">
<?php wp_list_comments('type=comment&avatar_size=48');?>
</ol>
<div id="respond">
<h3 style="color:#F00; padding:5px; font-family:arial;">
<?php _e('نظرات و سوال جواب هاتون در باره این خبر','themejunkie')?>
</h3>
<div class="cancel-comment-reply"></div>
<small>
<?php cancel_comment_reply_link(); ?>
</small> </div>
</div>
</div>
<form action="<?php echo get_option('siteurl'); ?>/wp-commenst-post.php" method="post" id="commentform"
<p> <input type="text" name="author" class="txt" id="author" placeholder="<?php _e('نام' , 'themejunkie') ?>
<?php if($req)?>
" size="22" tabindex="1"/></p>
<p> <input type="text" name="email" class="txt" id="email" placeholder="<?php _e('ایمیل' , 'themejunkie') ?>
<?php if($req)?>
" size="22" tabindex="2"/></p>
<p> <input type="text" name="url" class="txt" id="url" placeholder="<?php _e('وب سایت' , 'themejunkie') ?>
<?php if($req)?>
" size="22" tabindex="3"/></p>
<?php endif;?>
<p><textarea name="comment" id="comment" rows="10" cols="50" tabindex="4"></textarea></p>
<input name="submit" type="submit" id="submit" class="button" tabindex="5" value="<?php _e('ثبت نظر' , 'themejunkie')?>" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id;?>" />
<?php comment_id_fields();?>
<?php do_action('comment_form' , $post->ID)?>
</form>
</div>
</div>

لینک به ارسال

این فرم تست شده است

در functions


function comment_form_wpp( $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 = ! empty( $user->ID ) ? $user->display_name : '';
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$fields = array(
'author' => '<p class="comment-form-author">' . '<label for="author">' . ( $req ? '<span class="required">*</span>' : '' ) .' نام: </label><input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
'email' => '<p class="comment-form-email"><label for="email">' . ( $req ? '<span class="required">*</span>' : '' ) .' ایمیل: </label><input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
'url' => '<p class="comment-form-url"><label for="url">وبسایت: </label>' .
'<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
);
$required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
$defaults = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
'comment_field' => '<p class="comment-form-comment"><label for="comment">دیدگاه: </label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
'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>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
'comment_notes_before' => '',
'comment_notes_after' => '',
'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' => 'ارسال دیدگاه',
);
//'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
$args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
?>
<?php if ( comments_open() ) : ?>
<?php do_action('comment_form_before'); ?>
<div id="respond">
<h3 id="reply-title"><?php comment_form_title($args['title_reply'], $args['title_reply_to']); ?> <small><?php cancel_comment_reply_link($args['cancel_reply_link']); ?></small></h3>
<?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() ) : ?>
<?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 echo $args['comment_notes_before']; ?>
<?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']; ?>
<p class="form-submit">
<input name="submit" type="submit" id="<?php echo esc_attr($args['id_submit']); ?>" value="<?php echo esc_attr($args['label_submit']); ?>" />
<?php comment_id_fields($post_id); ?>
</p>
<?php do_action('comment_form', $post_id); ?>
</form>
<?php endif; ?>
</div><!-- #respond -->
<?php do_action('comment_form_after'); ?>
<?php else : ?>
<?php do_action('comment_form_comments_closed'); ?>
<?php endif; ?>
<?php
}
function remove_generator_ps2() {
return '';
}

در فایل کامنت


<?php comment_form_wpp(); ?>

لینک به ارسال

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

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

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

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

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

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

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

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

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