I am using the Eleven40 theme. I would like to add some html code that is displayed before the content (above the breadcrumb). How can this be done?
There are many ways, but one way would be to…
1) find the hook that executes near the spot you want to add the markup
2) write a plugin that contains a function that echos the markup you want to add
3) in the plugin, use an add_action instruction to add the function you write in #2 to the hook you use in #1
The plugin route makes it easy if you want to change what you add or change themes.
Another route would be to use the Genesis Simple Hooks plugin. The logic using Simple Hooks is the same – activate the Simple Hooks plugin, find the hook and in the metabox for that hook, use PHP commands to echo the markup you want to add. Be sure to check the box to execute PHP on the hook you select.
About an hour ago I read about the hooks that are available and I was able to do this with the genesis_before_loop hook. I am now able to display an ad from Simple Ads Manager just above the first message.
You must be logged in to reply to this topic.
Are you a blogger, web designer, developer, or website owner looking to generate more income?
Promote products for the largest and fastest growing online website platform as part of our affiliate program.