AMP for WP – Accelerated Mobile Pages - Version 0.3

Version Description

  • Support of amp-img added in single posts
  • minor css bug fixed
Download this release

Release Info

Developer mohammed_kaludi
Plugin Icon 128x128 AMP for WP – Accelerated Mobile Pages
Version 0.3
Comparing to
See all releases

Code changes from version 0.2.5 to 0.3

accelerated-moblie-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: http://theskin.io/amp/
5
  Description: Accelerated Mobile Pages for WordPress
6
- Version: 0.2.5
7
  Author: Mohammed Kaludi, Ahmed Kaludi
8
  Author URI: http://theskin.io/amp/
9
  License: GPL2
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: http://theskin.io/amp/
5
  Description: Accelerated Mobile Pages for WordPress
6
+ Version: 0.3
7
  Author: Mohammed Kaludi, Ahmed Kaludi
8
  Author URI: http://theskin.io/amp/
9
  License: GPL2
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mohammed_kaludi, ahmedkaludi
3
  Tags: accelerated mobile pages, amp, mobile, amp project, google amp, amp wp
4
  Requires at least: 3.0
5
  Tested up to: 4.4.2
6
- Stable tag: 0.2.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -43,3 +43,7 @@ Please check if you have "Pretty Permalinks" enabled. If not then activate it. F
43
  = 0.2.5 =
44
  * Minor bugs fixed
45
  * ?mobile & ?nomobile is now ?amp & ?noamp
 
 
 
 
3
  Tags: accelerated mobile pages, amp, mobile, amp project, google amp, amp wp
4
  Requires at least: 3.0
5
  Tested up to: 4.4.2
6
+ Stable tag: 0.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
43
  = 0.2.5 =
44
  * Minor bugs fixed
45
  * ?mobile & ?nomobile is now ?amp & ?noamp
46
+
47
+ = 0.3 =
48
+ * Support of amp-img added in single posts
49
+ * minor css bug fixed
themes/default/functions.php CHANGED
@@ -195,13 +195,11 @@ function amp_custom_style() { ?>
195
  .single_img{
196
  text-align: center
197
  }
198
- img, iframe, object, video {
199
  max-width: 100%;
200
  height: auto;
201
  }
202
- .wp-caption {
203
- max-width: 100% !important;
204
- }
205
  @media screen and (min-width: 700px) {
206
  /*header, footer, main, footer {
207
  margin: 0 10%;
@@ -273,4 +271,17 @@ function amp_custom_style() { ?>
273
 
274
  add_action('amp_custom_style','amp_custom_style');
275
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  ?>
195
  .single_img{
196
  text-align: center
197
  }
198
+ amp-img, img, object, video {
199
  max-width: 100%;
200
  height: auto;
201
  }
202
+
 
 
203
  @media screen and (min-width: 700px) {
204
  /*header, footer, main, footer {
205
  margin: 0 10%;
271
 
272
  add_action('amp_custom_style','amp_custom_style');
273
 
274
+
275
+ // amp_image_tag will convert all the img tags and will change it to amp-img to make it AMP compatible.
276
+ function amp_image_tag($content) {
277
+
278
+ $replace = array (
279
+ '<img' => '<amp-img'
280
+ );
281
+ $content = strtr($content, $replace);
282
+ return $content;
283
+ }
284
+
285
+ add_filter('the_content','amp_image_tag')
286
+
287
  ?>