-
AuthorPosts
-
June 4, 2017 at 12:16 pm #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.
June 4, 2017 at 1:55 pm #803586Hey 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,
MikeJune 4, 2017 at 1:58 pm #803588Hi 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.
June 4, 2017 at 3:58 pm #803621Hi,
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,
MikeJune 4, 2017 at 4:20 pm #803624Hi 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?
June 4, 2017 at 6:26 pm #803660Hi,
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,
MikeJune 4, 2017 at 7:07 pm #803671Hi 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.
June 7, 2017 at 10:20 pm #805331Hi,
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 -
AuthorPosts
- You must be logged in to reply to this topic.