This topic has 1 reply, 2 voices, and was last updated 10 years by Abe.

  • Author
  • #13515
     jaybini
    Participant

    i want to add category name to the post carousel for example in
    wp-content/themes/sweetdate/framework/shortcodes/shortcodes.php
    i added the date but i cant add the category name to appear under the date

    COPY CODE
    
     case 'image':
    if (get_post_thumbnail_id())
                        {   
                            $output .= '<li>';
                            $output .= '<div class=""><a href="'.  get_permalink().'">';
                            $output .= '<span class="read"><i class="icon-'.apply_filters('kleo_img_rounded_icon','heart').'"></i></span>';
                            $output .= get_the_post_thumbnail(null,'blog_carousel');
                            $output .= '</a></div>';
                            
                            $output .= '<h4>'.get_the_title().'</h4>';
                            $output .= '<p>'.  word_trim(get_the_excerpt(), 15, '...');
                            $output .= '<br/><i>'.get_the_date().'</i></p>';
                            $output .= '<p><a href="'.  get_permalink() .'"><i class="icon-angle-right"></i> '.__("READ MORE", 'kleo_framework').'</a></p>';
                            $output .= '</li>';
                        }
                        break;
    
    #13769
     Abe
    Keymaster

    hi, See wordpress codex for the function to get a post categories: http://codex.wordpress.org/Function_Reference/get_the_category

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?