- This topic has 13 replies, 2 voices, and was last updated 5 years, 7 months ago by David.
-
AuthorPosts
-
July 29, 2018 at 12:59 pm #635453Stephen
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 #635554DavidStaffCustomer 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-info
class will style it the same as your copyright πJuly 30, 2018 at 7:26 am #635999StephenHi 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 #636008DavidStaffCustomer 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 #636133StephenThanks 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 #636343DavidStaffCustomer SupportHaha – sounds like my kind of learning π
September 6, 2018 at 2:16 am #670113StephenHi 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 #670130StephenHi again,
I should mentioned I’m using Elementor and GP Pro.
Thanks
September 6, 2018 at 7:06 am #670262DavidStaffCustomer 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 #670435StephenHi 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 #670441StephenBTW, 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 #670473DavidStaffCustomer 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 #670529StephenThanks 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 #670530DavidStaffCustomer SupportAwesome π Glad i could help
-
AuthorPosts
- You must be logged in to reply to this topic.