Skip to main content
1 of 2

How to show "category" name?

i'm a novice and i'm trying to edit my theme. I need to show the category after text "Listed in:":

                            //echo $todaydate;
                            if(is_array($rec_dates) && strtolower(trim($is_recurring)) == strtolower(trim('Recurring event')) && in_array($todaydate,$rec_dates)){ /* if recurring event */
                            $c = $counter++;
                            $recurrence_days = get_post_meta($post->ID,'recurrence_days',true); //on which day
                    //  print_r($rec_dates);
                            $end_date1 = strtotime(date("Y-m-d", strtotime($todaydate)) . " +$recurrence_days day");
                            $end_date = get_formated_date(date('Y-m-d', $end_date1));
                            $start_date1 = strtotime(date("Y-m-d", strtotime($todaydate)) . " +$recurrence_days day");
                            $start_date = get_formated_date(date('Y-m-d', $start_date1));
                                $post_info .=' 
                                <a class="event_title" href="'.get_permalink($post->ID).'">'.$post->post_title.'</a><small>'.
                                __('<b>Listed in: </b>').***which code here to show the category?***.'<br>'.
                                __('<b>Location: </b>').get_post_meta($post->ID,'address',true) .'<br>'.
                                __('<b>Start Date: </b>').get_formated_date(get_post_meta($post->ID,'st_date',true)).' '.get_formated_time(get_post_meta($post->ID,'st_time',true)) .'<br />'. 
                                __('<b>End Date: </b>').get_formated_date(get_post_meta($post->ID,'end_date',true)).' '.get_formated_time(get_post_meta($post->ID,'end_time',true)) .'</small>';
                            }else if(strtolower($is_recurring) == strtolower('Regular event')){ /* if regular event */
                                    $post_info .=' 
                                <a class="event_title" href="'.get_permalink($post->ID).'">'.$post->post_title.'</a><small>'.
                                __('<b>Listed in: </b>').***which code here to show the category?***.'<br>'.
                                __('<b>Location: </b>').get_post_meta($post->ID,'address',true) .'<br>'.
                                __('<b>Start Date: </b>').get_formated_date(get_post_meta($post->ID,'st_date',true)).' '.get_formated_time(get_post_meta($post->ID,'st_time',true)) .'<br />'. 
                                __('<b>End Date: </b>').get_formated_date(get_post_meta($post->ID,'end_date',true)).' '.get_formated_time(get_post_meta($post->ID,'end_time',true)) .'</small>';                            
                            }
                            endwhile;
                    $post_info .='</span>';
                }

Thank you in advance :-)