WordPress.org

Ready to get started?Download WordPress

Forums

Display only one category for a post (2 posts)

  1. kr3t3n
    Member
    Posted 5 years ago #

    Hi, I read about a similar problem in the forums but the solution did not at all work for me.
    I am in the following situation: I have posts with up to 5 categories assigned to. When they are listed in home, index, categories, search pages etc. I want them to display only one of their categories (doesn't matter which one, preferably random) because of design issues. Can anyone help me.

    the site is momzo.com and I want to put the category in the place of the "No comment" sign on-top of the images.
    Another solution would be if I could get the categories to display after each other without creating a new line but making a list like this: "one, two, three"
    Right now, they go like this:
    one
    ,
    two
    ,
    three

    Any suggestions?

    Thanks in advance guys!

  2. MichaelH
    Member
    Posted 5 years ago #

    Change to the WordPress Default Theme because it displays all categories for a post on one line. Look at how the wp-content/themes/default/index.php makes use of the template tag, the_category().

Topic Closed

This topic has been closed to new replies.

About this Topic