Tagged: , ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #372751

    When displaying a single post, I would like the post title to appear in the title_container div inside h1 tags. Right now it just says “Blog” (the name of the page that I have assigned the blog to in theme options) without h1 tags. I would also need to remove the single post title in the post-title div with h2 tags that is currently there.

    I have looked at a few different solutions in searching the forums but I can’t find one that works for me.

    #372773

    Hi hmsvictory!

    Add this to the bottom of your functions.php file.

    add_filter( 'avf_title_args', 'enfold_customization_single_title', 0, 2 );
    function enfold_customization_single_title( $args, $id ) {
    	if ( is_single() ) { $args['title'] = get_the_title($id); }
    	return $args;
    }

    And then comment out line 130 in /includes/loop-index.php.

    echo $title;
    

    Cheers!
    Elliott

    #372798

    Elliott, thanks for the fast reply.

    That does add the post title in the title_container div. I would like to wrap that title in h1 tags – is there a way to add that to the functions.php?

    Changing the loop-index.php does remove the duplicate title in the post-title div on the single post pages. Unfortunately, it also removes the post titles on the regular blog index page :)

    #372807

    Something else I notice is the lack of consistency in the title_container div. Page titles outside the blog or store get h1 tags automatically.

    But in the Store or Blog the content of the title_container div does not have h1 tags. This makes consistent styling & appearance more challenging.

    #372898

    Hey!

    This will set it to an H1.

    add_filter( 'avf_title_args', 'enfold_customization_single_title', 0, 2 );
    function enfold_customization_single_title( $args, $id ) {
    	if ( is_single() ) { $args['title'] = get_the_title($id); $args['heading'] = 'h1'; }
    	return $args;
    }

    Best regards,
    Elliott

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