Archived topic
How to use a hook?
2 replies · Started by Anonymous on November 18, 2014
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.
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;}
Thanks, Dee! Super appreciated :)
Here's another example of using hooks as well: http://generatepress.com/forums/topic/bottom-div