[wp-hackers] About using WordPress as service and themes
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.
Founder / CEO
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
>I was trying to figure out a good way to prevent themes from being
>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
>I want to exclude the XML generating routine from themes because I want
>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
>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
>IMO such a solution could have an unwanted overhead because all
>and templating libraries are also included (despite I need to render a
>simple XML only).
>Could you suggest me a better way?
>wp-hackers mailing list
>wp-hackers at lists.automattic.com
More information about the wp-hackers