![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
-
AuthorPosts
-
May 1, 2018 at 12:32 pm #949510
Hello,
I tried to ad to functions.php the following code :
add_filter('avf_logo_headline','avia_new_logo_span'); function avia_new_logo_span(){ $output = "h1"; return $output; }
but it adds the h1 on every page, so I tried this one :
add_filter('avf_logo_headline','avia_new_logo_span'); function avia_new_logo_span(){ if(is_home()){ $output = "h1"; } return $output; }
but it breaks the page, so I removed it.
Could you help me please ?Thank’s
May 3, 2018 at 5:39 am #950459Hey Coiffure-christele,
Please try this instead:
add_filter('avf_logo_headline','avia_new_logo_span'); function avia_new_logo_span(){ if(is_home()){ $output = "h1"; return $output; } }
Best regards,
RikardMay 10, 2018 at 12:20 pm #954496Hey, thank you for your answer,
I tried it but it also “breaks” the header (the logo appears twice and enormous, and there is a tag < class=’logo’> that appears also…)I’m sorry I’m not very good at coding stuff, so I can’t see where it comes from (maybe I did something wrong)
Thank’s in advance for your help
May 11, 2018 at 12:56 pm #955255Hi,
Thanks for the update. We adjusted the code a bit.
add_filter( 'avf_logo_headline', 'avf_logo_headline_mod_h1', 10, 1); function avf_logo_headline_mod_h1($headline) { $headline = 'h1'; return $headline; }
Best regards,
IsmaelMay 13, 2018 at 11:03 pm #956148Hello,
Thank you for your answer, this indeed adds the h1 on the logo, but on all my pages, instead of only on my homepage.
Could you give me the code I should put to h1 on the logo for the homepage, but not for all the other pages, please ?Thank’s
MarineMay 14, 2018 at 6:43 am #956260Hi Marine,
Please try this instead:
add_filter( 'avf_logo_headline', 'avf_logo_headline_mod_h1', 10, 1); function avf_logo_headline_mod_h1($headline) { if(is_home()){ $headline = 'h1'; return $headline; } }
Best regards,
RikardMay 21, 2018 at 6:56 pm #959911Hello,
Thank’s for your answer, I tried it but it again “breaks” the header as it did with the code I tried before (the logo appears. twice and enormous, and there is a tag < class=’logo’> that appears also…)
Do you have another idea ?
May 21, 2018 at 7:40 pm #959925it’s ok, a friend of mine helped me to solve my problem. I only had to put the
return $headline;
part outside the conditionThank’s for your help however
May 22, 2018 at 1:45 pm #960339Hi,
Great, glad you got it working. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardJune 27, 2018 at 11:01 pm #978597Hey, sorry for answering late, you can close the topic, thx
June 28, 2018 at 6:18 am #978756 -
AuthorPosts
- The topic ‘Put H1 tag on logo only on my homepage’ is closed to new replies.