• mazdakam

    (@mazdakam)


    Hi i am using 2.1.2 and everything is fine on it. i am using this code for showing rss image feed for each category
    <?php wp_list_categories("sorderby=name&show_count=1&feed=RSS&title_li&feed_image=wp-content/plugins/widgets/rss.png"); ?>

    and it generate on front page this true URL:

    http://www.mazdakam.com/weblog/wp-content/plugins/widgets/rss.png
    so it is work on front page but it didn’t work on archive page and single page. it generate wrong url of image. it generate this:

    http://www.mazdakam.com/weblog/archives/wp-content/plugins/widgets/rss.png

    as you see archive shouldn’t be in the url but it has!
    i don’t have any idea about it please help me to solve this problem. is it bug?!
    thanks in advanced

Viewing 5 replies - 1 through 5 (of 5 total)
  • drmike

    (@drmike)

    Use the full URL for the image instead of just part of it.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Use this instead, in other words:
    <?php wp_list_categories("sorderby=name&show_count=1&feed=RSS&title_li&feed_image=http://www.mazdakam.com/weblog/wp-content/plugins/widgets/rss.png"); ?>

    Thread Starter mazdakam

    (@mazdakam)

    <?php wp_list_categories("sorderby=name&show_count=1&feed=RSS&title_li&feed_image=http://www.mazdakam.com/weblog/wp-content/plugins/widgets/rss.png"); ?>

    Yes i know that worked for me but as you know it is better to use relative address and i think it is a bug for this function what is your idea

    Thread Starter mazdakam

    (@mazdakam)

    <?php wp_list_categories("sorderby=name&show_count=1&feed=RSS&title_li&feed_image=http://www.mazdakam.com/weblog/wp-content/plugins/widgets/rss.png"); ?>

    Yes i know that worked for me but as you know it is better to use relative address and i think it is a bug for this function what is your idea?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Yes i know that worked for me but as you know it is better to use relative address and i think it is a bug for this function what is your idea

    Okay. You have two ideas there for consideration:

    1. Better to use relative addresses: Not really. Whether it’s better to use relative addresses or not is really an open ended question. In the case of using rewritten URLs like this, you really cannot use a relative address, because the URL is not a direct correspondence with the actual path on the website.

    2. It’s not a bug. It’s just a bit literal and doing more or less exactly what you told it to do.

    If you want to use an address that will move with your blog, then you need to specify the address as a fully qualified path, but without using the literal address. Fortunately, you’re covered there as well, with WordPress.

    Try this:
    <?php wp_list_categories("sorderby=name&show_count=1&feed=RSS&title_li&feed_image='.bloginfo('home').'/'.PLUGINDIR.'/widgets/rss.png"); ?>

    The bloginfo(‘home’) function will get the URL of your main blog, as defined on the Options->General screen. So if you move the blog to a new URL later, it will still work. And PLUGINDIR is the plugin directory name, which is also adjustable internally.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘RSS Feed Images doesn’t show in archive page with wp_list_categories’ is closed to new replies.