Site logo

Archived topic

Changing the h2 header to h3 and the distance between the featured image

9 replies · Started by Emil on December 18, 2018

Viewing posts 1–10 of 10

Hello,

How to changing the h2 title posts in blog page to h3? How to add snippet to edit this, because I think header h2 in blog-page do multiplications. Next issue is distance between title-page and excerpt description - How can I add css code to fix this problem?

Best regards

Hi there,

i am not sure why you would want to change them to a H3. The H2 tag is the commonly used tag for highlighting entry titles in your archives making them more relevant to search engines. Let me know.

You have the CSS to force the entry title to be three lines to keep the posts aligned. You can remove some of the margin from the entry summary to reduce the space like so:

.entry-summary {
    margin-top: 0.25em;
}

Because I get information from SEO firm about issue with multiplication headers h2 in blog-page. But if you tell me, that's it isn't problem for SEO I believe You :-)

Please help me with distance, because I add this code to Custom CSS but in category (/maty-grzewcze/elektra/) I have still problem.

Best Regard!

Well to the best of my knowledge H2 is the common standard for the entry title on post archives. Having lots of H2's on a post with little content in between may not be a good thing :)

Where did you add the CSS? I can't see it on the page

Please check again, when we click to category-page we don't see chaining. In blog-page I seee change - Thank's :)

Hi there,

you may want to clear your browser cache as i can see the code being applied to the blog and the category archives. The code you added to increase the title to 3 lines minimum is the greater problem. Maybe reduce that to only 2 lines?

Hi, I'm joining the conversation.

Any reason not to solve this problem? I have read, both in this forum and in Wordpress, this same doubt and it has not been solved.

While an H2 for the titles of the posts is fine, if we create a description for the category, it will take several H2 that will be more important, that's why at the SEO level it is better to mark the titles of the posts in h3 in some cases.

Please, some function to add in the function.php to change this?

Your effort and time is always appreciated.

Best regards

Hi there,

If you're using GP 3.x, you can do this:

add_filter( 'generate_get_the_title_parameters', function( $params ) {
    if ( ! is_singular() ) {
        $params = array(
	    'before' => sprintf(
	        '<h3 class="entry-title"%2$s><a href="%1$s" rel="bookmark">',
		esc_url( get_permalink() ),
		'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : ''
	    ),
	    'after' => '</a></h3>',
	);
    }
    return $params;
} );

Solved! That code worked perfectly.

I thought this thread was closed. LOL

Thank you very much for your excellent customer service. :)

Glad I could help :)

This archived topic is closed to new replies.