Forums

Concatenate string to wp_list_categories (3 posts)

  1. Mark
    Member
    Posted 2 years ago #

    I am curious on how I would add a custom variable to the end of my permalinked Category listing. I'm not sure which file I would have to edit and thought I'd look to my comrades here for support.

    I just want to pass a $referralcode variable to my category links. Does anyone know where I'd be able to do this? I was hoping to be able to do that with this string:

    <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>

    That way I wouldn't have to edit the loop or anything. Any ideas?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    You might be better off using get_categories and constructing your own category list via a foreach loop.

  3. Mark
    Member
    Posted 2 years ago #

    Thanks esmi, but I ended up writing an array and manipulating the Folding List Category plugin to do what I needed :) Your idea sounds good but I think I may have more control over not erasing my work in a plugin than in the loop since updates for WP seemingly occur more frequently than that of plugins :)

Topic Closed

This topic has been closed to new replies.

About this Topic