Hallo,
ich verzweifle hier langsam. Ich würde gerne alle href Links in the_content() "löschen" sprich das anstatt der Link nur das Wort angezeigt wird.
Hat jemand eine Idee, wie man dies am besten umsetzt?
Ich hatte folgendes getestet:
ZitatAlles anzeigenfunction strip_only($str, $tags) {
if(!is_array($tags)) {
$tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
if(end($tags) == '') array_pop($tags);
}
foreach($tags as $tag) $str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);
return $str;
}$str = the_content();
echo strip_only($str);
LG und Danke an Euch!