Skip to content

Instantly share code, notes, and snippets.

@ryansommers
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryansommers/165ac43e9e85e27ecefd to your computer and use it in GitHub Desktop.
Save ryansommers/165ac43e9e85e27ecefd to your computer and use it in GitHub Desktop.
Patch for WordPress P2 Theme to Allow User Scaling on Mobile Version
Index: functions.php
===================================================================
--- functions.php (revision 18153)
+++ functions.php (working copy)
@@ -527,20 +527,6 @@
add_filter( 'template_redirect', 'p2_new_post_noajax' );
/**
- * iPhone viewport meta tag.
- *
- * Hooks into the wp_head action late.
- *
- * @uses p2_is_iphone()
- * @since P2 1.4
- */
-function p2_viewport_meta_tag() {
- if ( p2_is_iphone() )
- echo '<meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no"/>';
-}
-add_action( 'wp_head', 'p2_viewport_meta_tag', 1000 );
-
-/**
* iPhone Stylesheet.
*
* Hooks into the wp_enqueue_scripts action late.
Index: header.php
===================================================================
--- header.php (revision 18153)
+++ header.php (working copy)
@@ -9,6 +9,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php wp_head(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment