Ready to get started?Download WordPress


Passing the template_url into the wp_list_categories query string (3 posts)

  1. nicjohnson
    Posted 7 years ago #

    I'm using wp_list_categories and I'd like to show a feed image. I'm setting feed_image in the list of parameters but I want to pass in the variable for the Template URL.

    I've tried bloginfo(template_url) but that spits it out before the list items instead of embedding the value in the parameter list where I want it.

    Any help is appreciated.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Okay, what "Template URL" are you talking about? Could you be more clear? What are you trying to do? I'm not understanding your end goal here.

  3. nicjohnson
    Posted 7 years ago #

    Dang, Otto, you're quick. I came back 6 minutes later to say I'd figured it out and you'd already replied! Thanks!

    So, I wanted to get the template_url so I could use it to point to an image inside my theme. I was using bloginfo(template_url) to try to insert into a query parameter string when I should have been using get_bloginfo(template_url).

    So, the solution code is:

    wp_list_categories('title_li=&show_count=1&orderby=count&order=desc&feed_image='. get_bloginfo(template_url) .'/images/rss-icon.jpg');


Topic Closed

This topic has been closed to new replies.

About this Topic