Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Im in the process of building a very custom theme and Im beginning to work on the post templates, but I dont know which hooks are essential for them.

So like, I've seen (but cant remember where)some themes or code snippets for commenting, and in the snippet the code was something like:

if comments allowed 
         comment hook

And I know there are a probably a few more for other features that Im not aware of like trackbacks right? Does anyone have a good tutorial listing out all the essentials?

share|improve this question
1  
How would you define essential? By "post templates", are you referring just to the single post page view? Also: what do you mean when you say hook? Because your example code above doesn't include a hook. – Chip Bennett Mar 12 at 14:04

1 Answer

As a general rule of thumb it's a good practice not to "create" hooks within your theme. Last year Tom McFarlin wrote against placing custom hooks in your theme; however, if you are building an addon plugin (such as WooThemes and their Features plugin) it would make a grey area exception to include those hooks. (only for display purposes.

If you are looking for general hooks in WordPress to leverage I would recommend checking out Underscores or at very minimum the 2012/2013 core themes since they would use all the core hooks.

share|improve this answer
ok maybe hooks is the wrong term, I guess I should have said functions. like get_comments(). Aren't there a whole bunch of stuff that should be on teh posts pages. Functions for comments (and a conditional to see if commenting is enabled) and trackbacks and such? – rugbert Mar 14 at 14:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.