-
AuthorPosts
-
May 14, 2013 at 3:54 pm #23260
Hi,
friggin love the theme but it needs some small changes for decent onpage optimization. For example the post titles are h2 naturally. Now I already changed those to h1 and the header title to h3 (e.g. http://www.evergreenmedia.at/interne-verlinkung/). But this also changes the post titles to h1 on the blog page (http://www.evergreenmedia.at/blog/). I need the post titles on the blog page (listing of blog articles) to be h2. How do I accomplish this?
Thanks in advance!
Best regards,
Alex
May 15, 2013 at 3:27 am #119118Hi,
Open includes > helper-post-format.php then find this code on line 48.
/**
* The avia_default_title_filter creates the default title for your posts.
* This function is used by most post types
*/
if(!function_exists('avia_default_title_filter'))
{
function avia_default_title_filter($current_post)
{
$output = "";
//$output .= "<h2 class='post-title ". avia_offset_class('meta', false). "'>";
$output .= "<h2 class='post-title'>";
$output .= " <a href='".get_permalink()."' rel='bookmark' title='". __('Permanent Link:','avia_framework')." ".$current_post['title']."'>".$current_post['title'];
$output .= " <span class='post-format-icon minor-meta'></span>";
$output .= " </a>";
$output .= "</h2>";
$current_post['title'] = $output;
return $current_post;
}
}It should be h2.
Regards,
Ismael
May 15, 2013 at 3:21 pm #119119Yes yes, but this changes the post title to h2 on both single and blog page. I want it to be h1 on a single post and and h2 on the blog page. Is that even possible?
May 16, 2013 at 2:12 pm #119120Hi Alex,
No, I don’t believe so since it uses the same function.
Regards,
Devin
May 17, 2013 at 1:25 am #119121That’s what I thought too. Well, is this something that will be changed in future versions? It would be a great SEO tweak ;)
May 17, 2013 at 6:23 am #119122You can try conditionals to change the headline – add following code to functions.php (insert it at the very end):
function avia_default_title_filter($current_post)
{
$output = "";
$headline = is_single() ? 'h1' : 'h2';
$output .= "<$headline class='post-title'>";
$output .= " <a href='".get_permalink()."' rel='bookmark' title='". __('Permanent Link:','avia_framework')." ".$current_post['title']."'>".$current_post['title'];
$output .= " <span class='post-format-icon minor-meta'></span>";
$output .= " </a>";
$output .= "</$headline>";
$current_post['title'] = $output;
return $current_post;
}May 18, 2013 at 2:25 pm #119123Thanks guys for all the help. Fantastic support! Conditionals work like a charm. Problem solved.
-
AuthorPosts
- The topic ‘Titles on blog page with h2 but single post title with h1’ is closed to new replies.