Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #803566

    Hi guys,

    On posts, I get a title that is not relevant. How can I change the posts title to be the category?

    Image link in private. As you can see the post category is different from the title. It’s also a trashed page.

    #803586

    Hey FlatText,
    Are you saying that the post title “Navigating through change” is not relevant, and you wish it matched that category “Banking, Financial services, Publications” ?

    Best regards,
    Mike

    #803588

    Hi Mike,

    No not the post. You can see the post category is “Banking, Financial services, Publications”. But the title heading is ‘News’. I would like the main category to be displayed up top, which is ‘Publications’

    Image attached in private.

    #803621

    Hi,
    Try adding this to the bottom of your functions.php file.

    function avia_default_title_filter($current_post)
    {
    	if(!empty($current_post['title']))
    	{
    		$heading = is_singular() ? "h1" : "h2";
    		$cat = get_the_category($current_post['the_id']);
    		$output  = "";
    		//$output .= "<{$heading} class='post-title entry-title ". avia_offset_class('meta', false). "'>";
    		$output .= "<{$heading} class='post-title entry-title' ".avia_markup_helper(array('context' => 'entry_title','echo'=>false)).">";
    		$output .= "	<a href='".get_permalink()."' rel='bookmark' title='". __('Permanent Link:','avia_framework')." ".$current_post['title']."'>".$cat[0]->cat_name;
    		$output .= "			<span class='post-format-icon minor-meta'></span>";
    		$output .= "	</a>";
    		$output .= "</{$heading}>";
    
    		$current_post['title'] = $output;
    	}
    
    	return $current_post;
    }
    

    Best regards,
    Mike

    #803624

    Hi Mike,

    Now the post page header is showing as ‘Blog – Latest News’, and if I go to any category page ‘domain.com/category/surveys/’ all the posts are getting the wrong title.

    Result in private content.

    Can I just make the header the post title?

    #803660

    Hi,
    As I understood, you wanted the “entry-title” to be replaced with the “blog-categories”, I tested the above function and it dose that. The issue is that when we do this it also affects the category and achieve pages, all the posts are not getting the wrong title, they have been replaced with our code :)
    Sorry, I don’t have any other solution :)

    Best regards,
    Mike

    #803671

    Hi Mike,

    All I want is for the post title to be on the page title instead of ‘Latest News’. If I turn on the breadcrumbs you can see the categories (pic attached). I just want the Main category to be the page title.

    #805331

    Hi,

    I think the easiest, is we modify your category template.
    Please create a child theme, move the category file there and give us backend access.

    Best regards,
    Basilis

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