[wp-hackers] About using WordPress as service and themes

Jamie Currie jamie at wunderdojo.com
Thu Jul 18 20:31:21 UTC 2013


You might be able to use the setup_theme hook. If you look in 
wp-settings.php at line 262 it's called before WP loads in the theme's 
functions.php file. So if you add an action to that hook you could check 
for a query var and then load your XML only theme.


Jamie Currie
Founder / CEO
wunderdojo
wunderdojo.com
tel: 949-734-0758
23 Corporate Plaza Drive, Suite 100
Newport Beach, CA 92660
Master web & app developers




------ Original Message ------
From: "Filippo Pisano" <filippo.pisano at gmail.com>
To: wp-hackers at lists.automattic.com
Sent: 7/18/2013 12:08:17 AM
Subject: [wp-hackers] About using WordPress as service and themes
>Hi,
>
>I was trying to figure out a good way to prevent themes from being 
>included
>when calling WordPress with a particular query string.
>
>Here's an example of what I'm trying to do:
>
>/pages/my-page -> Classic page.php from my_theme_directory
>/xml/my-xml-page -> XML page served to external script through custom 
>plugin
>
>
>I want to exclude the XML generating routine from themes because I want 
>to
>speed up things avoiding to load theme's callbacks and functions.
>
>I've tried to set the WP_USE_THEMES constant to false but the 
>functions.php
>file belonging to the active theme is still included.
>I think that a possible solution could be to add an additional xml-only
>theme and change active theme on the fly accordingly to the query 
>string.
>
>IMO such a solution could have an unwanted overhead because all 
>formatting
>and templating libraries are also included (despite I need to render a
>simple XML only).
>
>
>Could you suggest me a better way?
>
>
>Thank you
>_______________________________________________
>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