Forums

Insert More Tag & the_excerpt() (9 posts)

  1. oiler
    Member
    Posted 7 months ago #

    When using the_excerpt(), what happens if a blog author uses the Insert More Tag in their post?

    For example, if a blog theme uses the excerpt tag for content and a writer puts their own <!--more--> markup in their post to customize their own excerpt, it looks like the_excerpt() function will recognize the proper length to cut off that post's excerpt, but won't attach the proper "Read More »" markup with it.

    So it just ends there and it looks like that's the end of the post since there's no Read More...

    Is this as intended or an overlooked aspect of the_excerpt?

  2. alchymyth
    The Sweeper
    Posted 7 months ago #

    When using the_excerpt(), what happens if a blog author uses the Insert More Tag in their post?

    nothing - the two are independant.

    will recognize the proper length to cut off that post's excerpt, but won't attach the proper "Read More ยป" markup with it.

    you need to add some code to functions.php of the theme:
    http://codex.wordpress.org/Function_Reference/the_excerpt#Make_the_.22read_more.22_link_to_the_post

  3. oiler
    Member
    Posted 7 months ago #

    Thanks for your reply, but that function only works when using the_content()

    But when using the_excerpt() it just cuts the post off and adds no read more.

  4. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 7 months ago #

    Is this as intended or an overlooked aspect of the_excerpt?

    As intended.

    The link alchymyth gave you tells you how to write code to make a read-more link.

    Also, you can edit your theme to include a read-more below the excerpt.

  5. alchymyth
    The Sweeper
    Posted 7 months ago #

    you have to decide:

    if you want to use the_content() and the 'more tag' to decide where the post gets shortened (with a 'read more' link at the end) -
    or the_excerpt() which automatically shortens the post, and where you could have a link at the end by using the code I linked to.

    http://codex.wordpress.org/Function_Reference/the_excerpt
    vs
    http://codex.wordpress.org/Function_Reference/the_content

    edit:
    ps:
    some more involved messing around with content and excerpt, which might be related.

  6. oiler
    Member
    Posted 7 months ago #

    Exactly, I get all that.

    And as theme developers, we are deciding to use the_excerpt()

    But nothing is stopping a blog author from adding <!--more--> into their post.

    Here's a link to a screenshot example of what I'm talking about.

    http://s164.photobucket.com/albums/u28/oiler1039/?action=view&current=Screenshot2011-10-31at112409AM.png

    The first post, 'Bears', is using the_excerpt() and we are customizing the read more text and length.

    The second post, 'War & Peace', is also the same code as 'Bears' but in the post editor, the author has added <!--more--> after the first sentence. So you see a shorter excerpt and no read more link.

    Hope this helps clarify what I'm getting at.

    We want to automate excerpts for standard post-formats, but if the author goes in and adds their own (using <!--more-->) we'd like to at least standardize the Read More link.

  7. alchymyth
    The Sweeper
    Posted 7 months ago #

    The second post, 'War & Peace', is also the same code as 'Bears' but in the post editor, the author has added <!--more--> after the first sentence. So you see a shorter excerpt and no read more link.

    unlikely - unless the theme has some special filters or so to get the excerpt to react on the <!--more--> tag;
    imho, more likely - the author has entered a short manual excerpt below the post editor.

    what theme are you using? (only if it is a free available theme)

  8. alchymyth
    The Sweeper
    Posted 7 months ago #

    We want to automate excerpts for standard post-formats, but if the author goes in and adds their own (using <!--more-->) we'd like to at least standardize the Read More link.

    have a look into this topic: http://wordpress.org/support/topic/setting-more-1-or-0-wont-trim-the_content?replies=17

  9. oiler
    Member
    Posted 7 months ago #

    It's a theme we're building for a newspaper's blog.
    We're definitely sold on using the_excerpt for standard post-formats but we're trying to cover our bases for what we've seen from a wide variety of bloggers.

    It seems the problem we're having comes from the lack of parameters / args available for the_excerpt()

Reply

You must log in to post.

About this Topic