[theme-reviewers] child theme functions.php question

emin ozlem eminozlem at gmail.com
Thu Feb 20 04:43:43 UTC 2014


Thank you for the example. I have not yet run into any problems, just
wondered the reason behind it. The core dev.s must've probably done a lot
of case testing and it's probably for the best.
Will let you know if I encounter any problems, thanks for the offer.
PS: I still wonder why every example specifically does:
add_action()
actual_action() {
instead of other way around.

2014-02-20 6:27 GMT+02:00 Philip M. Hofer (Frumph) <philip at frumph.net>:

>   one reason is that if the main theme has a an if (function_exists())
> for that function wrapped around it that the child theme can add that
> function and it would use that before the one in the main functions.php
>
> (IF) you are doing something that requires a function to be loaded before
> the functions.php of the theme;  it's probably doing-it-wrong (not
> necessarily wrong but can be done in a different manner that would be
> better for the overall usage of the function.
>
> I have extensive knowledge in this due to me messing up in how I did
> things in the past so that if you need some assist on it I can help you out
>
> - Phil
>
>
>  *From:* emin ozlem <eminozlem at gmail.com>
> *Sent:* Wednesday, February 19, 2014 7:46 PM
> *To:* Discussion list for WordPress theme reviewers.<theme-reviewers at lists.wordpress.org>
> *Subject:* [theme-reviewers] child theme functions.php question
>
>   Sorry for kind of OT and rookie question, but I've asked this in forums
> and did not get a reply, I'll keep it brief:
>
> Is there a specific reason why does child theme's functions.php load
> before the parent's rather than AFTER ?
> I know php doesn't care for the order, but isn't it common practice to
> define functions before they are used ? Besides since the purpose of the
> child is to extend upon parent wouldn't it make better sense ?
> I also see this in other code examples as
> add_action('',some_action)
> some_action
>
> Thank you in advance.
>
> ------------------------------
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140220/3536e560/attachment.html>


More information about the theme-reviewers mailing list