Community Forums › Forums › Archived Forums › Design Tips and Tricks › Remove H1 Tag from Logo Image
- This topic has 6 replies, 2 voices, and was last updated 9 years, 6 months ago by keyelementmedia.
-
AuthorPosts
-
November 7, 2014 at 8:34 am #130788keyelementmediaMember
I'd like to remove the H1 tag from the logo since the H1 holds weight with search engines, it really should be used for text, not an image. I realize this is where the site title would display, but when using an image, the H1 should be removed.
The theme is Epik, how would I remove the H1 from the title area?
Example of what the code show:
<div class="title-area"> <h1 class="site-title" itemprop="headline"> <a href="http://renegadecigars.com/">Renegade Cigars</a> </h1> <h2 class="site-description" itemprop="description">Cigar Lounge Richardson, Texas</h2> </div>
Thank you, Jared
November 7, 2014 at 9:05 am #130794Brad DaltonParticipantYou could remove it depending on how you added the image
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
November 7, 2014 at 9:10 am #130797keyelementmediaMemberIt was added via Appearance > Customize
I added the code you listed to the functions.php file and didn't see a change in the markup?
Thank you, Jared
November 7, 2014 at 9:30 am #130798Brad DaltonParticipantYes because it only works if you added the image using CSS not PHP which echo's the markup as you can see in Genesis.
add_action( 'genesis_site_title', 'genesis_seo_site_title' ); /** * Echo the site title into the header. * * Depending on the SEO option set by the user, this will either be wrapped in an
h1
orp
element. * * Applies thegenesis_seo_title
filter before echoing. * * @since 1.1.0 * * @uses genesis_get_seo_option() Get SEO setting value. * @uses genesis_html5() Check or HTML5 support. */ function genesis_seo_site_title() { //* Set what goes inside the wrapping tags $inside = sprintf( '%s', trailingslashit( home_url() ), get_bloginfo( 'name' ) ); //* Determine which wrapping tags to use $wrap = is_home() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p'; //* A little fallback, in case an SEO plugin is active $wrap = is_home() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap; //* And finally, $wrap in h1 if HTML5 & semantic headings enabled $wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap; //* Build the title $title = genesis_html5() ? sprintf( "<{$wrap} %s>", genesis_attr( 'site-title' ) ) : sprintf( '<%s id="title">%s</%s>', $wrap, $inside, $wrap ); $title .= genesis_html5() ? "{$inside}</{$wrap}>" : ''; //* Echo (filtered) echo apply_filters( 'genesis_seo_title', $title, $inside, $wrap ); }Site Title : Depending on the SEO option set by the user, this will either be wrapped in an h1 or p element
November 7, 2014 at 9:52 am #130801keyelementmediaMemberSo, I went to add the image via CSS, however the information I found uses the Genesis Theme Options to select Image for the Header, which I've seen in other themes. However I do not see it here. Not sure if that is unique to the Epik theme or if that is something Genesis took out?
So how would it best be added?
Thank you, Jared
November 7, 2014 at 1:23 pm #130844Brad DaltonParticipantWhat have you tried so far?
There's at least 3 options i would try.
1. Use CSS to add the logo. You can look at how its done in the Genesis Sample child theme.
2. Use the filter to modify the wrapping of the site title in h1 tags.
3. Use the Genesis SEO settings: Depending on the SEO option set by the user, this will either be wrapped in an h1 or p element.
Also, since this is an Epik child theme, have you requested support on their forums?
November 7, 2014 at 3:38 pm #130858keyelementmediaMemberOption 3 is definitely the easiest...to me anyway.
However, previously I did try following the CSS instructions for the Sample Theme, however Epik doesn't have an option under Theme Settings to use an Image as the title area. At least that seemed to be the piece missing.
Thanks for the help.
Thank you, Jared
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.