Hallo Liebe Leser von unseren Blog.
In der dritte Teil von nützliche Funktionen für den WordPress mochte ich paar Fragen aus Kommentaren beantworten.
Im Teil 1 wollte Mark wissen, wie man die Autolinks in Kommentaren abschaltet.
Im Teil 2 Lothar suchte eine Funktion die Links aus Kommentaren in einem neuen Tab / Fenster öffnen lässt.
Hier sind die beide Funktion lösungen.

Um die Autolinks Funktion in WordPress Blog bei Kommentaren abzuschalten.
Folgende Code-Snippet in die functions.php des Themes einfügen:
remove_filter('comment_text', 'make_clickable', 9);
WordPress Kommentarlinks in neuem Tab / Fenster öffnen (target _ blank )
Folgende Code-Snippet in die functions.php des Themes einfügen (nofollow link):
// Kommentarlinks in neuem Tab / Fenster öffnen nofollow
/*-----------------------------------------------------------------------------------*/
function comment_author_link_window() {
global $comment;
$url = get_comment_author_url();
$author = get_comment_author();
if ( empty( $url ) || 'http://' == $url )
$return = $author;
else
$return = "$author";
return $return;
}
add_filter('get_comment_author_link', 'comment_author_link_window'); Für DoFollow link dann so eingetragen:
// Kommentarlinks in neuem Tab / Fenster öffnen dofollow
/*-----------------------------------------------------------------------------------*/
function comment_author_link_window() {
global $comment;
$url = get_comment_author_url();
$author = get_comment_author();
if ( empty( $url ) || 'http://' == $url )
$return = $author;
else
$return = "$author";
return $return;
}
add_filter('get_comment_author_link', 'comment_author_link_window'); Das war die dritte Teil von nützliche Funktionen für WordPress CMS.
Viktor
Besuch uns auf Youtube