Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #292204

    To change the header ‘Blog – latest news’ to something else you need to add the following code to functions. php:

    But how to show the category here?

    add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
    function fix_single_post_title($args,$id)
    {
    if ( $args['title'] == 'Blog - Latest News' )
    {
    $args['title'] = get_the_title($id);
    $args['link'] = get_permalink($id);
    }
    
    return $args;
    }
    #292423

    Hi motylanogha!

    Thank you for using our theme.

    To get the categories for a post:

    
    $post_categories = wp_get_post_categories( $id );
    $cats = array();
    	
    foreach($post_categories as $c){
    	$cat = get_category( $c );
    	$cats[] =  $cat->name;
    }
    
    $args['title'] = implode (',', $cats);
    
    

    Regards,
    Günter

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.