AMP for WP – Accelerated Mobile Pages - Version 0.5

Version Description

  • Added AMP Markup for Google Structured data. This will fix the issues in Webmaster tools.
Download this release

Release Info

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

Code changes from version 0.4 to 0.5

accelerated-moblie-pages.php CHANGED
@@ -3,9 +3,9 @@
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: http://theskin.io/amp/
5
  Description: Accelerated Mobile Pages for WordPress
6
- Version: 0.4
7
  Author: Mohammed Kaludi, Ahmed Kaludi
8
- Author URI: http://theskin.io/amp/
9
  License: GPL2
10
  */
11
 
@@ -44,6 +44,8 @@ add_action( 'wp_head', 'add_rel_info' );
44
  // Registering Custom AMP menu for this plugin
45
  if (! function_exists( 'register_amp_menu') ) {
46
  function register_amp_menu() {
 
 
47
  register_nav_menus(
48
  array(
49
  'amp-menu' => __( 'AMP Menu' ),
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: http://theskin.io/amp/
5
  Description: Accelerated Mobile Pages for WordPress
6
+ Version: 0.5
7
  Author: Mohammed Kaludi, Ahmed Kaludi
8
+ Author URI: http://AhmedKaludi.com/
9
  License: GPL2
10
  */
11
 
44
  // Registering Custom AMP menu for this plugin
45
  if (! function_exists( 'register_amp_menu') ) {
46
  function register_amp_menu() {
47
+ add_theme_support( 'custom-logo' );
48
+
49
  register_nav_menus(
50
  array(
51
  'amp-menu' => __( 'AMP Menu' ),
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -50,3 +50,6 @@ Please check if you have "Pretty Permalinks" enabled. If not then activate it. F
50
 
51
  = 0.4 =
52
  * Support of Custom menu added for AMP enabled sites
 
 
 
2
  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.5.2
6
+ Stable tag: 0.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
50
 
51
  = 0.4 =
52
  * Support of Custom menu added for AMP enabled sites
53
+
54
+ = 0.5 =
55
+ * Added AMP Markup for Google Structured data. This will fix the issues in Webmaster tools.
themes/default/footer.php CHANGED
@@ -7,5 +7,8 @@
7
  </div>
8
  </footer>
9
  <?php wp_footer(); ?>
 
 
 
10
  </body>
11
  </html>
7
  </div>
8
  </footer>
9
  <?php wp_footer(); ?>
10
+
11
+
12
+
13
  </body>
14
  </html>
themes/default/header.php CHANGED
@@ -48,6 +48,7 @@
48
  <body id="<?php if ( !is_single() && !is_page() ) { ?>home<?php } ?>">
49
 
50
  <header class="container">
 
51
  <div id="headerwrap">
52
  <div id="header">
53
  <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
48
  <body id="<?php if ( !is_single() && !is_page() ) { ?>home<?php } ?>">
49
 
50
  <header class="container">
51
+
52
  <div id="headerwrap">
53
  <div id="header">
54
  <h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
themes/default/single.php CHANGED
@@ -30,5 +30,47 @@
30
  <?php endwhile; ?>
31
  <?php endif;?>
32
  </div>
 
 
 
 
 
 
 
 
 
 
 
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  <?php get_footer(); ?>
30
  <?php endwhile; ?>
31
  <?php endif;?>
32
  </div>
33
+ <script type="application/ld+json">
34
+ {
35
+ "@context": "http://schema.org",
36
+ "@type": "NewsArticle",
37
+ "mainEntityOfPage": {
38
+ "@type": "WebPage",
39
+ "@id": "<?php the_permalink(); ?>"
40
+ },
41
+ "headline": "Article headline",
42
+ "image": {
43
+ "@type": "ImageObject",
44
 
45
+ <?php
46
+ $thumb_id = get_post_thumbnail_id();
47
+ $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'large', true);
48
+ $thumb_url = $thumb_url_array[0];
49
+ ?>
50
+ "url": "<?php echo $thumb_url ?>",
51
+ "height": 1024,
52
+ "width": 1024
53
+ },
54
+ "datePublished": "<?php echo the_time('c'); ?>",
55
+ "dateModified": "<?php echo the_time('c'); ?>",
56
+ "author": {
57
+ "@type": "Person",
58
+ "name": "<?php the_author_meta( 'nickname', $author_id ); ?>"
59
+ },
60
+ "publisher": {
61
+ "@type": "Organization",
62
+ "name": "<?php echo get_bloginfo( 'name' ); ?>",
63
+ "logo": {
64
+ "@type": "ImageObject",
65
+ "url": "<?php $site_logo = get_theme_mod('custom_logo'); echo wp_get_attachment_url($site_logo) ?>",
66
+ "width": 600,
67
+ "height": 60
68
+ }
69
+ },
70
+ "description": "A most wonderful article"
71
+ }
72
+
73
+
74
+
75
+ </script>
76
  <?php get_footer(); ?>