Tagged: add html
1. Is there any disadvantage to using the simple hooks plugin? E.g. If I use it wIth child theme ,will I have a problem when the main genesis theme updates?
2. Plugins aside, I'm trying to understand hooks by hand. My goal is to simply add the text (for example)
<p>click here</p> to the 'genesis_before_header' area of the genesis sample theme.
I've done a lot of reading and I simply can't find the answer.
In funcitons.php if I start with:
add_action('genesis_before_header' --where do I go from here?
Thank you in advance!
you should have no probs using the plugin and updates to gegenesis particularly as you're just putting in HTML as you say.
to use this kind of
add_action(‘genesis_before_header’ –where do I go from here?
You need to write php code and create a function etc... If you're not sure about this, the simple hook is the way to go!
=== WordPress producer @ thedma.com.au ===
On the "click here" I am assuming you are wanting to have it link to somewhere, correct? And do you want to add this so it shows up on every page of the site or on specific pages/posts?
I think the Simple Hooks plugin is an excellent stepping stone to understanding hooks and thier locations.
However i think at some stage you'll move on to custom functions once you understand how hooks works and the different locations they execute.
Using your child themes functions.php file is better than using Simple hooks because all your custom coding is contained in one file which is easier to manage.
Here's a very basic example of a custom function you can modify and use over and over again simply by changing the hook, div class for styling and unique name of the function.
This enables you to easily display HTML or text in any genesis_hook location the same way Simple Hooks works but from your child themes functions.php file.
If you simply add text or HTML to a Simple Hooks field, you don't get to target it with a class for styling unless you also add the class in the field as well.
So then Brad, would you be able to answer this hook question I posted over here a few minutes ago?
Thanks, Brad. This is EXACTLY what I was looking for!
You must be logged in to reply to this topic.
Subscribe to get early access to new themes, discounts and brief updates about what's new with StudioPress!