Поддержка Проблемы и решения Размер имеет значение или про аватарки

  • Будьте добры. Подскажите где и как меняются размеры аватаров комментаторов? Что-то совсем глухо по этой теме в интернет.

Просмотр 6 ответов — с 1 по 6 (всего 6)
  • Модератор Yuri

    (@yube)

    Вызов wp_list_comments(), обычно находится в шаблоне comments.php темы.

    Home

    ‘avatar_size’
    (int) Height and width dimensions of the avatar size. Default 32.

    Юрий, к сожалению у меня тема китайская, точнее японская 🙂 Там такого конечно же нет, ибо непромяглазые друзья не ищут легких путей 🙂
    Вот привожу исходный код (не путать с одноименным фильмом, он гораздо лучше :-))

    <?php
    /**
     * The template for displaying comments.
     *
     * This is the template that displays the area of the page that contains both the current comments
     * and the comment form.
     *
     * @package modernize
     * @author Takuma Misumi
     * @link http://blog.mismithportfolio.com/
     * @license GPLv2 or later
     */
    
    /*
     * If the current post is protected by a password and
     * the visitor has not yet entered the password we will
     * return early without loading the comments.
     */
    if ( post_password_required() ) {
      return;
    }
    ?>
    
    <div id="comments" class="comments">
    
      <?php
      // You can start editing here -- including this comment!
      if ( have_comments() ) : ?>
        <h2 class="comments__title">
          <?php
            printf( // WPCS: XSS OK.
              esc_html( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'modernize' ) ),
              number_format_i18n( get_comments_number() ),
              '<span>' . get_the_title() . '</span>'
            );
          ?>
        </h2>
    
        <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
        <nav id="comment-nav-above" class="navigation comment__navigation" role="navigation">
          <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'modernize' ); ?></h2>
          <div class="nav-links">
    
            <div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'modernize' ) ); ?></div>
            <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'modernize' ) ); ?></div>
    
          </div><!-- .nav-links -->
        </nav><!-- #comment-nav-above -->
        <?php endif; // Check for comment navigation. ?>
    
        <ol class="comments__list">
          <?php
            wp_list_comments( array(
              'style'      => 'ol',
              'short_ping' => true,
            ) );
          ?>
        </ol><!-- .comments__list -->
    
        <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
        <nav id="comment-nav-below" class="navigation comment__navigation" role="navigation">
          <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'modernize' ); ?></h2>
          <div class="nav-links">
    
            <div class="nav-previous"><?php previous_comments_link( esc_html__( 'Older Comments', 'modernize' ) ); ?></div>
            <div class="nav-next"><?php next_comments_link( esc_html__( 'Newer Comments', 'modernize' ) ); ?></div>
    
          </div><!-- .nav-links -->
        </nav><!-- #comment-nav-below -->
        <?php
        endif; // Check for comment navigation.
    
      endif; // Check for have_comments().
    
      // If comments are closed and there are comments, let's leave a little note, shall we?
      if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
    
        <p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'modernize' ); ?></p>
      <?php
      endif;
    
      comment_form();
      ?>
    
    </div><!-- #comments -->
    

    ну так замените код:

    
            wp_list_comments( array(
              'style'      => 'ol',
              'short_ping' => true,
            ) );
    

    на

    
            wp_list_comments( array(
              'style'      => 'ol',
              'short_ping' => true,
              'avatar_size'    => 64,
            ) );
    

    Flector

    ну так замените код

    Блин. конечно. Как я мог забыть?
    Хотя да, я же не кодер 🙂
    Спасио!

    Модератор Yuri

    (@yube)

    Хотя да, я же не кодер 🙂

    Чтобы сделать себе бутерброд, не нужно быть поваром 🙂

    Чтобы сделать себе бутерброд, не нужно быть поваром

    Чтобы сделать бутерброд, надо сначала залезть в холодильник. А когда я его открываю, я не понимаю, где чего находится, поскольку… ну не моя это вотчина. 🙂
    Кто окольцован, тот пойдет!

Просмотр 6 ответов — с 1 по 6 (всего 6)
  • Тема «Размер имеет значение или про аватарки» закрыта для новых ответов.