SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    WP List Post Categories.. Can't Figure Out How-To List! Help!

    Function:
    Code:
    if (!function_exists('typo_posted_footer')) :
    function typo_posted_footer() {
    $tag = get_the_tag_list('', __(', ', 'typo-o-graphy'));
    $categories = get_the_category_list(__(', ', 'typo-o-graphy'));
    if ($tag) {
    printf(__('<li> %1$s </li>', 'typo-o-graphy'), $categories, $tag);
    }
    elseif($categories) {
    printf(__('<p>Categories: %1$s </p>', 'typo-o-graphy'), $categories);
    }
    }
    endif;
    I'm trying to use this:
    Code:
    <ul>
    <?php  typo_posted_footer(); ?>
    </ul>
    To:
    • Get
    • A
    • List
    • Like
    • This


    Instead I'm getting the categories listed out with commas... Follow link look at bottom of the page to see the categories comma separated. Want to <ul><li> each one out.

    http://test.madadmedia.com/jon-r-gergeceff/

    Help would be greatly appreciated! Thanks! I know it says something about the tag function but I don't care about tags. Only category.

  2. #2
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let me break down the Functions.php code that I can't figure out:
    Code:
    $categories = get_the_category_list(__(', ', 'typo-o-graphy'));
    if ($tag) {
    printf(__('<li> %1$s </li>', 'typo-o-graphy'), $categories, $tag);
    }
    That %1$s are the "categories." I can't figure out how to have this displayed in a <UL> and not comma separated... Someone please help me out here!

    THANK YOU!

    Scott

  3. #3
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Solved.

    Stupidity killed the cat...
    Code:
    $categories = get_the_category_list(__('', 'typo-o-graphy'));
    if ($tag) {
    printf(__(' %1$s ', 'typo-o-graphy'), $categories, $tag);
    }
    Remove the whole <UL> and you're good to go... Lol! But I will be back for more answers... Soon... Probably tomorrow!

    Love this forum though!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •