[wp-hackers] wp_head()

Erick Hitter ehitter at gmail.com
Sat Nov 20 04:12:02 UTC 2010


*Init*, as Chris mentioned, is the first hook WordPress fires, but there are
many things that can't be accessed that early. In particular, the
conditional tags (is_home(), etc) aren't populated at that point. If you
need to hook early but also want access to the conditionals, the *wp* hook
is a better choice. Really, it's a matter of what you're trying to do and
how much information you need, so be sure to experiment with both to see
what information you have access to at what point.

Erick

On Fri, Nov 19, 2010 at 23:02, Chris Klosowski <chris at chriskdesigns.com>wrote:

> The first Hook that WordPress kicks into gear at is 'init'. If you are
> trying to catch something at it's earliest point 'init' is the place to be.
>
> Chris Klosowski
> chris at chriskdesigns.com
> @cklosowski
>
>
> On Fri, Nov 19, 2010 at 3:20 PM, Haluk Karamete <halukkaramete at gmail.com
> >wrote:
>
> > Excellent reply. I now know what's happening in those critical mile
> > stones. Thank you so much!
> >
> > On Fri, Nov 19, 2010 at 10:12 AM, Eric Mann <eric at eam.me> wrote:
> > > wp_head() defines a the hook used by plug-ins and themes to add
> > information
> > > to the header.  WordPress kicks in a long time before header.php is
> even
> > > loaded.
> > >
> > > When you visit a site, you're visiting the index.php file in the root,
> > which
> > > loads WordPress and processes the query.  Then WordPress loads the
> > index.php
> > > file for your theme and that file calls get_header() which loads
> > header.php.
> > >  You're already a long way down the pipe by now and have access to just
> > > about everything and every function defined by WordPress.
> > >
> > > WordPress decides what the current page is before picking the theme.
> >  This
> > > is when WordPress decides whether to call your theme's index.php
> (general
> > > requests), single.php (individual posts), page.php (pages), etc.
> > >
> > > On Fri, Nov 19, 2010 at 9:51 AM, Haluk Karamete <
> halukkaramete at gmail.com
> > >wrote:
> > >
> > >> Hi,
> > >>
> > >> Before the header.php runs wp_head(), information such as the current
> > >> page's title can be outputted... How is this possible? I thought, wp
> > >> kicks in with the wp_head()!
> > >>
> > >> Also, what file or function figures out whether the current page is a
> > >> single, category, tag, 404 etc.. Is that done before the ball is
> > >> passed to the theme? or is it done at .htaccss/web.config time?
> > >>
> > >> Thx.
> > >> _______________________________________________
> > >> wp-hackers mailing list
> > >> wp-hackers at lists.automattic.com
> > >> http://lists.automattic.com/mailman/listinfo/wp-hackers
> > >>
> > > _______________________________________________
> > > wp-hackers mailing list
> > > wp-hackers at lists.automattic.com
> > > http://lists.automattic.com/mailman/listinfo/wp-hackers
> > >
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list