Get page content with theme structure in Wordpress
I'm working on an ajax-based Wordpress site and I want to know if there is a way to get a particular page content with theme structure 开发者_如何学编程applied in.
One workaround is to use
wget
or
file_get_contents(page_url)
but it'd be cleaner to use Wordpress built-in functions.
Thanks.
I'd go with file_get_contents
. I'm not aware of a built-in WP function to do this, but even if there was one I would expect it to be based on file_get_contents
FYI, don't use any of these methods I mentioned above because it's way too slow. I ended up utilizing the Loop and include_once();
to get the content with the theme structure.
精彩评论