Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] How to use a hook?

Home Forums Support How to use a hook?

  • This topic has 2 replies, 3 voices, and was last updated 6 years ago by Tom.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #47168
    Pete

    Could you do me a favour and show me how to add some simple text before the content using the generate_before_content hook? Thanks heaps.

    #47188
    Dee Broughton

    Pete – Assuming you have the addon installed and enabled, go to Appearance/GP Hooks, show the hook you want. If you just type some text in the space there, you’ll likely see it on the page. Most likely, you want to add a div class to style the text in some way.

    For example, on my site http://www.elt.international, the tagline is actually text in the Before Header hook. It reads

    <div class="tagundermenu">English Language Teaching Reviews, News, and Resources for an International Audience</div>

    I use the plugin Simple Custom CSS for adding styles so in that custom area I have the style

    .tagundermenu {background: transparent !important;color:#606060!important;font-size: 120%;
      text-align:center;margin-top: 19px!important;}
    #47194
    Tom
    Lead Developer
    Lead Developer

    Thanks, Dee! Super appreciated 🙂

    Here’s another example of using hooks as well: http://generatepress.com/forums/topic/bottom-div

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