Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #283759

    I was looking for a solution to remove the title attribute off of my portfolio images when hovering. I did some online research and someone claimed this code would work… so I pasted it into function.php… well now when I try to go to my website or my WP log-in it’s a blank page…. Need help please freaking out a tad!

    <?php

    add_filter(‘the_content’, ‘remove_titles’);

    function remove_titles($txt) {

    // Get all title=”…” tags from the html.
    $txtresult= array();
    preg_match_all(‘|title=”[^”]*”|U’, $txt, $txtresult);

    // Replace all occurances with an empty string.
    foreach($txtresult[0] as $img_tag) {
    $text = str_replace($img_tag, ”, $txt);
    }

    return $txt;
    }
    ?>

    #283834

    Hi kroemer08!

    Thank you for visiting the support forum!

    Did you add any code other than that on functions.php? If not, please get a new copy of functions.php then upload it via FTP.

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.