Hallo Zusammen,
ich möchte gerne so wenig Plugins wie nötig aktivieren und daher gerne meine Kommentarfunktion im Template bearbeiten. Ich arbeite mit einem Child-Theme für die Individualisierungen. Ich verwende das Theme "weta" von Elmastudio.
Meine comment.php verfügt derzeit noch nicht über eine Checkbox. Ich würde gerne eine Checkbox "Ich akzeptiere die Datenschutzhinweise" meiner Kommentarfunktion hinzufügen.
Etwa so:
[INDENT][INDENT][INDENT][Blockierte Grafik: https://www.fairenroute.com/wp-content/uploads/2018/06/checkbox.png] [/INDENT][/INDENT][/INDENT]
Aktuell mache ich das über das Plugin "WP GDPR Compliance", auf welches ich gerne verzichten würde.
Meine comment.php arbeitet nicht mit arrays, daher weiß ich nicht wie ich den Code um eine solche Checkbox erweitere.
Kann mir jemand dabei weiterhelfen? Unten mein Code.
Vielen Dank und viele Grüße
Vanessa
<?php
/**
* The template for displaying Comments.
*
* @package Weta
* @since Weta 1.0
* @version 1.0
*/
/*
* 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-area">
<?php if ( have_comments() ) : ?>
<h3 class="comments-title">
<?php
printf( _n( '1 Comment', '%1$s Comments', get_comments_number(), 'weta' ),
number_format_i18n( get_comments_number() ) );
?>
</h3>
<ol class="commentlist">
<?php
wp_list_comments( array( 'callback' => 'weta_comment' ) );
?>
</ol><!-- end .comment-list -->
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="nav-comments">
<div class="nav-previous"><?php previous_comments_link( ( '<span>' . __( 'Older Comments', 'weta' ) . '</span>' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( ( '<span>' . __( 'Newer Comments', 'weta' ) . '</span>' ) ); ?></div>
</nav><!-- end #comment-nav -->
<?php endif; // check for comment navigation ?>
<?php
// If comments are closed and there are no comments, let's leave a little note, shall we?
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="nocomments"><?php esc_html_e( 'Comments are closed.', 'weta' ); ?></p>
<?php endif; ?>
<?php endif; // have_comments() ?>
<?php comment_form(); ?>
</div><!-- #comments .comments-area -->
Alles anzeigen