Hallo zusammen,
ich habe ein Problem mit den Avataren in meinen Kommentaren. Leider werden diese nicht neben den Kommentaren, sondern vielmehr zum Teil über dem Text angezeigt --> siehe hier: http://jointhesunnyside.de/city-check-malmoe
Weiß jemand, wie ich das Problem ändern kann? Folgenden Code habe ich unter comments.php gefunden. Ich habe schon versucht einfach die Größe der Avatare zu verkleinern, das hat aber nichts gebracht.. :-/
PHP
<div class="post-content-container">
<?php
/*-----------------------------------------------------------------------------------*/
/* Begin processing our comments
/*-----------------------------------------------------------------------------------*/
/*
* 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 class="commentlist_parent">
<a href="#" id="comment-button">
<?php echo thb_get_comments_number_str(); ?>
</a>
<?php if ( have_comments() ) : ?>
<div class="commentlist_container">
<ol class="commentlist">
<?php wp_list_comments(
array(
'type' => 'comment',
'style' => 'ol',
'short_ping' => true,
'avatar_size' => 45
)
); ?>
</ol>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { ?>
<div class="navigation">
<div class="nav-previous"><?php previous_comments_link(); ?></div>
<div class="nav-next"><?php next_comments_link(); ?></div>
</div><!-- .navigation -->
<?php } ?>
</div>
<?php else :
if ( ! comments_open() ) :
?>
<p class="nocomments"><?php _e("Comments are closed", 'thevoux'); ?></p>
<?php endif; // end ! comments_open() ?>
<?php endif; // end have_comments() ?>
<?php
// Comment Form
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? ' aria-required="true" data-required="true"' : '' );
$defaults = array( 'fields' => apply_filters( 'comment_form_default_fields', array(
'author' => '<div class="row"><div class="small-12 medium-6 columns"><input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' placeholder="' . __( 'Name', 'thevoux' ) . '"/></div>',
'email' => '<div class="small-12 medium-6 columns"><input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' placeholder="' . __( 'Email', 'thevoux' ) . '" /></div>',
'url' => '<div class="small-12 columns"><input name="url" size="30" id="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" type="text" placeholder="' . __( 'Website', 'thevoux' ) . '"/></div></div>' ) ),
'comment_field' => '<div class="row"><div class="small-12 columns"><textarea name="comment" id="comment"' . $aria_req . ' rows="10" cols="58" placeholder="' . __( 'Your Comment', 'thevoux' ) . '"></textarea></div></div>',
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.', 'thevoux' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '</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>', 'thevoux' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '</p>',
'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.', 'thevoux' ) . '</p>',
'comment_notes_after' => '<p class="form-allowed-tags">' . sprintf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s', 'thevoux' ), ' <code>' . allowed_tags() . '</code>' ) . '</p>',
'id_form' => 'form-comment',
'id_submit' => 'submit',
'title_reply' => __( 'Leave a Reply', 'thevoux' ),
'title_reply_to' => __( 'Leave a Reply to %s', 'thevoux' ),
'cancel_reply_link' => __( 'Cancel reply', 'thevoux' ),
'label_submit' => __( 'Submit Comment', 'thevoux' ),
);
comment_form($defaults);
?>
</div>
</div>
Alles anzeigen
Dann gibt es noch eine comments.php von meinem Theme, die lautet:
PHP
<?php
/* Custom GRAvatar */
function thb_gravatar ($avatar_defaults) {
$myavatar = THB_THEME_ROOT . '/assets/img/avatar.png';
$avatar_defaults[$myavatar] = 'THB Gravatar';
return $avatar_defaults;
}
add_filter('avatar_defaults', 'thb_gravatar');
/* Custom Comment Styling */
function thb_enable_threaded_comments(){
if (!is_admin()) {
if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1)) {
wp_enqueue_script('comment-reply');
}
}
}
add_action('get_header', 'thb_enable_threaded_comments');
/**
* Modifies WordPress's built-in comments_popup_link() function to return a string instead of echo comment results
*/
function get_comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
global $wpcommentspopupfile, $wpcommentsjavascript;
$id = get_the_ID();
if ( false === $zero ) $zero = __( 'No Comments', 'thevoux' );
if ( false === $one ) $one = __( '1 Comment', 'thevoux' );
if ( false === $more ) $more = __( '% Comments', 'thevoux' );
if ( false === $none ) $none = __( 'Comments Off', 'thevoux' );
$number = get_comments_number( $id );
$str = '';
if ( 0 == $number && !comments_open() && !pings_open() ) {
$str = '<span' . ((!empty($css_class)) ? ' class="' . esc_attr( $css_class ) . '"' : '') . '>' . $none . '</span>';
return $str;
}
if ( post_password_required() ) {
$str = __('Enter your password to view comments.', 'thevoux');
return $str;
}
$str = '<a href="';
if ( $wpcommentsjavascript ) {
if ( empty( $wpcommentspopupfile ) )
$home = home_url();
else
$home = get_option('siteurl');
$str .= $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
$str .= '" onclick="wpopen(this.href); return false"';
} else { // if comments_popup_script() is not in the template, display simple comment link
if ( 0 == $number )
$str .= get_permalink() . '#respond';
else
$str .= get_comments_link();
$str .= '"';
}
if ( !empty( $css_class ) ) {
$str .= ' class="'.$css_class.'" ';
}
$title = the_title_attribute( array('echo' => 0 ) );
$str .= apply_filters( 'comments_popup_link_attributes', '' );
$str .= ' title="' . esc_attr( sprintf( __('Comment on %s', 'thevoux'), $title ) ) . '">';
$str .= thb_get_comments_number_str( $zero, $one, $more );
$str .= '</a>';
return $str;
}
/**
* Modifies WordPress's built-in comments_number() function to return string instead of echo
*/
function thb_get_comments_number_str( $zero = false, $one = false, $more = false, $deprecated = '' ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '1.3' );
$number = get_comments_number();
if ( $number > 1 )
$output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments', 'thevoux') : $more);
elseif ( $number == 0 )
$output = ( false === $zero ) ? __('No Comments Yet', 'thevoux') : $zero;
else // must be one
$output = ( false === $one ) ? __('1 Comment', 'thevoux') : $one;
return apply_filters('comments_number', $output, $number);
}
?>
Alles anzeigen
Zusätzlich würde ich gerne die Anzeige der Kommentare dahingehend ändern, dass diese direkt unter dem Post angezeigt werden, ohne dass man nochmal auf den Pfeil neben "Comments" klicken muss und sie sich dann erst öffnen...
Weiß jemand weiter?