Support » Themes and Templates » Replacing the […] in an Excerpt

  • Resolved avatarati

    (@avatarati)


    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? 😀

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    Thread Starter avatarati

    (@avatarati)

    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 🙂

    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')

    Thread Starter avatarati

    (@avatarati)

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Replacing the […] in an Excerpt’ is closed to new replies.