WordPress.org

Ready to get started?Download WordPress

Forums

change [...] in excerpt (8 posts)

  1. selder2
    Member
    Posted 8 years ago #

    I want to change that [...] when an excerpt is displayed.

    I've found that [...] in /wp-includes/functions-formatting.php on line 732. It says: array_push($words, '[...]');

    I've changed this to:
    array_push($words, '...<br /><br /><a href:"'.get_permalink.'">read more</a>);
    But it doesn't work...

    That gives me a PHP error.

    Does anyone has an idea what I'm doing wrong?

  2. Michael Bishop

    Posted 8 years ago #

    I don't know about editing that file, but Kaf's plugin will allow customization of the excerpt.
    http://guff.szub.net/2005/02/26/the-excerpt-reloaded/

  3. mutube
    Member
    Posted 8 years ago #

    selder2: Just looking at that line of code you're missing an ' at the end (before the last bracket).

  4. selder2
    Member
    Posted 8 years ago #

    miklb: thanks, i'll look into it when all else fails, I already have too much plugins :p

    Mutube: thanks, even with that added quote there's still an error.

    Seems that the "get_permalink" is displayed as "get_permalink" and not as the real permalink to the article. Maybe wordpress tags can't be called upon from within wordpress own files??

  5. selder2
    Member
    Posted 8 years ago #

    Well, I nailed it :)

    Mmm, maybe I should look up how to make this into a plugin! Codex here I come :)

    http://www.damn.be/weblog/index.php/2006/05/10/change-to-read-more-in-wordpress/

  6. Michael Bishop

    Posted 8 years ago #

    Glad you figured it out. Just a note to anyone who does use this, make note of the file changed and which line numbers, so if you ever upgrade, you'll know which file was edited, and where, so you can continue using the different function.

  7. selder2
    Member
    Posted 8 years ago #

    And I've created a plugin which does the above automagically ...

    Would someone test it, and tell me if it is working?

    post: http://www.damn.be/weblog/index.php/2006/05/10/wordpress-plugin-readmore-08-rc1/
    rar: http://www.damn.be/files/wordpress/plugins/readmore.rar

  8. cam_oai
    Member
    Posted 8 years ago #

    just change it in the wp-includes/functions-formatting.php and find the [...] (line 733?)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags