WordPress.org

Ready to get started?Download WordPress

Forums

Excerpt Length (not RSS) (6 posts)

  1. DarkCryst
    Member
    Posted 9 years ago #

    Hey all, this may have a REALLY simple answer, but I can't find it for all the searching of here and google.
    I'm pulling out an excerpt of posts for my front page, (using the_excerpt or get_the_excerpt, there seems to be no difference in those two functions).
    Now the faked excerpt is 121 characters long, how can I make it less (say.. around 50-60)? I used the old "wp-admin/options.php?option_group_id=X" thing to get at the "hidden" options.. but the rss_excerpt_length field there doesn't effect the normal faked excerpt.
    Any suggestions on how I can do this?

  2. Michael Adams (mdawaffe)
    Member
    Posted 9 years ago #

    Do you mean 121 characters or words? Mine is words.
    Hm... my current CVS installation doesn't seem to behave the way the wiki says it should: http://wiki.wordpress.org/?pagename=the_excerpt , http://wiki.wordpress.org/?pagename=get_the_excerpt .
    For me, get_the_excerpt needs to be echoed but the_excerpt does not (which makes sense, but the wiki makes no difference between the two). Also, the fakeit option does not seem to use the number of words specified in rss_excerpt_length, as the wiki might imply. template-functions-post.php says fakeit uses 120 words; I suppose you could change this to use rss_excerpt_length.
    But, why should I complain about those functions? Using the following seems to work for me:
    <?php the_excerpt_rss(50) ?>
    It inserts the first 50 words of the excerpt (or, if there is no excerpt, the first 50 words of the post) followed by '...' (unless, of course the excerpt/post is less than 50 words, in which case there will be no '...')

  3. DarkCryst
    Member
    Posted 9 years ago #

    Yes I did mean words, sorry.
    Yeah, I tried that. The problem is I need the formatting, and the_excerpt_rss strips the formatting.
    Why the_excerpt doesn't except a number as an argument I don't know. Would seem logical. I'm getting the feeling I'm going to have to edit the db in phpMyAdmin, which I was hoping I didn't have to do.
    The reason the excerpt and get_the_excerpt don't use the RSS extract length is that they aren't used for RSS. There are RSS functions for that. In of itself that is logical - but this leaves us without a way to control the regular excerpts. What would make more sense is that that vaule in the panel is just the generic excerpt length - RSS or not. Certainly would make life easier.
    Or am I not making sense? I always worry about that.

  4. Beel
    Member
    Posted 9 years ago #

    If you create an excerpt with html in it then I believe it will show up in the_excerpt()

  5. Michael Adams (mdawaffe)
    Member
    Posted 9 years ago #

    Right - my last remark was about fakeit generated excerpts. Sorry for the ambiguity.

  6. Michael Adams (mdawaffe)
    Member
    Posted 9 years ago #

    Kafkaesqui has just solved your problem:
    http://wiki.wordpress.org/the_excerptReloaded

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags