Hallo, ich benutze das Plugin paged comments von Keyvan Minoukadeh, kenn mich leider nicht gut genug aus, aber bei mir werden die Comments wieder auf englisch angezeit und nicht so wie ich es im comments template selbst angepasst hab. Kann ich das an dieser Stelle irgendwo anpassen, dass mein Template verwendet wird?
PHP
// replaces the is_single() and is_page() cases in template-loader.php
// when paged comments is enabled for the post/page. does essentially
// the same thing but reads the file contents to a variable, replaces
// comments_template() call to paged_comments_template().
function paged_comments_alter_source()
{
global $wpdb, $post, $comment;
if (paged_comments()) {
$file_contents = '';
$template = '';
if (is_single()) {
$template = get_single_template();
} else if (is_page()) {
$template = get_page_template();
}
if (($template == '') && file_exists(TEMPLATEPATH.'/index.php')) {
$template = TEMPLATEPATH.'/index.php';
}
if ($template) {
// WP 1.5 doesn't use is_attachment()
if (function_exists('is_attachment') && is_attachment()) {
add_filter('the_content', 'prepend_attachment');
}
$file_contents = file_get_contents($template);
// simple check: if call to paged_comments_template() exists, assume all is fine.
// if it doesn't exist, replace comments_template() with paged_comments_template().
if (strpos($file_contents, 'paged_comments_template()') === false) {
extract($GLOBALS, EXTR_SKIP | EXTR_REFS);
$inc_path = get_include_path();
set_include_path($inc_path . PATH_SEPARATOR . TEMPLATEPATH);
$file_contents = str_replace('comments_template()', 'paged_comments_template()', $file_contents);
//$file_contents = str_replace('<'.'?php','<'.'?',$file_contents);
eval('?'.'>'.trim($file_contents));
// I don't think I should be using restore_include_path(), what if other
// plugins also use set_include_path()? according to php.net
// restore_include_path restores "back to its original master value as set in php.ini"
set_include_path($inc_path);
exit;
}
}
}
}
Alles anzeigen
Ich bin halt doch zu schlecht in englisch und versteh das Ganze nicht so richtig. .__.
Wär lieb wenn jemand helfen könnte. Ich will halt auch nicht einfach drauf los verändern.