Skip to content

hooks for all pages ? #5

Open
tsanyqudsi opened this Issue Jul 8, 2012 · 3 comments

3 participants

@tsanyqudsi

I see the example is just for a complete post ( more or less single.php i guess ? ), what about frontpage templates ?

i think we should get more examples for this so people won't get confused on where they should put the hooks

@zamoose
Owner
zamoose commented Jul 8, 2012

I'm of two minds on this issue. Let's take Justin Tadlock's Hybrid Core, which does a LOT of very context-specific wizardry for hooks. It's useful and can be very specific in how it lets one target content. However, it's a bit complex.

One of the goals of THA is to offer this as a simple win for theme authors and plugin devs. If we get too far off into the weeds, it will raise implementation cost and make theme devs less likely to use it, IMHO. I'd far rather have simple hooks that plugins and child themes can handle by judicious use of is_* conditionals than get too complex.

What sorts of additional hooks would you see as being useful in other contexts? I'm open to all suggestions.

@tsanyqudsi
@chipbennett

Template location is semantic, and is not context-dependent. The site header is the site header, whether on the site front page, a single blog post, an archive index page, or a static page. Thus, site header-related THA hooks should reflect the semantic template location, and not the context.

Note that callbacks hooked into hooks can detect context, using WordPress conditional template tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.