Forums

[Plugin: Advanced Excerpt] img alt tag (9 posts)

  1. thecoup
    Member
    Posted 1 year ago #

    This plugin is fantastic. It's an elegant addition to a core WP function.

    My only trouble is that I've excluded the <img /> tag, but the alt="text" appears in the excerpt. I often have an image at the top of a post, but this text doesn't make sense in the excerpt.

    Any suggestions?

    p.s. It's working for so far on WP 2.6.1

  2. thecoup
    Member
    Posted 1 year ago #

    p.s. this is regarding the plugin Advanced Excerpt

  3. thecoup
    Member
    Posted 1 year ago #

    Oddly, it also inserts an
    after the img's alt text. For now, I'm going to let the plugin keep img tags, but display:none in my css...

  4. thecoup
    Member
    Posted 1 year ago #

    Sorry, it inserts a break tag... <br />

  5. thecoup
    Member
    Posted 1 year ago #

    I'm sorry. I would delete the posts above if I could. It's not the img alt tag at all. It's the new p.wp-caption-text that wordpress adds on an image from the media library.

    Unfortunately, I can allow paragraphs and hide this css, but the character count will still include these. I would just delete the captions, but I'm developing sites for other people who would never remember to do that...

  6. basvd
    Member
    Posted 1 year ago #

    So, if I understand correctly, WP inserts more than just an img tag when adding an image to the post?
    If that is so, then this problem is beyond the scope of this plugin. Of course I could add more functionality to the plugin which would allow you to exclude specific pieces of HTML based on a CSS(-like) selector. But considering the small number of users who will actually benefit from this (and the amount of time it could cost me), I am not putting this on the todo-list (yet).
    However, anybody who wants to implement this is free to do so (GPL). :)

  7. dimospbru
    Member
    Posted 11 months ago #

    the caption appears in

    <p class="wp-caption-text">some text after an image</p>

    It wouldn-t be bad to add a custom filter addition field, maybe, if that's possible.

    Anyway - cool plugin! Thank you!!

  8. itzsnider
    Member
    Posted 11 months ago #

    I also need this option as it is definitely breaking my pages and looks terrible.

    Anyway of helping us out?

  9. basvd
    Member
    Posted 9 months ago #

    Add this to your CSS:
    .excerpt .wp-caption-text {
    display: none;
    }

    This will hide all elements with class="wp-caption-text" that are inside an element with class="excerpt" (you will have to add that wrapper manually to your template, I guess, unless there already is a wrapper of some sort).

Topic Closed

This topic has been closed to new replies.

About this Topic