code tweak

  • ggci

    #557

    Syahir, hi. I’d like to change the way the <more> code works so that when someone clicks on “Read the rest of this entry” it links to the top of the FULL blog post.

    I understand I can do this by adding some code to the functions.php file:

    function remove_more_jump_link($link) {
    $offset = strpos($link, '#more-');
    if ($offset) {
    $end = strpos($link, '"',$offset);
    }
    if ($end) {
    $link = substr_replace($link, '', $offset, $end-$offset);
    }
    return $link;
    }
    add_filter('the_content_more_link', 'remove_more_jump_link');

    but I’d like to include the customization in my child theme so I don’t lose it when you update the template. (BTW, I lost all my child theme customizations when upgrading to Graphene 1.2.)

    I’m not sure how to create a functions.php file to my child folder and what else I need to also put in there.

    Your recommendation?

    Admin

    Syahir Hakim

    #12930

    Just create the functions.php file inside your child theme’s folder, and insert the code you mentioned above into that functions.php file. Make sure you include an opening <?php tag before the code and closing ?> tag after the code.

    ggci

    #12931

    FYI – I found the “More To The Top” plugin and am using it instead. “Seemore” is another plugin that does this, too. Thanks Syahir.

    ggci

    #12932

    followed your instructions for the functions.php file inside my child theme’s folder and they worked perfectly. thanks.

Viewing 4 posts - 1 through 4 (of 4 total)

  • You must be logged in to reply to this topic.