Putting H2 tag on block title in home, pages and categories

Posted in: Newspaper
Post count: 268

Hi,

I was looking for a way to add h2 tags to the titles of the blocks in the home and on the pages

I saw that you can do by editing (puttting h2 instead of h4) in
\ Newspaper \ includes \ block_templates \ td_block_template_1.php

// there is a custom title
$buffy = ”;
$buffy .= ‘<h4 class=”block-title”>’;
if (!empty($custom_url)) {
$buffy .= ‘‘ . esc_html($custom_title) . ‘‘;
} else {
$buffy .= ‘<span>’ . esc_html($custom_title) . ‘</span>’;
}
$buffy .= ‘</h4>’;
return $buffy;
}

the problem is that h2 is also added to the titles of the blocks on the sidebar of the post..

how to not include them in sidebar post to avoid putting too much h2 (in addition to that the article)?

  • This topic was modified 10 years by Bintmusic.
Post count: 6535

Hi

All blocks tiles are generated by same function so with the current implementation isn’t possible to generate a different heading. A solution would be to create a new function with put h2 on block title and call it on each block where you want to change the heading.
This is a complex task and which require many customizations is theme’s file and unfortunately I can’t provide a solution now. If you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you.

Thanks!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.