Forums

[resolved] wp_get_categories && wp_get_bookmarks help plz (4 posts)

  1. mickeydz
    Member
    Posted 4 years ago #

    I am wanting to get my wp_get_categories to appear inline with commas like this: cat1, cat2, cat3, cat4, cat5

    I am also wanting wp_get_bookmarks to have commas so they appear the same way, like this: cat1, cat2, cat3, cat4, cat5

    I've gotten the wp_get_bookmarks to appear inline but no commas, I've read that the reason the wp_get_categories don't display like that, inline, is because they have line breaks after each title/link. I don't know if that is true or not but I can't get it to appear like that still. Thanks for reading this and for any help you provide! :)

  2. Charles Frees-Melvin
    Member
    Posted 4 years ago #

    put the comma in the &after.

  3. mickeydz
    Member
    Posted 4 years ago #

    awesome that worked, I was putting the , after title_after= and it wasn't working but putting it after the after= worked like a charm... Is there a way to eliminate the comma if the link is the last link though? For instance right now its like this... cat1, cat2, cat3,

    I would like it to be... cat1, cat2, cat3

    ALSO my wp_get_categories is still not working like the wp_get_bookmarks is. Thanks

  4. mickeydz
    Member
    Posted 4 years ago #

    I was able to get this output: cat1, cat2, cat3
    by using this code: <?php the_category(', '); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic