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

Nate Divine nate.divine at gmail.com
Thu Jul 18 13:59:42 UTC 2013


Not sure if this is exactly what you're looking for - but you could
hook template_include and based on the particular query load a specific
template (or don't load a template at all).


On Thu, Jul 18, 2013 at 1:08 AM, Filippo Pisano <filippo.pisano at gmail.com>wrote:

> 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