• Resolved SaltwaterC

    (@saltwaterc)


    Is there an elegant manner of placing the RSS image link before the category name when fetching the cats with wp_list_categories(); or do I have to actually start writing some code? After hours of Goggling and searching, I still didn’t find a solution for this issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Well, the “elegant” solution here would require some code writing. The following bit should work for you; replace wp_list_categories() in your template(s) with the following — modify the parameters to match what you use, but retain &echo=0:

    <?php
    $catslist = wp_list_categories('feed=rss&feed_image=/images/feed.gif&echo=0');
    echo preg_replace('%(<a .*</a>) (<a .*<img .* /></a>)%', '\\2 \\1', $catslist);
    ?>
    Thread Starter SaltwaterC

    (@saltwaterc)

    Thanks a lot, it works fine. What can I say … you’re the man and I hate RegEx ?? …

    PS: it doesn’t work with WP 2.2.3 though … I had to upgrade my ‘production’ installation.

    Thanks a lot. Works fine in WP 2.5.
    But how get I rid of the bullet at the beginning of the list?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_list_categories customization issue’ is closed to new replies.