Jump to content
Sign in to follow this  
danoah

How do I add a hook that only shows up on posts pages?

Recommended Posts

danoah

How do I add a hook that only shows up on posts pages? I want to add a hook that shows up at pagelines_after_secondnav, but only on posts.

Share this post


Link to post
Share on other sites
kastelic
You would do this using wordpress conditionals: http://codex.wordpress.org/Conditional_Tags Basically an "if" statement. For example, this would only display on the blog page: [code] function myHookFunction(){ if ( is_home() ){ echo "test"; } } [/code] here's an example using "or" operator: [code] function myHookFunction(){ if ( is_home() || is_archive() ){ echo "test"; } } [/code]

Share this post


Link to post
Share on other sites
danoah
And I was specifically looking for a hook for posts, not pages. Would that just be is_single()

Share this post


Link to post
Share on other sites
catrina
Which part of the posts area? The hook for the post loop start would be: pagelines_loop_post_start

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

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  

×