Forums

How do I remove more_link_text? (3 posts)

  1. jpkeisala
    Member
    Posted 7 years ago #

    I am trying to remove "read more link" from the content.
    If I write
    <?php the_content(''); ?>

    it still outputs -> < a href="whatever/?p=26#more-26" > < /a >

    How can I totally remove it?

  2. Kafkaesqui
    Moderator
    Posted 7 years ago #

    Would take a tiny edit to the WP source to get what you're looking for. In wp-includes/template-functions-post.php look for the function get_the_content(), and in there find the line:

    if (count($content)>1) {

    Change it to:

    if ($more_link_text && count($content)>1) {

    Even with such a small alteration, remember when editing source files to back up any you change, and comment your changes.

  3. fallingj
    Member
    Posted 7 years ago #

    That solution works well, Kafkaesqui. Thanks.

    The only problem is the error messages in WordPress admin:

    blockquoteWarning: Cannot modify header information - headers already sent by (output started at /home/abcd/public_html/blog/wp-includes/template-functions-post.php:398) in /home/abcd/public_html/blog/wp-admin/admin.php on line 6

    Warning: Cannot modify header information - headers already sent by (output started at /home/home/abcd/public_html/blog/wp-includes/template-functions-post.php:398) in /home/abcd/public_html/blog/wp-admin/admin.php on line 7

    Warning: Cannot modify header information - headers already sent by (output started at /home/abcd/public_html/blog/wp-includes/template-functions-post.php:398) in /home/abcd/public_html/blog/wp-admin/admin.php on line 8

    Warning: Cannot modify header information - headers already sent by (output started at /homehome/abcd/public_html/blog/wp-includes/template-functions-post.php:398) in /home/abcd/public_html/blog/wp-admin/admin.php on line 9/blockquote

    I can still edit things in admin.

    But as soon as I edit information in the header file and save, it takes me to a page that is blank but for the error messages. Seems to work, though.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.