How Can I Have A URL Changed Based on the Originating URL?

You can use the page_link filter with the same logic as the page_template filter in the other answer. If the endpoint query var is set, then any link to a page gets the app-view/ appended: function wpd_page_link( $link, $post_id ){ global $wp_query; if( isset( $wp_query->query_vars[‘app-view’] ) ){ return $link . ‘app-view/’; } return $link; } … Read more

Load a theme based on browser detection

You can use the built in function wp_is_mobile() Override a style with wp_enqueue_style add_action(‘wp_enqueue_scripts’, ‘my_mobile_styles’); function my_mobile_styles(){ if(wp_is_mobile()){ wp_register_style( ‘my-mobile-style’, ‘URL_to_stylesheet’, array(‘id-of-main-stylesheet’) ); wp_enqueue_style( ‘my-mobile-style’ ); } } Switch themes by filters You can use the stylesheet and template filters to alter which theme WordPress will render. # Parent Theme add_filter( ‘template’, ‘my_mobile_template’, 99999, 1); … Read more

Ajax template: how to handle head section

Ok, you want that mobile devices always load mobile templates. Desktop devices load template files based on resolution: if < 1080 mobile ones, > 1080 desktop ones. Your workflow should be: On init you check for mobile devices using wp_is_mobile. If true you add a template filter that returns str_replace(‘.php’, ‘-mobile.php’, $template); where $template is … Read more

WordPress on WP7

Official page: http://windowsphone.wordpress.org/ Was kinda hard to find, I basically guessed URL in few tries in analogy to android.wordpress.org 🙂

Change the default number of posts to show on mobile version

Firstly, you need to detect mobile devices, probably the easiest and a built in possibility is wp_is_mobile. It is simpler then other solutions that are available, but works reasonably well. It can be altered, if necessary, take a look at this question for a first insight into that. Secondly, if that concerns your main query, … Read more

WP Super Cache separate cache for mobile

There are several ways to handle mobile devices and doing it inside of single theme is builky and hard to maintain (as for me at least). More commonly this seems to be accomplished with separate templates or separate mobile-specific theme. I don’t know about WP Super Cache specifics because I hadn’t used it extensively. Plugin … Read more

WordPress REST endpoint with JSON for Mobile App integration

The REST API can be used for straight-up retrieval on any blog that has enabled it. Self-hosteds require an active choice to turn the JSON interface on in Jetpack but once it’s up it’s wide open. This is not necessarily appreciated by everyone, and that’s somewhat understandable. I picked a blog ID at random here … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)