WordPress.org

Support

Support » How-To and Troubleshooting » get_the_category_list

get_the_category_list

  • kbkisan
    Member

    @kbkisan

    Hi, I’m building a wordpress site using the Autofocus template and I’m having problems with the meta part. The thing is that one the single.php pages I want to show all the categories used by the post and the tags and I’m doing it like this.

    <?php printf( __( '%6$s%7$s', 'sandbox' ),
    '<span class="author vcard"><a class="url fn n" href="' . get_author_link( false, $authordata->ID, $authordata->user_nicename ) . '" title="' . sprintf( __( 'View all posts by %s', 'sandbox' ), $authordata->display_name ) . '">' . get_the_author() . '</a></span>',
    get_the_time('Y-m-d'),
    get_the_time('H:i:sO'),
    the_date( '', '', '', false ),
    get_the_time(),
    get_the_category_list(', '),
    get_the_tag_list('<br/><div class="singletags">','<br/> ','</div>'),
    get_permalink(),
    the_title_attribute('echo=0'),
    comments_rss() ) ?>

    But when I go to a single page for some reason it only shows the last category in the list, i.e. if I would have linked the post with the categories

    news
    headline
    other

    in that order, it only prints out the category other.

    Any help would be greatly appreciated since this is messing up my vacation.

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘get_the_category_list’ is closed to new replies.