[Resolved] Display a link on the Home page under the Footer

Home Forums Support [Resolved] Display a link on the Home page under the Footer

Home Forums Support Display a link on the Home page under the Footer

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

    GeneratePress 2.1.3
    GP Premium 1.6.2
    #635554
    David
    Staff
    Customer Support

    Hi 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 πŸ™‚

    #635999
    Stephen

    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
    Steve

    #636008
    David
    Staff
    Customer Support

    You 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/

    #636133
    Stephen

    Thanks David.

    Looks great, I will try that and break everything πŸ˜‰

    I’ll post back when everything goes wrong πŸ™‚

    Steve

    #636343
    David
    Staff
    Customer Support

    Haha – sounds like my kind of learning πŸ™‚

    #670113
    Stephen

    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
    Steve

    #670130
    Stephen

    Hi again,

    I should mentioned I’m using Elementor and GP Pro.

    Thanks

    #670262
    David
    Staff
    Customer Support

    Hi 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.

    #670435
    Stephen

    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

    #670441
    Stephen

    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……………..

    #670473
    David
    Staff
    Customer Support

    Aah 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

    #670529
    Stephen

    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 πŸ˜‰

    #670530
    David
    Staff
    Customer Support

    Awesome πŸ™‚ Glad i could help

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