- This topic has 13 replies, 2 voices, and was last updated 7 years, 8 months ago by
David.
-
AuthorPosts
-
July 29, 2018 at 12:59 pm #635453
Stephen
Hi,
I would like to display a text link only on the site Home page under the footer area.
Is this best achieved with hooks or is there another way to do it?
I’m using a child theme.
Thanks
SteveJuly 29, 2018 at 4:21 pm #635554David
StaffCustomer SupportHi Steve,
You could add the link to the Copyright field in the Footer, it accepts HTML.
Or you could add it in the After Footer Content Hook e.g.<div class="site-info"><a href="url">My link</a></div>The
site-infoclass will style it the same as your copyright ๐July 30, 2018 at 7:26 am #635999Stephen
Hi David,
I want the link to appear below the footer so I need to add a hook. I read the hook should go in the functions file in the child theme. How do I inform the theme to only apply the hook to the Home page?
Thanks
SteveJuly 30, 2018 at 7:34 am #636008David
StaffCustomer SupportYou can use the GP Hooks instead of writing the function and wrap your content in a conditional tag, just make sure Execute PHP is checked:
https://docs.generatepress.com/article/using-hooks-conditional-tags/
July 30, 2018 at 8:17 am #636133Stephen
Thanks David.
Looks great, I will try that and break everything ๐
I’ll post back when everything goes wrong ๐
Steve
July 30, 2018 at 11:31 am #636343David
StaffCustomer SupportHaha – sounds like my kind of learning ๐
September 6, 2018 at 2:16 am #670113Stephen
Hi David,
I used an Element to insert a hook under the site footer for my text, but unfortunately the new text/link and hook area do not follow the themes settings i.e. font, link or page bg colour. The hook bg area is grey and the font to large.
How do I resolve this issue please and where do I insert the code, in the CSS file or in the Element Edit window?
Thanks
SteveSeptember 6, 2018 at 3:09 am #670130Stephen
Hi again,
I should mentioned I’m using Elementor and GP Pro.
Thanks
September 6, 2018 at 7:06 am #670262David
StaffCustomer SupportHi there,
are you able to add it to the site so i can have a look and provide the solution?
You can just add the link into the copyright bar….. just separate the copyright and link with a<br>tag to create a new line. Let me know.September 6, 2018 at 9:14 am #670435Stephen
Hi David,
I did have the text/link in the copyright area but unfortunately that then shows on all pages. I just want the link on the Home page.
I’ve added the text/link, thank you.
Steve
September 6, 2018 at 9:18 am #670441Stephen
BTW, I’m using a child theme.
On a side note, I’ve been watching videos, reading and playing with Elements all day. Elements is quite simply amazing……………..
September 6, 2018 at 10:17 am #670473David
StaffCustomer SupportAah understood, yes Elements is something very special ๐
So add this HTML to your hook:
<div class="site-info"> <div class="inside-site-info grid-container grid-parent"> Add your text / HTML here </div> </div>This will use the same styling as the Site-info
September 6, 2018 at 11:00 am #670529Stephen
Thanks David.
That worked for the text ๐ The text was aligned centre and the same size font as the footer copyright. However, when I made the text into a link the text disappeared. A quick visit into the customiser – colour – footer and all is well.
Thank you very much ๐
We didn’t break anything ๐
September 6, 2018 at 11:02 am #670530David
StaffCustomer SupportAwesome ๐ Glad i could help
-
AuthorPosts
- You must be logged in to reply to this topic.