Tagged: 

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

    I would like to know how to change this to display the current category without the Latest News wording. When I run the default WP Twenty Fourteen theme it displays the actual category that the post is in – Enfold doesn’t.

    Thanks

    #219796

    Hey xyzb!

    Please add this on functions.php, this will display the first category of the post:

    add_filter('avf_title_args', 'alter_single_post_title', 10, 2);
    function alter_single_post_title($args,$id) {
    
    	$category = get_the_category($id); 
    	
    	if (is_single()) {
    		$args['title'] = ucfirst($category[0]->cat_name);
    		$args['link'] = get_permalink($id);
    	}
    
    	return $args;
    }
    	

    Best regards,
    Ismael

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

You must be logged in to reply to this topic.