-
AuthorPosts
-
November 17, 2020 at 7:39 pm #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
cmNovember 17, 2020 at 10:15 pm #1261132Hey 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,
VictoriaNovember 17, 2020 at 10:55 pm #1261145This reply has been marked as private.November 17, 2020 at 11:09 pm #1261150Hi 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,
VictoriaNovember 17, 2020 at 11:57 pm #1261157This reply has been marked as private.November 18, 2020 at 1:23 am #1261164Hi,
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 ShannonNovember 20, 2020 at 7:46 pm #1261852Hello,
Thank you for your response.
Do you have an example to do that ?Best regards
cmNovember 23, 2020 at 1:32 am #1262192November 25, 2020 at 6:17 pm #1263045hi,
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
cmNovember 26, 2020 at 7:15 am #1263195Hi,
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,
RikardNovember 26, 2020 at 1:33 pm #1263254Hello,
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
cmNovember 27, 2020 at 5:01 am #1263444Hi,
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,
RikardNovember 27, 2020 at 2:01 pm #1263520Hi 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
November 28, 2020 at 6:46 am #1263658Hi,
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,
RikardNovember 28, 2020 at 3:08 pm #1263681Hi 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
cmNovember 29, 2020 at 7:25 am #1263754Hi 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 -
AuthorPosts
- You must be logged in to reply to this topic.