How to delete Page Title <h1> from the root layout?

Here is the screenshot:

As you can see I have 2 h1 tags. 1 is by the theme default, and the other one is for the customization of the parallax effect.

Now I want to delete the default h1 tag from the root PHP, can you help me out how can I delete that line of code from the root, so that default option delete?

however, I have a custom single.php file on the pro-child directory, but still, the duplicate header recorded is this because of:
// Custom Entry Meta
// =============================================================================

if ( ! function_exists( ‘x_integrity_entry_meta’ ) ) :
function x_integrity_entry_meta() {

//
// Author.
//

$author = sprintf( '<span><i class="x-icon-pencil" data-x-icon-s="&#xf303;"></i> %s</span>',
  get_the_author()
);


//
// Categories.
//

if ( get_post_type() == 'x-portfolio' ) {
  if ( has_term( '', 'portfolio-category', NULL ) ) {
    $categories        = get_the_terms( get_the_ID(), 'portfolio-category' );
    $separator         = ', ';
    $categories_output = '';
    foreach ( $categories as $category ) {
      $categories_output .= '<a href="'
                          . get_term_link( $category->slug, 'portfolio-category' )
                          . '" title="'
                          . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                          . '"><i class="x-icon-bookmark" data-x-icon-s="&#xf02e;"></i> '
                          . $category->name
                          . '</a>'
                          . $separator;
    }

    $categories_list = sprintf( '<span>%s</span>',
      trim( $categories_output, $separator )
    );
  } else {
    $categories_list = '';
  }
} else {
  $categories        = get_the_category();
  $separator         = ', ';
  $categories_output = '';
  foreach ( $categories as $category ) {
    $categories_output .= '<a href="'
                        . get_category_link( $category->term_id )
                        . '" title="'
                        . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                        . '"><i class="x-icon-bookmark" data-x-icon-s="&#xf02e;"></i> '
                        . $category->name
                        . '</a>'
                        . $separator;
  }

  $categories_list = sprintf( '<span>%s</span>',
    trim( $categories_output, $separator )
  );
}


//
// Comments link.
//

if ( comments_open() ) {

  $title  = apply_filters( 'x_entry_meta_comments_title', get_the_title() );
  $link   = apply_filters( 'x_entry_meta_comments_link', get_comments_link() );
  $number = apply_filters( 'x_entry_meta_comments_number', get_comments_number() );

  $text = ( 0 == $number ) ? __( 'Leave a Comment', '__x__' ) : sprintf( _n( '%s Comment', '%s Comments', $number, '__x__' ), $number );

$comments = sprintf( ’ %3$s’,
esc_url( $link ),
esc_attr( sprintf( __( ‘Leave a comment on: “%s”’, ‘x’ ), $title ) ),
$text
);

} else {

  $comments = '';

}


//
// Output.
//

if ( x_does_not_need_entry_meta() ) {
  return;
} else {
  printf( '<p class="p-meta">%1$s%2$s%3$s</p>',
    $author,
    $categories_list,
    $comments
  );
}

}
endif;
// =============================================================================

this code? this custom function is also present in the child theme.

Hi Saswata,

Thank you for writing in, while that is outside the scope of support, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.

The template that outputs that original entry-title is the _content-post-header.php under \framework\views\integrity

Best Practices

Hope it helps,
Cheers!

1 Like

Thanks, @friech did the trick, I deleted that file and take a backup, but I was wondering is it create any issue, or SEO issue if I delete that one?

Hi Saswata,

It should be fine since you’re supposed to just have one main heading element for posts.

Hope this helps.

my heading tags are gone, is this due to this?

URL: https://learnmechanical.com/blog,

is there any ways to hide “_content-post-header.php” meta from appearing in only posts, not in others.

Hi Saswata,

That file supposed to be copied to your child theme and modified, not delete it. See the Best Practices I linked above.

You can use a conditional function named is_single() and then negate that with a PHP ! (NOT operator), so it would say if ( !is_single() )

In plain English it would say: (if NOT single do this, else escape that.

Regretfully, this particular customization request is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself.

Thank you for your understanding.

1 Like

Hello @friech thanks for guides, but when I copy that file to the child theme the problem automatically disappeared, now all good. if ( !is_single() ) seems like this function already present in the file.

Thanks Much!

Yup, its already there and you can also see the line that outputs the h1 entry-title there, thats the line you need to modify or remove.

Thanks,

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.