WordPress.org

Ready to get started?Download WordPress

Forums

LightWord
How to remove #more tag on read more (3 posts)

  1. uphichet
    Member
    Posted 2 years ago #

    Generally, with other themes also have #more tag on read more link, I've removed it easily with this script by just adding in 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');

    However, the problem is I cannot do that with LIghWord Them.
    As most of us know that one content with two or more URLs cause duplicated content
    For example
    http://www.carseath.com/articles/car-seat-safety-harnesses-for-children/ and http://www.carseath.com/articles/car-seat-safety-harnesses-for-children/#more-155 you can imagine that "these two URLs point to the same content page (100% duplicate content)

    It would be appreciated if someone can advice me how to remove #more tag on read more link

    Best Regards,
    UPhichet

    http://wordpress.org/extend/themes/lightword/

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    the link is hardcoded into the template;
    edit index.php; find:
    <span class="continue"><?php $pos = strpos($post->post_content, '<!--more-->'); if($pos==''){ ?><a class="nr_comm_spot" href="<?php the_permalink(); ?>#comments"><?php if(lightword_fb_get_comment_type_count('comment')==1) _e('1 Comment','lightword'); elseif('open' != $post->comment_status) _e('Comments Off','lightword'); elseif(lightword_fb_get_comment_type_count('comment') == 0) _e('No Comments','lightword'); else echo lightword_fb_get_comment_type_count('comment')." ".__('Comments','lightword'); ?></a><?php }else{ ?><a title="<?php _e('Read more about','lightword'); ?> <?php the_title(); ?>" href="<?php the_permalink() ?>#more-<?php echo $id; ?>"><?php _e('Continue reading','lightword'); ?></a><?php } ?></span><div class="clear"></div>

    remove: #more-<?php echo $id; ?>

    make a backup copy before editing.

  3. uphichet
    Member
    Posted 2 years ago #

    Excellent; The problem was solved already
    Really appreciated with your kindly support

    Regards,
    Phichet

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags