I am attempting to make a simple mobile app using PhoneGap and a Wordpress install. I realize that I can't have the main app page use Wordpress' index.php
since PhoneGap uses HTML/Javascipt, so what I've done is I have used the Wordpress API to display a list of posts in the app. My question is, is it possible to now use Wordpress templates and functionality for the rest of the app? IE, when someone clicks on one of the posts in the post listing, could I just load the URL of the post right in the app so that I can use single.php
to control the layout and functionality? If so, how would I go about doing that, would it just be a simple window.open
call, or would that load the post in the mobile web browser? Is there a better way to leverage Wordpress templating and functionality within PhoneGap?
window.open('http://linktosinglepost.com', '_system');
You can do this by creating mobile version theme of your wordpress website and putting all the corresponding html and css file inside www folder within phonegap. To load the url of posts you will have to declare phonegap in-app-browser plugin. But instead of taking that much pain I would rather go for a very nice readymade plugin available for wordpress WP-Appkit