WordPress.org

Ready to get started?Download WordPress

Forums

Thumbnail For Excerpts generates invalid XHTML (3 posts)

  1. galbaras
    Member
    Posted 5 years ago #

    Thumbnail For Excerpts is a wonderful plugin, making excerpts far more appealing than they are by default.

    However, when validating my site's HTML, I got errors from missing double quotes around attribute values and others a bout missing alt attributes.

    I would like to suggest the following:

    1. Change line 22 to

    define("TFE_TITLE","yes"); // show alt tags by default

    2. Change line line 124 to

    That didn't go too well with the code. Let me try again:

    echo (TFE_LINK=="yes"?'<a href="'.get_permalink($id).'">':"").'<img src="'.$img2.'" class="'.TFE_CLASS.'" hspace="'.TFE_SPACE.'" align="'.TFE_ALIGN.'" '.$condsize.'="'.$tfesize.'" '.(TFE_TITLE=="yes"?'alt="'.$tit1.'" title="'.$tit1.'"':' alt="Post thumbnail"').' border="0" />'.(TFE_LINK=="yes"?"</a>":"");
    // Ensure alt tag is there and include double quotes for all attributes

    3. Change line 133 to

    echo (TFE_LINK=="yes"?'<a href="'.get_permalink($id).'">':"").'<img src="'.$img1.'" class="'.TFE_CLASS.'" hspace="'.TFE_SPACE.'" align="'.TFE_ALIGN.'" '.$condsize.'="'.$tfesize.'" '.(TFE_TITLE=="yes"?'alt="'.$tit1.'" title="'.$tit1.'"':' alt="Post thumbnail"').' border="0" />'.(TFE_LINK=="yes"?"</a>":"");
    // Ensure alt tag is there and include double quotes for all attributes

    4. Include a way to submit bugs and requests in the plugin code

    If you know how to get in touch with the author of this great plugin, Radu Capan, please refer him to this thread.

    Best regards,
    Gal

  2. curious1960
    Member
    Posted 4 years ago #

    If you are monitoring this post, could you please advise how to remove 3 xhtml tags that are causing problems. I went from 122 errors down to 3 with your fix, thank you.
    Three remaining errors are about hspace, align and border atributes.
    Thank you in advance for your help galbaras.

  3. mayid
    Member
    Posted 4 years ago #

    I founded another issue. When images haves external links, and TFE_MAXSIZE is set to "yes", this weird thing happends:

    Warning: imagecreatefromjpeg(C:\wamp\www\astarbagus\wordpress/http://www.diseniomadreselva.com.ar/imagenes/borde_derecho.gif) [function.imagecreatefromjpeg]: failed to open stream

    Look at the string. We have two absolute paths.

    SO i'm trying to solve this issue by adding a conditional:

    if (strpos($img1, "http") !== FALSE){

    $im = imagecreatefromjpeg(substr($img1,stripos($img1,"wp-content")));
    }
    else{
    $im = imagecreatefromjpeg(realpath(".")."/".substr($img1,stripos($img1,"wp-content")));
    }

    This may work. But not under windows running PHP 5.2.9 (5.3 will do the work).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.