Hi Enfold support team,
I’m using Enfold with a child theme and I’m trying to completely remove the H1 page title from single blog posts. I’m not looking to just hide it via CSS – I want it not to be rendered at all in the HTML source code.
The heading I’m referring to looks like this in the frontend:
<h1 class=”post-title entry-title” itemprop=”headline”>My Blog Title</h1>
I’ve already tried using the avf_title_args filter and even added this to my functions.php:
add_filter(‘avf_title_args’, ‘remove_post_title_in_single’, 10, 2);
function remove_post_title_in_single($args, $id) {
if (is_single()) {
$args[‘title’] = ”;
}
return $args;
}
But the H1 is still showing up in the source code of the post.
Can you please confirm:
Which template or hook is responsible for rendering this H1?
What is the best way to remove it completely from the markup (e.g. via remove_action() or overriding a template in the child theme)?
Is there an officially supported way to do this for blog posts?
Thanks in advance for your help!
– Andreas
Hey andreasb68,
Thank you for the inquiry.
You can add this code in the functions.php file to completely remove the post title:
remove_filter( 'post-format-standard', 'avia_default_title_filter', 10, 1 );
add_filter( 'post-format-standard', 'avia_default_title_filter_mod', 10, 1 );
function avia_default_title_filter_mod( $current_post ) {
$current_post['title'] = '';
return $current_post;
}
Best regards,
Ismael