Support » Themes and Templates » RSS feed_image missing alt tag

  • I am using the wp_list_cats in my sidebar and enabling the RSS feed image like so:

    <?php wp_list_cats('sort_column=name&children=1&feed_image=images/icon-rss.gif'); ?>

    The problem is WP is outputting the image with no alt tag. This results in a failed validation and poor XHTML. How can this be fixed?

    Any help would be great.


Viewing 6 replies - 1 through 6 (of 6 total)
  • Some help would be great. It is a simple problem, no-one else has noticed this??




    I believe I actually noticed this in an earlier version and fixed it myself.

    Looking at wp-includes/template-functions-category.php, the problem atleast for me is found at line 352, assuming youve made no other changes.

    it reads:

    if ( !empty($feed_image) )
    $link .= "<img src='$feed_image' $alt$title" . ' />';

    Now my current php is substantially different elsewhere as well, but this is what I did:

    if (! empty($feed_image)) {
    $link .= "<img src="$feed_image" class="feedimage" border="0" alt="RSS Feed"...;

    that alone wont work for you, you will need to close that tag obviously…

    if (! empty($feed_image)) {
    $link .= "<img src="$feed_image" class="feedimage" border="0" alt="RSS Feed" .... <– close this

    But you get the idea, im sure 🙂

    oh and btw, all of my quotes are escaped, the forum removed them for some reason. ..

    Thanks for the response. I get what you are saying with the code and I can manually go in and fix that.

    But this is a bug because WP is creating invalid code in this instance. Anyone know if this behavior has been reported in the tracker?

    Another annoying problem with feed_image:

    If you used a styled list for your categories with a background-image instead of the default bullets you will have to position your background-image so it centers on each list item. When you activate the feed_image it throws off the positioning of your list background-image in IE 6 causing it to move down to far. This is an IE6 bug but worth mentioning nonetheless.

    I tried implementing the solution you gave me and I keep getting a database error. Could you possibly try and post the code again within a code box so I can get it right?


    Anyone else know how to fix this issue?

    I know that this is a really old thread but I found your answer and thought you might still want it.

    The very first post should get you working.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘RSS feed_image missing alt tag’ is closed to new replies.