Tagged: , , , , ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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

    #119118

    Hi,

    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

    #119119

    Yes 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?

    #119120

    Hi Alex,

    No, I don’t believe so since it uses the same function.

    Regards,

    Devin

    #119121

    That’s what I thought too. Well, is this something that will be changed in future versions? It would be a great SEO tweak ;)

    #119122

    You 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;
    }

    #119123

    Thanks guys for all the help. Fantastic support! Conditionals work like a charm. Problem solved.

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

The topic ‘Titles on blog page with h2 but single post title with h1’ is closed to new replies.