Title page on all post h1

Hi! Sorry for my english.
My website have the same H1 for all pages and posts. This h1 is the site title.
I search in the code and found this : < h1 class = “visually-hidden”>Mysitename< /h1>

Thanks

Hi There,

First, you have to install and activate the child theme(https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57).

After create this directory: /framework/legacy/cranium/headers/views/global/

Then create a _brand.php file with the following code:

<?php

// =============================================================================
// VIEWS/GLOBAL/_BRAND.PHP
// -----------------------------------------------------------------------------
// Outputs the brand.
// =============================================================================

$site_name        = get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description' );
$logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
$site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '">';

?>

<a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
  <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
</a>

Hope it helps :slight_smile:

Hi Thai,

i have the same problem. I have noticed that on each site two H1-Headers are shown. The first H1-Header is always the site title and the second my own defined H1-Header.

To fix the problem I installed and activated the child theme and put the _brand.php in mentioned above directory - but nothing happend.

Do you have another idea?

Best Regards
Tobias

Hey Tobias,

Thanks for writing around! In WordPress page editor. under Page Settings select Disable Page Title to remove the title (see screenshot) and then you can display your own page title.

Cheers!

Hi Nabeel,

thanks for writing in.

I set the checkmark “Disable Page Title”. Unfortunately the site title is still defiened as H1-Header and equal to my site title - i don’t want this

Any other ideas? :thinking:

Regards
Tobias

Hi Tobias,

The solution given by Thai should remove the visually-hidden <h1> which is the title of your site. Please redo Thai’s instruction and follow it thoroughly.

Then clear your browser’s cache and all your caching plugins that your site might have.

Cheers!

Hi friech,

thanks for your response. The problem was, that in my folder

X/framework/legacy/cranium/headers/views/global/

the folling _brand.php was found:

<?php

// =============================================================================
// VIEWS/GLOBAL/_BRAND.PHP
// -----------------------------------------------------------------------------
// Outputs the brand.
// =============================================================================

$site_name        = get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description' );
$logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
$site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '">';

?>

<?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?>

<a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
  <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
</a>

So the new _brand.php from Thai in the child-theme has not been overwritten. So I deleted the above _brand.php in the x-theme. Is that ok? Does the x-theme need the _brand.php?

Regards
Tobias

Hi Tobias,

You should not delete any file in the parent theme as it might cause some issues.

Overriding a template file through the child theme should not require deleting anything from the parent theme.

Kindly double check the file added on the child theme and make sure that it was placed in the right directory.