• kaizerco

    (@kaizerco)


    Without being too careful (maybe even stupid), I tried following this closed thread – Remove ‘#more-” jump from ‘Continue reading’ link:
    https://www.ads-software.com/support/topic/remove-more-jump-from-continue-reading-link?replies=7

    I then pasted the code below into my functions.php in the child theme.
    I reloaded the site, and the site is now completely dead!!!
    Nothing! White page!
    The site is using a child for twenty twelve and not twenty fourteen which could explain the problem maybe?
    Or maybe, there something malicious/ just dangerous in the code below? Something that could have gotten completely wrong?
    What can I do now to save the site?

    Site is at frandzel3d.com

    Help!

    <?php
    
    function remove_more_tag_link_jump($link) {
        $offset = strpos($link, '#more-'); //Locate the jump portion of the link
        if ($offset) { //If we found the jump portion of the link
            $end = strpos($link, '"', $offset); //Locate the end of the jump portion
        }
        if ($end) { //If we found the end of the jump portion
            $link = substr_replace($link, '', $offset, $end-$offset); //Remove the jump portion
        }
        return $link; //Return the link without jump portion or just the normal link if we didn't find a jump portion
    }
    
    add_filter('the_content_more_link', 'remove_more_tag_link_jump'); //Add our function to the more link filter
    
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kaizerco

    (@kaizerco)

    Well, I managed to replace the functions.php back to what it was before, and all is working fine now. I guess I won’t be messing with functions.php any time soon, until I understand exactly what each of those commands does, and why it didn’t work…

    Marios Alexandrou

    (@marios-alexandrou)

    There’s a plugin called Real-Time Find and Replace that enables you to search for and replace code/text in your pages without having to modify theme files or writing code. It doesn’t solve all problems, but for things like replacing static HTML it works well for me. In your case, you could set it to search for #more- and to replace it with nothing.

    Full disclosure: I’m the plugin developer.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Site dead after following a thread’ is closed to new replies.