Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26792

    I need in my blog page (grid, three columns, title and exerpt) in the the displayed meta-data under the image and the title not the date of release as designated. I need at the same place the category (or the tag too) of the blog-entry.

    I have found the codeline in the postslider.php:

    $output .= “<div class=’slide-meta-time’>” .get_the_time(get_option(‘date_format’), $the_id).”</div>”;

    But I don’t know, what I have to insert, to display the category instead. All my trials failed. Do You have an appropiate code snippet for me, if it would be so simple.

    Regards

    #131631

    Replace

    $output .= "<div class='slide-meta-time'>" .get_the_time(get_option('date_format'), $the_id)."</div>";

    with

    $taxonomies  = get_object_taxonomies(get_post_type($the_id));
    $cats = '';
    $excluded_taxonomies = apply_filters('avf_exclude_taxonomies', array('post_tag','post_format'), get_post_type($the_id), $the_id);

    if(!empty($taxonomies))
    {
    foreach($taxonomies as $taxonomy)
    {
    if(!in_array($taxonomy, $excluded_taxonomies))
    {
    $cats .= get_the_term_list($the_id, $taxonomy, '', ', ','').' ';
    }
    }
    }

    if(!empty($cats))
    {
    $output .= "<div class='slide-meta-time'>";
    $output .= $cats;
    $output .= "</div>";
    }

    #131632

    Hi Dude,

    thank You very much – the code is working really fine!

    Günter

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

The topic ‘Category instead of Date’ is closed to new replies.