Hallo.
Vorweg: Ich habe Google und dieses Forum schon auf links gedreht, aber meine bescheidenen Fähigkeiten erlauben es mir nicht, mein Problem selber zu lösen.
Ich möchte, dass bei Kommentatoren von Beiträge neben ihren Namen noch zwei weitere Felder in deren Profil dargestellt werden. Kommentieren können nur registierte Nutzer und die benötigten Daten, die angezeigt werden sollen, wurden im Registrationsprozess schon bereits erhoben und in der Datenbank (wp_usermeta) abgespeichert. Im Detail handelt es sich um die Werte addr1, gruppen und gruppen_2.
Ich nutze das flat Theme. Dort habe ich probiert die comments.php zu überreden nach meinem Willen zu agieren. Vergeblich.
Zum Beispiel habe ich es mit dieser Anleitung probiert: http://code.tutsplus.com/articles/custo…rance--wp-26128
Könnte mir jemand helfen, die drei Werte im Profil anzeigen zu lassen?
Hier ist eine Version der Original comments.php.
<?php if ( post_password_required() || ! comments_open() ) { return; } ?>
<?php flat_hook_comments_before(); ?>
<div id="comments" class="comments-area">
<?php flat_hook_comments_top(); ?>
<?php if ( have_comments() ) : ?> <h2 class="comments-title"> <?php comments_number( __( '<span itemprop="interactionCount">0</span> comment', 'flat' ), __( '<span itemprop="interactionCount">1</span> comment', 'flat' ), __( '<span itemprop="interactionCount">%</span> comments', 'flat' ) ); ?> </h2>
<ol class="comment-list"> <?php wp_list_comments( array( 'style' => 'ol', 'format' => 'html5', 'short_ping' => true, 'avatar_size' => 80, ) ); ?> </ol>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?> <nav class="navigation comment-navigation" role="navigation"> <h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'flat' ); ?></h1> <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'flat' ) ); ?></div> <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'flat' ) ); ?></div> </nav> <?php endif; ?>
<?php if ( ! comments_open() && get_comments_number() ) : ?> <p class="no-comments"><?php _e( 'Comments are closed.' , 'flat' ); ?></p> <?php endif; ?>
<?php endif; ?>
<?php comment_form( array( 'format' => 'html5' ) ); ?>
<?php flat_hook_comments_bottom(); ?>
</div>
<?php flat_hook_comments_after(); ?>
Alles anzeigen
Es wäre echt toll, wenn jemand einem Anfänger helfen könnte. Vielen Dank!