Tagged: x
-
AuthorPosts
-
November 24, 2016 at 2:41 pm #1269847
nourmoubayedParticipantDear Support,
My website is showing me multiple H1 tags on every page i have.
One of the H1 tags is the headline of the page which is okay. But the other H1 tag seems to be a “visually hidden” text on top of the page.
A third H1 tag seems to be “the Blog” which doesn’t appear on my blog pages because i have it hidden by CSS.This is not only for the main page but for all my blog post pages.
Please let me know how to remove them since this is hurting my seo rankings so bad.
Looking forward to hear from you. Thanks.
November 24, 2016 at 2:42 pm #1269848
nourmoubayedParticipantThis reply has been marked as private.November 24, 2016 at 3:38 pm #1269891
JoaoModeratorHi There,
Please refer to this thread:
https://community.theme.co/forums/topic/remove-h1-from-logo-have-searched-the-forums/
Hope tht helps
Joao
November 24, 2016 at 4:51 pm #1269930
nourmoubayedParticipantWorked amazingly 🙂
Thanks JoaoNovember 24, 2016 at 5:27 pm #1269944
nourmoubayedParticipantHi again,
Unfortunately I just realised that my logo disappeared from the Nav bar of my site after adding the _brand.php
Please let me know how to fix this.
Thanks.
November 24, 2016 at 7:14 pm #1270060
Rue NelModeratorHello There,
Thanks for updating in! Could you please insert in your next reply the contents of the _brand.php file? The correct one should be this:
<?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>Please let us know how it goes.
November 25, 2016 at 5:41 pm #1270964
nourmoubayedParticipantHi Rue,
Thanks for the code. This works great.
The only issue im having is that this code removed H1 tags from all the menu of my website.
This is good for blog posts because they already have H1 tags on the title of the blog post. But its not good for my Pages (like home page, contact page, terms and condition or any other page on my site) because it leaves the pages without any H1 tag whatsoever.
So, my question is: Is there a way to edit the code so that it will ONLY remove the H1 tags from the Menu of the Blog posts but leave the H1 Tag on the menu of Pages ?Thanks.
November 25, 2016 at 7:21 pm #1271104
FriechModeratorHi There,
We can add a condition to the above code to show the h1 if its a page.
Please update the 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 . '">'; ?> <!-- Condition if its a page or not --> <?php if(is_page()): ?> <?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?> <?php endif; ?> <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, Cheers!
November 29, 2016 at 5:44 am #1274507
nourmoubayedParticipantWorks Great ! Thanks 🙂
November 29, 2016 at 5:54 am #1274515
Paul RModeratorYou’re welcome! 🙂
January 30, 2017 at 2:00 pm #1351276
nourmoubayedParticipantHi again Paul,
Sorry for opening this again after a while.
The code you gave me last worked great: All pages that are blog posts do not have H1 in the logo anymore. And all the Pages of the site that are not blog posts have the site logo as H1.
All except the Blog Page.
https://smokingcessationformula.com/blog/
And https://smokingcessationformula.com/blog/page/2/
and https://smokingcessationformula.com/blog/page/3/Etc.
Is there a way we can edit the code above so that the Blog pages will also show the Logo as H1 Tag ?
Thanks
January 30, 2017 at 5:34 pm #1351481
FriechModeratorHi There,
On the given code above, update the conditional part.
<!-- Condition if its a page or not --> <?php if(is_page()): ?> <?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?> <?php endif; ?>To this:
<!-- Condition if its a page or blog page --> <?php if(is_page() OR is_front_page() OR is_home()) : ?> <?php echo '<h1 class="visually-hidden">' . $site_name . '</h1>'; ?> <?php endif; ?>Hope it helps, Cheers!
January 31, 2017 at 12:46 pm #1352613
nourmoubayedParticipantWorks Great !
Thanks FriechJanuary 31, 2017 at 6:40 pm #1352946
FriechModeratorYou’re more than welcome, glad we could help.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1269847 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
