WordPress.org

Ready to get started?Download WordPress

Forums

RSS feed_image missing alt tag (7 posts)

  1. andymike
    Member
    Posted 8 years ago #

    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.

    Thanks

  2. andymike
    Member
    Posted 8 years ago #

    Some help would be great. It is a simple problem, no-one else has noticed this??

  3. whooami
    Member
    Posted 8 years ago #

    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. ..

  4. andymike
    Member
    Posted 8 years ago #

    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.

  5. andymike
    Member
    Posted 8 years ago #

    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?

    Thanks!

  6. andymike
    Member
    Posted 8 years ago #

    Anyone else know how to fix this issue?

  7. faustina
    Member
    Posted 7 years ago #

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

    http://wordpress.org/support/topic/3542?replies=14

    The very first post should get you working.

Topic Closed

This topic has been closed to new replies.

About this Topic