code tweak
-
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
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.
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.