Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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

    #950459

    Hey 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,
    Rikard

    #954496

    Hey, 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

    #955255

    Hi,

    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,
    Ismael

    #956148

    Hello,

    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
    Marine

    #956260

    Hi 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,
    Rikard

    #959911

    Hello,

    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 ?

    #959925

    it’s ok, a friend of mine helped me to solve my problem. I only had to put the return $headline; part outside the condition

    Thank’s for your help however

    #960339

    Hi,

    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,
    Rikard

    #978597

    Hey, sorry for answering late, you can close the topic, thx

    #978756

    Hi,

    Thanks for letting us know. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Put H1 tag on logo only on my homepage’ is closed to new replies.