• It would appear to me that the default functionality of the_excerpt() tag is to fetch back a certain number of words from the body of a post and display them if there is no quicktag <!--more--> AND if there is no explicitly written excerpt in the excerpt field. That all makes sense. But it would also appear that the_excerpt() tag cleans out anchor tags. That is to say, if you have links in the first 30 or 50 words of your post and you use the_excerpt() to fetch them, the anchor tags are removed. Why would this be the default behavior? Why would you want to override the author’s intended content? And more importantly, is there any way around this?

    And before you suggest that I use the_content() tag, it should be pointed out that if you specifically query posts as opposed to using the loop, you will still have a problem since the <!--more--> quicktag is completely ignored.

    So, in other words, it would appear to me that there is no way to query a set of specific posts (i.e. some one author’s posts) and show excerpts of those posts in a lists with their anchor tags intact. Am I correct in thinking this? It just doesn’t seem right.

Viewing 3 replies - 1 through 3 (of 3 total)
  • have you tried the Scott Yang’s search excerpt? many customizations are possible

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    The default behavior of the_excerpt is to remove *ALL* tags. Excerpts are text only, they do not contain links or formatting, by definition.

    Thread Starter ruzel

    (@ruzel)

    Thanks nonletter. That looks like a highly useful plugin. I also found this nifty trick on another thread (from pifucan)

    When making a specific query (such as query_posts('category_name=conferences');) in a template, if you then use the_content to show your posts, the more tag will be ignored. If you use the_excerpt, your formatting will be stripped. To get around this, create a global variable called $more and set it equal to true before calling your query. And then, if afterwards you would like following posts to show their full content, you can set back to “true” after the query is run; like so:

    <?php global $more; $more = false;
        query_posts('category_name=conferences');
        the_content('Continue Reading');
        //this last line is only necessary if you have more posts
        //to show in your template and want to show their full bodies,
        //not excerpts
        $more = true; ?>

    You can find more info on this technique here

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘the_excerpt() tag functionality’ is closed to new replies.