• Hi
    This is great plug in, but alas it is creating invalid xHTML code. I notice that none of the tags have a ” around them. I do not know how to fix this in the thumbnailforexcerpts.php file. I am not an expert on php so do not know how to adapt the code so that “” surround the img tag. Also the img src code creates > instead of / >. If anyone could paste up a solution, I would be so grateful. Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • It’s simple really. I’m not sure of the line numbers in an unedited thumbnailforexcerpts.php, but just scroll down towards the bottom and there are a couple of echos that output the links and images. Just wrap each attribute value with a single quote or escape to use double quotes and close the image tags. Looks something like this (my lines 124-133):

    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."'":"")." border='0'/>".(TFE_LINK=="yes"?"</a>":"");
    		}
    		else {
    			$condsize = "width";
    			if ((TFE_MAXSIZE=="yes") && extension_loaded('gd') && function_exists('gd_info')) {
    				$im = imagecreatefromjpeg(realpath(".")."/".substr($img1,stripos($img1,"wp-content")));
    				if(imagesx($im)<imagesy($im))
    					$condsize = "height";
    			}
    		    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."'":"")." border='0'/>".(TFE_LINK=="yes"?"</a>":"");

    thanks, that’s the fix i’ve been looking for!

    lines 124 > 133 are just plain wrong in the original plugin. someone hear an update coming?

    The update has come and is XHTML valid.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Invalid XHTML code in thumbnail-for-excerpts plug in’ is closed to new replies.