WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Replacing the [...] in an Excerpt (5 posts)

  1. avatarati
    Member
    Posted 3 years ago #

    In my index.php, I call for the_excerpt using PHP instead of the_content.

    When using this, of course, it generates a "[...]" at the end of the excerpt. Is there any way to target this to replace it with a proprietary Read More image? Or will I have to get away from using the_excerpt and do it using an actual Read More command in every post while using the_content?

    The latter would be inconvenient, so, does anyone know how to customize the_excerpt? :D

    I promise I won't solve my own problem again this time lol.

  2. Jeremy Pry
    Member
    Posted 3 years ago #

    Have you tried searching through the codex to see what information is in there? The exact thing that you're asking is actually documented there.

    Here's the link to the page: http://codex.wordpress.org/Function_Reference/the_excerpt.

    In general, it's good to search around instead of only relying on the forums. This usually ends up saving you time, because there are lots of issues that people before you have had, and have figured out a solution for.

    If any of this seems a bit surprising, or if it's new to you, it would be a good idea to check out http://codex.wordpress.org/Forum_Welcome.

  3. avatarati
    Member
    Posted 3 years ago #

    Well I'm sorry if you volunteered to waste five minutes of your life replying to my post then.

    Thanks for the info though. Considering that every single WordPress issue has probably been hammered out by now, I imagine you can just use this same reply with every new thread, am I right? Surprised that people still create new threads when everything is in the codex?

    Admittingly 1) I'm lazy, but 2) People sometimes offer more customized or in-depth code than what you can find - which could be of use in this situation.

    Thanks for the condescending and deriding comment.

    Fortunately this is the last bit of information that I need to complete my site. I built it by searching through the codex ironically; because everytime I posed a question on this forum, I got the same snobby remarks. Nice community.

    But like I said, thanks for wasting five minutes of your life for me. Guess I don't have to bother members like you anymore now that I'm finished with everything.

    Cheers :)

  4. Jeremy Pry
    Member
    Posted 3 years ago #

    Honestly, I don't see any of this as a waste of time. It seemed that you were in a hurry for the information, so I wanted to point out that it might have saved you some time.

    Perhaps I could have phrased my answer to be less condescending, as it wasn't meant to be that way. I wanted to make sure that you were aware of the available tools to assist you, as well as the general conventions used on these forums.

    If you'd like to be more specific, you can completely remove the ellipses (not just replace them with different text) with this code:

    function new_excerpt_more($more) {
    	return '';
    }
    add_filter('excerpt_more', 'new_excerpt_more')
  5. avatarati
    Member
    Posted 3 years ago #

    It's no problem, like I said I do appreciate the information. I was able to modify the PHP codes on the link you provided and then isolate an image I created for it. Got the effect to work beautifully.

    Many thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic