Marketpress mp_tag_list(); function not working

I can't get the mp_tag_list(); function to work. I'm trying to bring the product tag list (not the tag cloud) to the sidebar, when in the single product page. Here's the code I'm using:

<?php mp_tag_list($post->ID, '<div class="product-tags">', ' ', '</div>'); ?>

But nothing happens. Am I missing something?

  • Kimberly

    rayvellest,

    Hi and Welcome to WPMUdev forums!

    I think maybe your class could use some adjusting? Try this

    <div class="mp_product_tags">

    Let me know if that helps!

    Best,

    Kimberly


    If this thread is not resolved because the suggested action did not work or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

  • Ray

    Hi Kimberly, thanks for your help, but I guess I've just managed to find out what was wrong! The function in itself does not return the content without the use of an echo command, like this:

    <?php echo mp_tag_list($post->ID, '<div class="product-tags">', ' ', '</div>'); ?>

    I wonder why have you brought up the class taxonomy, how could that ever prevent the function to run properly? Either way, the main reason for changing it is because I find to be easier to use my own taxonomy, as I manage many different sites and help me to keep up with all of them.

    On a matter of fact, I also prefer to have the tags inside a list item element, so this is the version which I have found to work and offer the best HTML standard as possible:

    <?php echo mp_tag_list($post->ID, '<ul><li>', '</li><li> ', '</li></ul>'); ?>

    Hope it helps anyone else out there facing the same problem! :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.