Jump to content
Sign in to follow this  
grahamd79

Adding a hook to a certain page

Recommended Posts

grahamd79

Hi, Please let me know how to add a hook (html or php based) to a certain page...lets say...to a home page. I have added a hook successfully but that code snippet is displayed on all pages. How to limit the hook to be shown on just a home page? Thanks, Farhan

Share this post


Link to post
Share on other sites
Simon
WordPress has built in template conditionals: http://codex.wordpress.org/Conditional_Tags

Share this post


Link to post
Share on other sites
grahamd79
Thanks for your reply, Actually following is the code i wrote for my hook: ---------- if (is_front_page()) { add_action('pagelines_before_main', 'banner_me'); function banner_me() { ?>

Share this post


Link to post
Share on other sites
Simon
The conditional should be inside your function like this: http://paste.pagelines.com/3el

Share this post


Link to post
Share on other sites
grahamd79
great...it worked... :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×