[theme-reviewers] Stupid Question of the Day

Ryan Frankel ryan.frankel at gmail.com
Wed Aug 24 18:57:30 UTC 2011


Thanks Chip.

I know it was a bit outside the scope but I thought I might be able to sneak it in there =).

Ryan


On Aug 24, 2011, at 2:51 PM, Chip Bennett wrote:

> For including functional (as opposed to template) files in a Theme, you should use something like the following in functions.php:
> 
> include_once( get_template_directory() . '/relative/path/to/file.php' );
> 
> Unless the file is intended to be over-ridden in a Child Theme, in which case you would use:
> 
> include_once( get_stylesheet_directory() . '/relative/path/to/file.php' );
> 
> I'm sure Plugins would be similar, but that's a question outside the scope of Theme-Reviewers. :)
> 
> Chip
> 
> On Wed, Aug 24, 2011 at 1:39 PM, Ryan Frankel <ryan.frankel at gmail.com> wrote:
> All,
> 
>  I have a dumb question that I am sure has been covered a million times but I am not sure what the best way to include PHP files into my plugin/theme.   What I currently have is something like below which can't possibly be the right way to do it.
> 
>                        include_once(WP_PLUGIN_DIR . '/swamped-event-calendar/php/functions_db.php');
>                        include_once(WP_PLUGIN_DIR . '/swamped-event-calendar/php/functions_calendar.php');
>                        include_once(WP_PLUGIN_DIR . '/swamped-event-calendar/php/functions_list.php');
> 
> Any tips on this would be greatly appreciated.
> 
> Ryan
> _______________________________________________
> 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



More information about the theme-reviewers mailing list