I’m looking to build a mobile version of a WordPress site and have most of it built in static files, but am trying to get access to the WordPress content from inside an external PHP file that the mobile site will run from. How can I get access to the loop or database without manually writing SQL queries?
Edit: Just to clarify, I’m using jqTouch for the Mobile version.
jqTouch uses a single php file to display several “pages” of content, which are then navigated via the Javascript hiding/showing the content.
What it really boils down to is: how do I get a WordPress page/post into an external PHP file?
If your goal is to simply have a second version of your site that uses a mobile-friendly theme, how about a plugin that will do this? For example: WordPress Mobile Pack
BTW, I’m not clear on what you are looking to accomplish, because first you say you want the mobile site to be mostly static, but then you say that the mobile site will use PHP, which isn’t static. Can you clarify how the mobile site should work?
Edit:
Now that I get what you’re doing, I have a thought as to how you could do it. Create a custom page template that includes the WP loop and the jqTouch code. Then create a WP page that uses this custom template (page content can be blank if all the content is provided by the template).