ThemeShaper Forums » Thematic

[closed]

Modifying the destination of more link

(3 posts)
  • Started 7 years ago by Hellah
  • Latest reply from matius
  • This topic is not resolved

Tags:

  1. Hellah
    Member

    Hi,

    Thanks for your great theme.

    I'm trying to start using the more tag in my posts, which seems to work. However, when clicking on the "Read more" link, I would like the link to lead to the beginning of the post, and not jump to the point where the more tag is.

    In the Wordpress forums:
    http://codex.wordpress.org/Customizing_the_Read_More
    there is a code they advice to put in the theme's functions.php

    like this:
    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');

    I tried it both in my child theme's and Thematic's 'functions.php' but it didn't change anything.
    I'm a beginner with using css, so I can't tell whether there is a mistake somewhere in this code.

    Thanks for your help!

    Posted 7 years ago #
  2. Hi,

    no idea .. tested the code in my child theme's functions.php and it works:

    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');

    Chris

    Posted 7 years ago #
  3. Ah, nevermind. sorry.

    Posted 6 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.