Momentan habe ich in der comments.php so eine Art Weiche:
PHP
<?php if (is_page(4328) ) {
include 'comments-Link.php';
} else {
include 'comments-normal.php';
}
?>
Das funktioniert auch einwandfrei!
Vielleicht gibt es aber eine Möglichkeit direkt in der comments.php eine Abfrage einzubauen, so in der Art:
und wo würde ich die Abfrage platzieren?
Vor oder nach diesem Kopf (ist der eigentlich noch aktuell und notwendig) ???
PHP
<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Bitte diese Seite nicht direkt aufrufen. Danke!');
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
?>
<p class="nocomments">Auch die Kommentare sind durch das Passwort geschützt.</p>
<?php
return;
}
}
/* This variable is for alternating comment background */
$oddcomment = 'class="alt" ';
?>
<!-- ANFANG EDITIEREN -->
Alles anzeigen
In einigen Themes fängt die comments.php so an:
PHP
<?php if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>
<p><?php _e('Enter your password to view comments.'); ?></p>
<?php return; endif; ?>
Ich verwende cforms.