WordPress.org

Ready to get started?Download WordPress

Forums

how to remove the 'read more'/'keep reading' button (5 posts)

  1. marnixwilmink
    Member
    Posted 1 year ago #

    Hi,
    I really want to get rid of the 'keap reading' button at the end of a post. I've tried anything, but nothing did it..

    After a lot of searching I found out I had to change the_excerpt into the_content. But couldn't find where to in the index.php.
    Finally found something with the words excerpt and changed it into content. but nothing happened.

    someone please help me.

  2. alchymyth
    Forum Moderator
    Posted 1 year ago #

    what theme are you working with?

    can you post a link to your site?

  3. marnixwilmink
    Member
    Posted 1 year ago #

    I'm working with theme: Grisaille.

    My site uses a 'under construction' plugin. Because I don't want to reveal to much yet. But if you really need it, I can deactivate it for so long.

  4. alchymyth
    Forum Moderator
    Posted 1 year ago #

    get rid of the 'keap reading' button at the end of a post

    just get rid of that button or also show the full post?

    to only remove the button, edit functions.php, and remove this:

    /**
    * Change excerpt [...] to something else
    **/
    
    function grisaille_new_excerpt_more($more) {
        global $post;
    	return ' ... <br /><a class="more-link" href="'. get_permalink($post->ID) . __('">keep reading</a>', 'grisaille');
    }
    add_filter('excerpt_more', 'grisaille_new_excerpt_more');

    --

    to change the_excerpt() to the_content(), you will need to edit this line

    <?php the_excerpt(__('keep reading', 'grisaille')); ?></div>

    in these templates:

    home.php (for the front page posts)
    index.php
    archive.php (for archive pages)

  5. marnixwilmink
    Member
    Posted 1 year ago #

    hey thanks man! it worked. Really glad about it! thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic