Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1261088

    Hello,

    I would like add an href link text with country flag picture in the header of the home page.
    But only on home page header not the other pages.

    Do you know how can I do that ? I tryed it in header but I have the link in all pages and it is not good.

    Best regard
    cm

    #1261132

    Hey ChrisCoach,

    Well, you can hide it on all other pages with css.

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #1261145
    This reply has been marked as private.
    #1261150

    Hi ChrisCoach,

    So if you add the languages switcher with the code you can check if the page is a home page and then render the switcher, otherwise no.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1261157
    This reply has been marked as private.
    #1261164

    Hi,

    There is no way to do this out of the box. You could try adding code element on the home page only, and then use css to position it as you want.

    Best regards,
    Jordan Shannon

    #1261852

    Hello,
    Thank you for your response.
    Do you have an example to do that ?

    Best regards
    cm

    #1262192

    Hi,

    Refer to the following for an idea of how this can be done:

    Best regards,
    Jordan Shannon

    #1263045

    hi,
    It is a doc about the header and for all pages but I would like juste put a link or text in homepage header.
    do you have an example to do that with css ?

    best regards
    cm

    #1263195

    Hi,

    Please try this code instead:

    add_action( 'ava_main_header', 'enfold_customization_header_widget_area' );
    function enfold_customization_header_widget_area() {
      if(is_front_page()) {
        dynamic_sidebar( 'header' );
      }
    }

    It will only add the widget to your front page.

    Best regards,
    Rikard

    #1263254

    Hello,

    Thank you, very great ;).
    But I have an issue when I have the hamburger menu.
    The flags is under the header.
    I think the position is special when I have the hamburger menu ?

    Please see the url in private area, See Flags French English

    I used for flag this css :class
    .head {
    z-index: 0;
    position: absolute;
    top: 20px;
    left: 20%;
    }

    best regards
    cm

    #1263444

    Hi,

    Thanks for the update. Please try this in Quick CSS in order to adjust the position of the flags on mobile:

    @media only screen and (max-width: 767px) {
    #text-7 {
        margin-top: -65px;
        margin-left: 100px;
    }
    }

    Best regards,
    Rikard

    #1263520

    Hi Rikard,

    Thank you, it is very good now.

    If I want to add a link in footer but only on home page.
    Have I use to “ava_before_footer” hooks and the same test as header ?

    Best regards

    #1263658

    Hi,

    Thanks for the update. Where exactly are you looking to add the link in your footer? You should be able to hide it using CSS, for all pages which are not the home page.

    Best regards,
    Rikard

    #1263681

    Hi Rikar,
    It is the same issue as header.
    I think it is not possible just to hide attribute because the link exist and it is visible for the crawler and it is not good for SEO.
    for example I would like to put the legal information link in footer but only on home page because it is not interesting in SEO to display this link on all pages, it is not an UX issue.
    Are there an easy solution to put the link only on footer home page ?

    Best regards
    cm

    #1263754

    Hi cm,

    Thanks for the clarification. I’m still not sure exactly where you want to add the link in the footer though? Maybe it would be best if copied footer.php to your child theme, then added the link manually to the file there? Then you could do the same check with the function in my example above:

    if(is_front_page()) {
        Do things here which will only be added on the front page
      }

    Best regards,
    Rikard

Viewing 16 posts - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.