Displaying 2 parent categories under post title
-
Hey there.
So I have a bit of a complicated question, I want to achieve a color coded organized category posts.
Basically this is what I want to achieve
https://www.earmilk.comI want all my posts to be organized in two main places.
There are the main “type” of posts
WEEKLY
-Mix Monday
-The Good Stuff
-New Release
-EVENTS
-Event reviews
-Upcoming Events
-Boston
-DMV
-Miami
-New York
-Vermont
FEATURES
-Interviews
-Contests
-Album Reviews
-ContributeThen each post is also categorized by a music genre. All music genres are categorized by tempo. So it looks something like this:
*70-100
**dubstep
**drumstep
**glitch hop*110-130
**moombahton
**midtempo
**house
***dutch
***electro
***progressive
***nu-jumpup
***nudisco*140-180
**dubstep
***grime
**drum and bass
***jungleI want each of my posts to have whatever MAIN type of post it is and what tempo it is.
Right now I have a code marked up to display one of the categories. I am not too sure which category is in which order, so I guess I would need help with that.
<?php $category = get_the_category(); if($category[0]){ echo '<a>slug.'" href="'.get_category_link($category[0]->term_id ).'">'.$category[0]->cat_name.'</a>'; } ?>
Keep in mind that each main category is a different color so two different colors should show up.
Hope I could get some help!
- The topic ‘Displaying 2 parent categories under post title’ is closed to new replies.