Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  | Правила  

Компьютерный форум OSzone.net » Компьютеры + Интернет » Вебмастеру » [решено] Как убрать в комментариях поле «сайт» в wordpress?

Ответить
Настройки темы
[решено] Как убрать в комментариях поле «сайт» в wordpress?

Аватара для anfis_chekhov

Пользователь


Сообщения: 56
Благодарности: 2


Конфигурация

Профиль | Сайт | Отправить PM | Цитировать



Комментарии (comments.php)
PHP код: Выделить весь код

<?php

/**
 * The template for displaying Comments.
 *
 * The area of the page that contains both current comments
 * and the comment form.  The actual display of comments is
 * handled by a callback to graphene_comment which is
 * located in the functions.php file.
 *
 * @package Graphene
 * @since Graphene 1.0
 */
global $graphene_settings;
?>

<?php 
    
/* Only show comments depending on the theme setting */
    
if ( ! graphene_should_show_comments() ) : 
        return;
    endif;
?>

<?php if ( post_password_required() && ( comments_open() || have_comments() ) ) : ?>
            <div id="comments">
                <p class="nopassword"><?php _e'This post is password protected. Enter the password to view any comments.''graphene' ); ?></p>
                
                <?php do_action'graphene_protected_comment' ); ?>
            </div><!-- #comments -->
<?php
        
/* Stop the rest of comments.php from being processed,
         * but don't kill the script entirely -- we still have
         * to fully load the template.
         */
        
return;
    endif;
?>

<?php do_action'graphene_before_comment_template' ); ?>

<?php /* Lists all the comments for the current post */ ?>
<?php 
if ( have_comments() ) : ?>

<?php /* Get the comments and pings count */ 
    
global $graphene_tabbed_comment;
    
$comments_num graphene_get_comment_count();
    
// to also show comments awaiting approval
    
$allcomments_num graphene_get_comment_count'comments'false );
    
$pings_num graphene_get_comment_count'pings' );
    if ( 
$comments_num )
        
$comment_count sprintf_n'%d comment''%d comments'$comments_num'graphene' ), number_format_i18n$comments_num ) );
    if ( 
$pings_num 
        
$ping_count sprintf_n'%d ping''%d pings'$pings_num'graphene' ), number_format_i18n$pings_num ) );
    
$graphene_tabbed_comment = ( $comments_num && $pings_num ) ? true false;
    
    
$class 'clearfix';
    if ( ! 
$comments_num $class .= ' no-comment';
    if ( ! 
$pings_num $class .= ' no-ping';
    
    
$is_paginated get_option'page_comments' );
?>

<div id="comments" class="<?php echo $class?>">
    <?php if ( $comments_num ) : ?>
        <h4 class="comments gutter-left current"><?php if ($graphene_tabbed_comment) {echo '<a href="#">'.$comment_count.'</a>';} else {echo $comment_count;}?></h4>
    <?php endif; ?>
    <?php if ( $pings_num ) : ?>
        <h4 class="pings gutter-left"><?php if ($graphene_tabbed_comment) {echo '<a href="#">'.$ping_count.'</a>';} else {echo $ping_count;}?></h4>
    <?php endif; ?>
    
    <?php if ( ( ( $is_paginated && get_option'comments_per_page' ) > ) || ! $is_paginated ) && ( $comments_num || $pings_num ) ) : ?>
        <p class="comment-form-jump"><a href="#respond"><?php _e'Skip to comment form''graphene' ); ?></a> ↓</p>
    <?php endif; ?>

    <?php do_action'graphene_before_comments' ); ?>

    <?php if ( $comments_num || $allcomments_num ) : ?>
        <ol class="clearfix" id="comments_list">
            <?php
            
/* Loop through and list the comments. Tell wp_list_comments()
             * to use graphene_comment() to format the comments.
             * If you want to overload this in a child theme then you can
             * define graphene_comment() and that will be used instead.
             * See graphene_comment() in functions.php for more.
             */
             
$args = array( 'callback' => 'graphene_comment''style' => 'ol''type' => 'comment' );
             
wp_list_commentsapply_filters'graphene_comments_list_args'$args ) ); ?>
             
            <?php // Are there comments to navigate through? ?>
            <?php if ( get_comment_pages_count() > && $is_paginated ) : ?>
            <div class="comment-nav clearfix">
                <?php if ( function_exists'wp_commentnavi' ) ) : ?>
                    <?php wp_commentnavi(); ?>
                    <p class="commentnavi-view-all"><?php wp_commentnavi_all_comments_link(); ?></p>
                <?php else : ?> 
                    <p><?php paginate_comments_links(); ?> </p>
                <?php endif; ?>
                <?php do_action'graphene_comments_pagination' ); ?>
            </div>
            <?php endif; // Ends the comment navigation ?>
        </ol>
    <?php endif; ?>
    
    <?php if ( $pings_num ) : ?>
        <ol class="clearfix<?php if (!$comments_num) echo ' display-block'?>" id="pings_list">
            <?php
            
/* Loop through and list the pings. Use the same callback function as
             * listing comments above, graphene_comment() to format the pings.
             */
             
$args = array( 'callback' => 'graphene_comment''style' => 'ol''type' => 'pings''per_page' => );
             
wp_list_commentsapply_filters'graphene_pings_list_args'$args ) ); ?>
        </ol>
    <?php endif; ?>
    
    <?php do_action'graphene_after_comments' ); ?>
</div>
<?php endif; // Ends the comment listing ?>


<?php /* Display comments disabled message if there's already comments, but commenting is disabled */ ?>
<?php 
if ( ! comments_open() && have_comments() ) : ?>
    <div id="respond">
        <h3 id="reply-title"><?php _e'Comments have been disabled.''graphene' ); ?></h3>
        <?php do_action'graphene_comments_disabled' ); ?>
    </div>
<?php endif; ?>


<?php /* Display the comment form if comment is open */ ?>
<?php 
if ( comments_open() ) : ?>

    <div id="comment-form-wrap" class="clearfix">
        <?php do_action'graphene_before_commentform' );
        
        
/* Get the comment form. */ 
        
        
$allowedtags '';
        if ( ! 
$graphene_settings['hide_allowedtags'] ){
            
$allowedtags .= '<p class="form-allowed-tags">';
            
$allowedtags .= sprintf__'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s''graphene' ), '<code>' allowed_tags() . '</code>' );
            
$allowedtags .=    '</p>';
        }
        
        
$args = array(
                    
'comment_notes_after'  => apply_filters'graphene_comment_allowedtags'$allowedtags ),
                    
'id_form'              => 'commentform',
                    
'label_submit'         => __'Submit Comment''graphene' ),
                     );
        
comment_formapply_filters'graphene_comment_form_args'$args ) ); 
    
        
do_action'graphene_after_commentform' );  ?>
    </div>
    
<?php endif; // Ends the comment status ?>

Как убрать в комментариях поле «сайт» в wordpress? Что удалить?

Отправлено: 19:19, 08-02-2013

 


Administrator


Сообщения: 25152
Благодарности: 3798

Профиль | Сайт | Отправить PM | Цитировать


anfis_chekhov, нужно редактировать шаблон includes/theme-comments.php, в оригинальном файле удалить (а лучше закомментировать) строки с 92 по 96 включительно, а именно эту часть:
PHP код: Выделить весь код

'url'    => 
                    
'<p class="comment-form-url clearfix">
                        <label for="url" class="graphene_form_label">' 
__'Website:''graphene' ) . ' </label>
                        <input id="url" name="url" type="text" class="graphene-form-field" value="' 
esc_attr$commenter['comment_author_url'] ) . '" />
                    </p>'


-------
FAQ по Windows 10 .::. Настройка Центра обновления в Windows 10 .::. Чистая установка Windows 10 – пошаговая инструкция

Это сообщение посчитали полезным следующие участники:

Отправлено: 19:46, 08-02-2013 | #2



Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети.

Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля.


Аватара для anfis_chekhov

Пользователь


Сообщения: 56
Благодарности: 2

Профиль | Сайт | Отправить PM | Цитировать


Спасибо, я оказываеться даже не там искал.
А не подскажите ещё, как выровнить поля «имя»/«e-mail» и «каптча»?

Отправлено: 21:13, 08-02-2013 | #3



Administrator


Сообщения: 25152
Благодарности: 3798

Профиль | Сайт | Отправить PM | Цитировать


Цитата anfis_chekhov:
как выровнить поля »
код?

-------
FAQ по Windows 10 .::. Настройка Центра обновления в Windows 10 .::. Чистая установка Windows 10 – пошаговая инструкция

Это сообщение посчитали полезным следующие участники:

Отправлено: 21:17, 08-02-2013 | #4


Аватара для anfis_chekhov

Пользователь


Сообщения: 56
Благодарности: 2

Профиль | Сайт | Отправить PM | Цитировать


Цитата Blast:
код? »
includes/theme-comments.php
PHP код: Выделить весь код

<?php


/**
 * Defines the callback function for use with wp_list_comments(). This function controls
 * how comments are displayed.
*/

if (!function_exists'graphene_comment' ) ) :

    function 
graphene_comment$comment$args$depth) {
        
$GLOBALS['comment'] = $comment?>
            <li id="comment-<?php comment_ID(); ?><?php comment_class'clearfix' ); ?>>
                <?php do_action'graphene_before_comment' ); ?>
                
                <?php /* Added support for comment numbering using Greg's Threaded Comment Numbering plugin */ ?>
                <?php if (function_exists'gtcn_comment_numbering' ) ) {gtcn_comment_numbering$comment->comment_ID$args);} ?>
                
                    <div class="comment-wrap clearfix">
                        
                        <?php if ( $avatar get_avatar$commentapply_filters'graphene_gravatar_size'40) ) ) : ?>
                            <div class="comment-avatar-wrap">
                                <?php echo $avatar?>
                                <?php do_action'graphene_comment_gravatar' ); ?>
                            </div>
                        <?php endif; ?>
                        
                        <h5 class="comment-author">
                            <cite><?php comment_author_link(); ?></cite>
                            <?php do_action'graphene_comment_author' ); ?>
                        </h5>
                        <div class="comment-meta">
                            <p class="commentmetadata">
                                <?php /* translators: %1$s is the comment date, %2$s is the comment time */ ?>
                                <?php printf__'%1$s at %2$s''graphene' ), get_comment_date(), get_comment_time() ); ?>
                                <span class="timezone"><?php echo '(UTC '.get_option'gmt_offset' ).')'?></span>
                                <?php edit_comment_link(__'Edit comment','graphene' ),' (',') ' ); ?>
                <?php if ( function_exists ('graphene_delete_and_spam_comment') ) { graphene_delete_and_spam_comment(get_comment_ID()); } ?>
                                <span class="comment-permalink"><a href="<?php echo get_comment_link(); ?>"><?php _e'Link to this comment''graphene' ); ?></a></span>
                                <?php do_action'graphene_comment_metadata' ); ?>    
                            </p>
                            <p class="comment-reply-link">
                                <?php comment_reply_link(array( 'depth' => $depth'max_depth' => $args['max_depth'], 'reply_text' => __'Reply''graphene' ) )); ?>
                            
                                <?php do_action'graphene_comment_replylink' ); ?>
                            </p>
                            
                            <?php do_action'graphene_comment_meta' ); ?>
                        </div>
                        <div class="comment-entry">
                            <?php do_action'graphene_before_commententry' ); ?>
                            
                            <?php if ( $comment->comment_approved == '0' ) : ?>
                               <p><em><?php _e'Your comment is awaiting moderation.''graphene' ?></em></p>
                               <?php do_action'graphene_comment_moderation' ); ?>
                            <?php else : ?>
                                <?php comment_text(); ?>
                            <?php endif; ?>
                            
                            <?php do_action'graphene_after_commententry' ); ?>
                        </div>
                    </div>
                
                <?php do_action'graphene_after_comment' ); ?>
    <?php

    
}

endif;


/**
 * Customise the comment form
*/
function graphene_comment_form_fields(){
    
    
$req get_option'require_name_email' );
    
$aria_req = ( $req ' aria-required="true"' '' );
    
$req_mark = ( $req ' <span class="required">*</span>' '' );
    
$commenter wp_get_current_commenter();
    
    
$fields =  array( 
        
'author' => 
                    
'<p class="comment-form-author clearfix">
                        <label for="author" class="graphene_form_label">' 
__'Name:''graphene' ) . $req_mark '</label>
                        <input id="author" name="author" type="text" class="graphene-form-field"' 
$aria_req ' value="' esc_attr$commenter['comment_author'] ) . '" />
                    </p>'
,
        
'email'  => 
                    
'<p class="comment-form-email clearfix">
                        <label for="email" class="graphene_form_label">' 
__'Email:''graphene' ) . $req_mark '</label>
                        <input id="email" name="email" type="text" class="graphene-form-field"' 
$aria_req ' value="' esc_attr$commenter['comment_author_email'] ) . '" />
                    </p>'
,
    );
    
    
$fields apply_filters'graphene_comment_form_fields'$fields );
    
    return 
$fields;
}

// The comment field textarea
function graphene_comment_textarea(){
    
$html =  
        
'<p class="comment-form-message clearfix">
            <label class="graphene_form_label">' 
__'Message:''graphene' ) . ' <span class="required">*</span></label>
            <textarea name="comment" id="comment" cols="40" rows="10" class="graphene-form-field" aria-required="true"></textarea>
         </p>'
;
    return 
apply_filters'graphene_comment_textarea'$html );
}
    
// Clear
function  graphene_comment_clear(){
    echo 
'<div class="clear"></div>';
}

// Add all the filters we defined
add_filter'comment_form_default_fields''graphene_comment_form_fields' );
add_filter'comment_form_field_comment''graphene_comment_textarea' );
add_filter'comment_form''graphene_comment_clear'1000 );


/**
 * Adds the functionality to count comments by type, eg. comments, pingbacks, tracbacks.
 * Based on the code at WPCanyon ([url]http://wpcanyon.com/tipsandtricks/get-separate-count-for-comments-trackbacks-and-pingbacks-in-wordpress/[/url])
 * 
 * In Graphene version 1.3 the $noneText param has been removed
 *
 * @package Graphene
 * @since Graphene 1.3
*/
function graphene_comment_count$type 'comments'$oneText ''$moreText '' ){
    
    
$result graphene_get_comment_count$type );

    
//if( $result == 0):
    //    echo str_replace( '%', $result, $noneText);
    
if( $result == 1) : 
        return 
str_replace'%'$result$oneText);
    elseif( 
$result 1) : 
        return 
str_replace'%'$result$moreText);
    else :
        return 
false;
    endif;
}


/**
 * Adds the functionality to count comments by type, eg. comments, pingbacks, tracbacks. Return the number of comments, but do not print them.
 * Based on the code at WPCanyon ([url]http://wpcanyon.com/tipsandtricks/get-separate-count-for-comments-trackbacks-and-pingbacks-in-wordpress/[/url])
 * 
 * In Graphene version 1.3 the $noneText param has been removed
 *
 * @package Graphene
 * @since Graphene 1.3
*/
function graphene_get_comment_count$type 'comments'$only_approved_comments true ){
    if( 
$type == 'comments' ) :
        
$typeSql 'comment_type = ""';
    elseif( 
$type == 'pings' ) :
        
$typeSql 'comment_type != ""';
    elseif( 
$type == 'trackbacks' ) :
        
$typeSql 'comment_type = "trackback"';
    elseif( 
$type == 'pingbacks' ) :
        
$typeSql 'comment_type = "pingback"';
    endif;
    
    
$typeSql apply_filters'graphene_comments_typesql'$typeSql$type );
        
$approvedSql $only_approved_comments ' AND comment_approved="1"' '';
        
    global 
$wpdb;

    
$result $wpdb->get_var'
        SELECT
            COUNT(comment_ID)
        FROM
            '
.$wpdb->comments.'
        WHERE
            '
.$typeSql.$approvedSql.' AND           
            comment_post_ID= '
.get_the_ID() );
    
    return 
$result;
}


/**
 * Custom jQuery script for the comments/pings tabs
*/
function graphene_tabs_js(){ 
    global 
$graphene_tabbed_comment;
    if ( 
$graphene_tabbed_comment ) :
?>
    <script type="text/javascript">
        //<![CDATA[
        jQuery(document).ready(function( $){
            $(function(){
                // to allow the user to switch tabs
                $("div#comments h4.comments a").click(function(){
                    $("div#comments .comments").addClass( 'current' );
                    $("div#comments .pings").removeClass( 'current' );
                    $("div#comments #pings_list").hide();
                    $("div#comments #comments_list").fadeIn(300);
                    return false;
                });
                $("div#comments h4.pings a").click(function(){
                    $("div#comments .pings").addClass( 'current' );
                    $("div#comments .comments").removeClass( 'current' );
                    $("div#comments #comments_list").hide();
                    $("div#comments #pings_list").fadeIn(300);
                    return false;
                });
            });
        });
        //]]>
    </script>
<?php
    
endif;
}
add_action'wp_footer''graphene_tabs_js' );


/**
 * Helps to determine if the comments should be shown.
 */
if ( ! function_exists'graphene_should_show_comments' ) ) :

function 
graphene_should_show_comments() {
    global 
$graphene_settings$post;
    
    if ( 
$graphene_settings['comments_setting'] == 'disabled_completely' )
        return 
false;
    
    if ( 
$graphene_settings['comments_setting'] == 'disabled_pages' && get_post_type$post->ID) == 'page' )
        return 
false;
    
    if ( ! 
is_singular() && $graphene_settings['hide_post_commentcount'] )
        return 
false;
    
    if ( ! 
comments_open() && have_comments() && ! is_singular() )
        return 
false;
    
    return 
true;
}

endif;

/**
 * Delete and mark spam link for comments. Show only if current user can edit posts
 */
 
if ( ! function_exists'graphene_delete_and_spam_comment' ) ) :
function 
graphene_delete_and_spam_comment($id) {
    if (
current_user_can('edit_post')) {
        echo 
'| <a class="comment-delete-link" title="Delete this comment" href="'.get_admin_url().'comment.php?action=cdc&c='.$id.'">Delete</a> ';
        echo 
'| <a class="comment-spam-link" title="Mark this comment as Spam" href="'.get_admin_url().'comment.php?action=cdc&dt=spam&c='.$id.'">Spam</a> |';
    }
}
endif;

/**
 * Add script to show/hide comment permalink
 */
function graphene_comment_script(){
    
?>
    <script type="text/javascript">
        jQuery(document).ready(function($){
            /* Comment permalink */
            $('li.comment .comment-permalink').hide();
            $('.comment-wrap').hover( function(){ $('.comment-permalink', this).fadeIn(200); }, function(){ $('.comment-permalink:eq(0)', this).fadeOut(200); });
            
            /* Jump to comment form */
            $('.comment-form-jump a').click(function(){ $('html,body').animate({scrollTop: $("#respond").offset().top - 200},'slow'); return false;});
        });
    </script>
    <?php
}
add_action'wp_footer''graphene_comment_script' );
?>


Отправлено: 21:26, 08-02-2013 | #5



Administrator


Сообщения: 25152
Благодарности: 3798

Профиль | Сайт | Отправить PM | Цитировать


anfis_chekhov, нет, оно там другим шаблоном выводится, возможно comments.php. Вы это плагином подключали? Каким?

-------
FAQ по Windows 10 .::. Настройка Центра обновления в Windows 10 .::. Чистая установка Windows 10 – пошаговая инструкция

Это сообщение посчитали полезным следующие участники:

Отправлено: 21:32, 08-02-2013 | #6


Аватара для anfis_chekhov

Пользователь


Сообщения: 56
Благодарности: 2

Профиль | Сайт | Отправить PM | Цитировать


Цитата Blast:
Вы это плагином подключали? Каким? »
Да. http://wordpress.org/extend/plugins/captcha/

Отправлено: 21:36, 08-02-2013 | #7



Administrator


Сообщения: 25152
Благодарности: 3798

Профиль | Сайт | Отправить PM | Цитировать


В стилях плагина подправьте отступ сверху:

/wp-content/plugins/captcha/css/style.css - в конце

PHP код: Выделить весь код

.cptch_block {
    
directionltr;
    
margin-top:10px;


-------
FAQ по Windows 10 .::. Настройка Центра обновления в Windows 10 .::. Чистая установка Windows 10 – пошаговая инструкция

Это сообщение посчитали полезным следующие участники:

Отправлено: 21:49, 08-02-2013 | #8


Аватара для anfis_chekhov

Пользователь


Сообщения: 56
Благодарности: 2

Профиль | Сайт | Отправить PM | Цитировать


Blast, огромное спасибо.

Получилось очень аккуратно.

Отправлено: 22:22, 08-02-2013 | #9



Administrator


Сообщения: 25152
Благодарности: 3798

Профиль | Сайт | Отправить PM | Цитировать


Пожалуйста, заходите еще
Это сообщение посчитали полезным следующие участники:

Отправлено: 22:26, 08-02-2013 | #10



Компьютерный форум OSzone.net » Компьютеры + Интернет » Вебмастеру » [решено] Как убрать в комментариях поле «сайт» в wordpress?

Участник сейчас на форуме Участник сейчас на форуме Участник вне форума Участник вне форума Автор темы Автор темы Шапка темы Сообщение прикреплено

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
[решено] Как можно сделать превью видео на WordPress? xp9 Тест-форум 1 22-05-2012 00:11
Sharepoint - Как вставить имя пользователя в определённое поле maives Другие серверные продукты 0 09-11-2009 14:17
MSFT SQL Server - [решено] как разбить поле toro Программирование и базы данных 1 08-01-2009 02:38
Delphi - Как записать массив в поле ClientDataSet? ALI Программирование и базы данных 4 01-11-2008 11:24
Java Script, как вставить текст в поле формы? maaxiim Вебмастеру 8 04-07-2008 16:46




 
Переход