Version Description
- Improved Navigation Menu, Search Console errors fixed, Social Sharing option, Pages support, Force redirection for mobile users removed and many other bug fixes
Download this release
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 0.6 |
Comparing to | |
See all releases |
Code changes from version 0.5 to 0.6
- README.md +5 -0
- accelerated-moblie-pages.php +3 -5
- admin/ampwp-check.php +56 -56
- readme.txt +56 -4
- themes/default/footer.php +1 -1
- themes/default/functions.php +91 -11
- themes/default/header.php +16 -2
- themes/default/page.php +43 -0
- themes/default/single.php +20 -0
README.md
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Accelerated Mobile Pages
|
2 |
+
Automatically add Accelerated Mobile Pages (AMP Project) functionality on your WordPress. http://theskin.io/amp/
|
3 |
+
https://wordpress.org/plugins/accelerated-mobile-pages/
|
4 |
+
|
5 |
+
|
accelerated-moblie-pages.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
-
Plugin URI:
|
5 |
Description: Accelerated Mobile Pages for WordPress
|
6 |
-
Version: 0.
|
7 |
-
Author:
|
8 |
Author URI: http://AhmedKaludi.com/
|
9 |
License: GPL2
|
10 |
*/
|
@@ -54,6 +54,4 @@ if (! function_exists( 'register_amp_menu') ) {
|
|
54 |
}
|
55 |
add_action( 'init', 'register_amp_menu' );
|
56 |
}
|
57 |
-
|
58 |
-
|
59 |
?>
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
+
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: Accelerated Mobile Pages for WordPress
|
6 |
+
Version: 0.6
|
7 |
+
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: http://AhmedKaludi.com/
|
9 |
License: GPL2
|
10 |
*/
|
54 |
}
|
55 |
add_action( 'init', 'register_amp_menu' );
|
56 |
}
|
|
|
|
|
57 |
?>
|
admin/ampwp-check.php
CHANGED
@@ -30,16 +30,16 @@ if ( ! class_exists( 'AmpWP_check' ) ) {
|
|
30 |
$this->theme = 'default';
|
31 |
} else if ( isset( $_GET['noamp'] ) ) {
|
32 |
$this->activated = FALSE;
|
33 |
-
} else
|
34 |
-
if ( $this->is_bot( $_SERVER['HTTP_USER_AGENT'] ) ) {
|
35 |
-
$this->browser = 'mobile';
|
36 |
-
$this->activated = TRUE;
|
37 |
-
$this->theme = 'default';
|
38 |
-
} else {
|
39 |
-
$this->browser = 'mobile';
|
40 |
-
$this->activated = TRUE;
|
41 |
-
$this->theme = 'default';
|
42 |
-
}
|
43 |
}
|
44 |
|
45 |
if ( $_SESSION['AMPWP_MOBILE_BROWSER'] != $this->browser && isset( $_SESSION['AMPWP_MOBILE_BROWSER'] ) ) {
|
@@ -58,13 +58,13 @@ if ( ! class_exists( 'AmpWP_check' ) ) {
|
|
58 |
* @package AmpWP
|
59 |
* @since 1.0
|
60 |
*/
|
61 |
-
private function is_bot( $user_agent ) {
|
62 |
-
if ( preg_match( '/(askjeeves|baiduspider|baiduspider-mobile|baiduspider-mobile-gate|fastcrawler|fastmobilecrawl|gigabot|googlebot|googlebot-mobile|ia_archiver|infoseek|larbin|lmspider|lycos|lycos_spider|mediapartners-google|msnbot|msnbot-mobile|muscatferret|naverbot|nutch|omniexplorer_bot|pompos|roboobot|scooter|slurp|teoma|turnitinbot|yahoo|yahooseeker|youdaobot|yodaoBot-mobile|zyborg)/i', $user_agent ) ) {
|
63 |
-
return TRUE;
|
64 |
-
}
|
65 |
-
|
66 |
-
return FALSE;
|
67 |
-
}
|
68 |
|
69 |
/**
|
70 |
* Checks if the browser / device is a mobile device
|
@@ -72,57 +72,57 @@ if ( ! class_exists( 'AmpWP_check' ) ) {
|
|
72 |
* @package AmpWP
|
73 |
* @since 1.0
|
74 |
*/
|
75 |
-
private function is_mobile( $user_agent, $http_accept = NULL, $http_profile = NULL, $wap_profile = NULL ) {
|
76 |
-
if ( preg_match( '/(alcatel|android|avantgo|bada|benq|blackberry|configuration\/cldc|docomo|ericsson|hp |hp-|hpwos|htc |htc_|htc-|iemobile|iphone|ipod|kddi|kindle|maemo|meego|midp|mmp|motorola|mobi|mobile|netfront|nokia|opera mini|opera mobi|openweb|palm|palmos|pocket|portalmmm|ppc;|sagem|sharp|series60|series70|series80|series90|smartphone|sonyericsson|spv|symbian|teleca q|telus|treo|up.browser|up.link|vodafone|webos|windows ce|windows phone os 7|xda|zte)/i', $user_agent ) ) {
|
77 |
-
return TRUE;
|
78 |
-
} else if ( in_array( strtolower( substr( $user_agent, 0, 3 ) ), array( 'lg ' => 'lg ', 'lg-' => 'lg-', 'lg_' => 'lg_', 'lge' => 'lge' ) ) ) {
|
79 |
-
return TRUE;
|
80 |
-
} else if ( in_array( strtolower( substr( $user_agent , 0, 4 ) ), array( 'acs-' => 'acs-', 'amoi' => 'amoi', 'doco' => 'doco', 'eric' => 'eric', 'huaw' => 'huaw', 'lct_' => 'lct_', 'leno' => 'leno', 'mobi' => 'mobi', 'mot-' => 'mot-', 'moto' => 'moto', 'nec-' => 'nec-', 'phil' => 'phil', 'sams' => 'sams', 'sch-' => 'sch-', 'shar' => 'shar', 'sie-' => 'sie-', 'wap_' => 'wap_', 'zte-' => 'zte-' ) ) ) {
|
81 |
-
return TRUE;
|
82 |
-
} else if ( ( ( stripos( strtolower( $http_accept ), 'text/vnd.wap.wml' ) > 0 ) || ( stripos( strtolower( $http_accept ), 'application/vnd.wap.xhtml+xml' ) > 0 ) ) || ( ( isset( $wap_profile ) || isset( $http_profile ) ) ) ) {
|
83 |
-
return TRUE;
|
84 |
-
}
|
85 |
-
|
86 |
-
return FALSE;
|
87 |
-
}
|
88 |
-
|
89 |
/**
|
90 |
* Checks if the browser / device is a tablet (constantly being updated)
|
91 |
*
|
92 |
* @package AmpWP
|
93 |
* @since 1.0
|
94 |
*/
|
95 |
-
private function is_tablet( $user_agent ) {
|
96 |
-
if ( preg_match( '/(a100|a500|a501|a510|a700|dell streak|et-701|ipad|gt-n7000|gt-p1000|gt-p6200|gt-p6800|gt-p7100|gt-p7310|gt-p7510|lg-v905h|lg-v905r|kindle|rim tablet|sch-i800|silk|sl101|tablet|tf101|tf201|xoom)/i', $user_agent ) ) {
|
97 |
-
return TRUE;
|
98 |
-
}
|
99 |
-
|
100 |
-
return FALSE;
|
101 |
-
}
|
102 |
-
|
103 |
/**
|
104 |
* Checks if the browser / device is a touch screen / smart phone (constantly being updated)
|
105 |
*
|
106 |
* @package AmpWP
|
107 |
* @since 1.0
|
108 |
*/
|
109 |
-
private function is_touch( $user_agent ) {
|
110 |
-
if ( preg_match( '/(ipod|iphone)/i', $user_agent ) ) {
|
111 |
-
return TRUE;
|
112 |
-
} else if ( preg_match( '/android (\d+\.\d+(\.\d+)*)/i', $user_agent, $version ) ) {
|
113 |
-
if ( $version[1] >= '2.1' ) {
|
114 |
-
return TRUE;
|
115 |
-
}
|
116 |
-
} else if ( preg_match( '/(bada|blackberry9670|blackberry 9670|blackberry9800|blackberry 9800|blackberry9810|blackberry 9810|dolfin|maemo|meego|s8000|windows phone os 7)/i', $user_agent ) ) {
|
117 |
-
return TRUE;
|
118 |
-
} else if ( preg_match( '/webos\/(\d+\.\d+(\.\d+)*)/i', $user_agent, $version ) ) {
|
119 |
-
if ( $version[1] >= '1.4' ) {
|
120 |
-
return TRUE;
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
return FALSE;
|
125 |
-
}
|
126 |
}
|
127 |
}
|
128 |
?>
|
30 |
$this->theme = 'default';
|
31 |
} else if ( isset( $_GET['noamp'] ) ) {
|
32 |
$this->activated = FALSE;
|
33 |
+
} else {
|
34 |
+
// if ( $this->is_bot( $_SERVER['HTTP_USER_AGENT'] ) ) {
|
35 |
+
// $this->browser = 'mobile';
|
36 |
+
// $this->activated = TRUE;
|
37 |
+
// $this->theme = 'default';
|
38 |
+
// } else {
|
39 |
+
// $this->browser = 'mobile';
|
40 |
+
// $this->activated = TRUE;
|
41 |
+
// $this->theme = 'default';
|
42 |
+
// }
|
43 |
}
|
44 |
|
45 |
if ( $_SESSION['AMPWP_MOBILE_BROWSER'] != $this->browser && isset( $_SESSION['AMPWP_MOBILE_BROWSER'] ) ) {
|
58 |
* @package AmpWP
|
59 |
* @since 1.0
|
60 |
*/
|
61 |
+
// private function is_bot( $user_agent ) {
|
62 |
+
// if ( preg_match( '/(askjeeves|baiduspider|baiduspider-mobile|baiduspider-mobile-gate|fastcrawler|fastmobilecrawl|gigabot|googlebot|googlebot-mobile|ia_archiver|infoseek|larbin|lmspider|lycos|lycos_spider|mediapartners-google|msnbot|msnbot-mobile|muscatferret|naverbot|nutch|omniexplorer_bot|pompos|roboobot|scooter|slurp|teoma|turnitinbot|yahoo|yahooseeker|youdaobot|yodaoBot-mobile|zyborg)/i', $user_agent ) ) {
|
63 |
+
// return TRUE;
|
64 |
+
// }
|
65 |
+
//
|
66 |
+
// return FALSE;
|
67 |
+
// }
|
68 |
|
69 |
/**
|
70 |
* Checks if the browser / device is a mobile device
|
72 |
* @package AmpWP
|
73 |
* @since 1.0
|
74 |
*/
|
75 |
+
// private function is_mobile( $user_agent, $http_accept = NULL, $http_profile = NULL, $wap_profile = NULL ) {
|
76 |
+
// if ( preg_match( '/(alcatel|android|avantgo|bada|benq|blackberry|configuration\/cldc|docomo|ericsson|hp |hp-|hpwos|htc |htc_|htc-|iemobile|iphone|ipod|kddi|kindle|maemo|meego|midp|mmp|motorola|mobi|mobile|netfront|nokia|opera mini|opera mobi|openweb|palm|palmos|pocket|portalmmm|ppc;|sagem|sharp|series60|series70|series80|series90|smartphone|sonyericsson|spv|symbian|teleca q|telus|treo|up.browser|up.link|vodafone|webos|windows ce|windows phone os 7|xda|zte)/i', $user_agent ) ) {
|
77 |
+
// return TRUE;
|
78 |
+
// } else if ( in_array( strtolower( substr( $user_agent, 0, 3 ) ), array( 'lg ' => 'lg ', 'lg-' => 'lg-', 'lg_' => 'lg_', 'lge' => 'lge' ) ) ) {
|
79 |
+
// return TRUE;
|
80 |
+
// } else if ( in_array( strtolower( substr( $user_agent , 0, 4 ) ), array( 'acs-' => 'acs-', 'amoi' => 'amoi', 'doco' => 'doco', 'eric' => 'eric', 'huaw' => 'huaw', 'lct_' => 'lct_', 'leno' => 'leno', 'mobi' => 'mobi', 'mot-' => 'mot-', 'moto' => 'moto', 'nec-' => 'nec-', 'phil' => 'phil', 'sams' => 'sams', 'sch-' => 'sch-', 'shar' => 'shar', 'sie-' => 'sie-', 'wap_' => 'wap_', 'zte-' => 'zte-' ) ) ) {
|
81 |
+
// return TRUE;
|
82 |
+
// } else if ( ( ( stripos( strtolower( $http_accept ), 'text/vnd.wap.wml' ) > 0 ) || ( stripos( strtolower( $http_accept ), 'application/vnd.wap.xhtml+xml' ) > 0 ) ) || ( ( isset( $wap_profile ) || isset( $http_profile ) ) ) ) {
|
83 |
+
// return TRUE;
|
84 |
+
// }
|
85 |
+
//
|
86 |
+
// return FALSE;
|
87 |
+
// }
|
88 |
+
//
|
89 |
/**
|
90 |
* Checks if the browser / device is a tablet (constantly being updated)
|
91 |
*
|
92 |
* @package AmpWP
|
93 |
* @since 1.0
|
94 |
*/
|
95 |
+
// private function is_tablet( $user_agent ) {
|
96 |
+
// if ( preg_match( '/(a100|a500|a501|a510|a700|dell streak|et-701|ipad|gt-n7000|gt-p1000|gt-p6200|gt-p6800|gt-p7100|gt-p7310|gt-p7510|lg-v905h|lg-v905r|kindle|rim tablet|sch-i800|silk|sl101|tablet|tf101|tf201|xoom)/i', $user_agent ) ) {
|
97 |
+
// return TRUE;
|
98 |
+
// }
|
99 |
+
//
|
100 |
+
// return FALSE;
|
101 |
+
// }
|
102 |
+
//
|
103 |
/**
|
104 |
* Checks if the browser / device is a touch screen / smart phone (constantly being updated)
|
105 |
*
|
106 |
* @package AmpWP
|
107 |
* @since 1.0
|
108 |
*/
|
109 |
+
// private function is_touch( $user_agent ) {
|
110 |
+
// if ( preg_match( '/(ipod|iphone)/i', $user_agent ) ) {
|
111 |
+
// return TRUE;
|
112 |
+
// } else if ( preg_match( '/android (\d+\.\d+(\.\d+)*)/i', $user_agent, $version ) ) {
|
113 |
+
// if ( $version[1] >= '2.1' ) {
|
114 |
+
// return TRUE;
|
115 |
+
// }
|
116 |
+
// } else if ( preg_match( '/(bada|blackberry9670|blackberry 9670|blackberry9800|blackberry 9800|blackberry9810|blackberry 9810|dolfin|maemo|meego|s8000|windows phone os 7)/i', $user_agent ) ) {
|
117 |
+
// return TRUE;
|
118 |
+
// } else if ( preg_match( '/webos\/(\d+\.\d+(\.\d+)*)/i', $user_agent, $version ) ) {
|
119 |
+
// if ( $version[1] >= '1.4' ) {
|
120 |
+
// return TRUE;
|
121 |
+
// }
|
122 |
+
// }
|
123 |
+
//
|
124 |
+
// return FALSE;
|
125 |
+
// }
|
126 |
}
|
127 |
}
|
128 |
?>
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
=== Accelerated Mobile Pages ===
|
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.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -11,7 +11,48 @@ Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on
|
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
== Installation ==
|
17 |
|
@@ -28,7 +69,15 @@ Add /?amp at the end of your website url and you will get amp version of your we
|
|
28 |
|
29 |
= I have addded /?amp at the end of the url and still I'm not able to see the AMP version of my site? =
|
30 |
|
31 |
-
Please check if you have "Pretty Permalinks" enabled. If not then activate it. For more details about Pretty Permalinks check out this wonderful article https://codex.wordpress.org/Using_Permalinks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
|
34 |
== Changelog ==
|
@@ -53,3 +102,6 @@ Please check if you have "Pretty Permalinks" enabled. If not then activate it. F
|
|
53 |
|
54 |
= 0.5 =
|
55 |
* Added AMP Markup for Google Structured data. This will fix the issues in Webmaster tools.
|
|
|
|
|
|
1 |
+
=== AMP - Accelerated Mobile Pages ===
|
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.6
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site. AMP WP is a plugin that needs to no configuration, just activate it and you are done.
|
15 |
+
|
16 |
+
[View Demo and Screenshot of the plugin](http://ahmedkaludi.com/accelerated-mobile-pages/)
|
17 |
+
|
18 |
+
**Features:**
|
19 |
+
|
20 |
+
* Automatically integrate AMP to your website
|
21 |
+
* Supports Posts and Pages
|
22 |
+
* Proper rel canonical tags which means that Google know the original page.
|
23 |
+
* Overlay Navigation Menu bar
|
24 |
+
* Social Sharing in the Single
|
25 |
+
* Sexy Design
|
26 |
+
* Separate WordPress Menu for AMP version
|
27 |
+
|
28 |
+
|
29 |
+
**NOTE: Next Update of this plugin will be released on 4 August 2016.** [Here is the list of things](https://goo.gl/jDTPyg) that will be updated in the next update
|
30 |
+
|
31 |
+
|
32 |
+
**How to test if AMP is working or not?**
|
33 |
+
|
34 |
+
After you install the plugin, Google will automatically index the amp pages using the amp tag and then show you the updates in the search console.
|
35 |
+
|
36 |
+
|
37 |
+
**How can I view the AMP version of my site**
|
38 |
+
|
39 |
+
To view the AMP version, add /?amp at the end of your url. An example would be http://Website.com/?amp .... and No, you don't have to worry about duplication of the content because that has been taken care of the canonical tag as suggested by Google.
|
40 |
+
|
41 |
+
|
42 |
+
**How do I Report Bugs and Suggest New Features**
|
43 |
+
|
44 |
+
<i>You</i> can report the bugs at https://github.com/ahmedkaludi/Accelerated-Mobile-Pages/issues
|
45 |
+
|
46 |
+
|
47 |
+
**Will you Add New features upon my request?**
|
48 |
+
|
49 |
+
Yes, Absolutely! I would suggest you to send your feature request by creating an issue in Github at https://github.com/ahmedkaludi/Accelerated-Mobile-Pages/issues/new/ . It helps us organize the feedback easily.
|
50 |
+
|
51 |
+
|
52 |
+
**How do I get in touch?**
|
53 |
+
|
54 |
+
You can contact me using this url: http://ahmedkaludi.com/contact-me/
|
55 |
+
|
56 |
|
57 |
== Installation ==
|
58 |
|
69 |
|
70 |
= I have addded /?amp at the end of the url and still I'm not able to see the AMP version of my site? =
|
71 |
|
72 |
+
Please check if you have "Pretty Permalinks" enabled. If not then activate it. For more details about Pretty Permalinks check out this wonderful article https://codex.wordpress.org/Using_Permalinks
|
73 |
+
|
74 |
+
|
75 |
+
== Screenshots ==
|
76 |
+
1. AMP Homepage
|
77 |
+
2. AMP Single Post
|
78 |
+
3. Post Navigation in Single
|
79 |
+
4. Sticky Social sharing icons
|
80 |
+
5. Overlay Navigation menu sidebar.
|
81 |
|
82 |
|
83 |
== Changelog ==
|
102 |
|
103 |
= 0.5 =
|
104 |
* Added AMP Markup for Google Structured data. This will fix the issues in Webmaster tools.
|
105 |
+
|
106 |
+
= 0.6 =
|
107 |
+
* Improved Navigation Menu, Search Console errors fixed, Social Sharing option, Pages support, Force redirection for mobile users removed and many other bug fixes
|
themes/default/footer.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<p>Copyright © <?php echo date("Y"); ?> </p>
|
7 |
</div>
|
8 |
</footer>
|
9 |
-
<?php wp_footer(); ?>
|
10 |
|
11 |
|
12 |
|
6 |
<p>Copyright © <?php echo date("Y"); ?> </p>
|
7 |
</div>
|
8 |
</footer>
|
9 |
+
<?php //wp_footer(); ?>
|
10 |
|
11 |
|
12 |
|
themes/default/functions.php
CHANGED
@@ -6,9 +6,75 @@
|
|
6 |
* https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#required-markup
|
7 |
*/
|
8 |
|
9 |
-
function amp_custom_style() {
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
body{
|
13 |
font: 16px/1.4 Sans-serif;
|
14 |
}
|
@@ -26,7 +92,7 @@ function amp_custom_style() { ?>
|
|
26 |
line-height: 1;
|
27 |
margin: 15px;
|
28 |
}
|
29 |
-
|
30 |
padding: 15px;
|
31 |
background: #312C7E;
|
32 |
color: #fff;
|
@@ -93,7 +159,7 @@ function amp_custom_style() { ?>
|
|
93 |
.subtitle{
|
94 |
font-size: 12px;
|
95 |
}
|
96 |
-
|
97 |
list-style-type: none;
|
98 |
margin: 0;
|
99 |
padding: 0;
|
@@ -104,18 +170,25 @@ function amp_custom_style() { ?>
|
|
104 |
content: "";
|
105 |
clear: both
|
106 |
}
|
107 |
-
|
108 |
font-size: 13px;
|
109 |
border-bottom: 1px solid rgba(0, 0, 0, 0.11);
|
110 |
padding: 11px 0px;
|
111 |
width: 25%;
|
112 |
float: left;
|
|
|
|
|
113 |
}
|
114 |
-
|
115 |
display: none
|
116 |
}
|
117 |
-
|
118 |
-
color: #eee
|
|
|
|
|
|
|
|
|
|
|
119 |
}
|
120 |
.toggle-text{
|
121 |
color: #DCDCDC;
|
@@ -132,6 +205,13 @@ function amp_custom_style() { ?>
|
|
132 |
margin-left: -40px;
|
133 |
letter-spacing: 1px;
|
134 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
.clearfix{
|
136 |
clear: both
|
137 |
}
|
@@ -214,7 +294,7 @@ function amp_custom_style() { ?>
|
|
214 |
main{
|
215 |
padding: 25px 15% 25px 15%;
|
216 |
}
|
217 |
-
|
218 |
width: 20%
|
219 |
}
|
220 |
|
@@ -230,7 +310,7 @@ function amp_custom_style() { ?>
|
|
230 |
main{
|
231 |
padding: 25px 18px 25px 18px;
|
232 |
}
|
233 |
-
|
234 |
width: 50%
|
235 |
}
|
236 |
}
|
6 |
* https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#required-markup
|
7 |
*/
|
8 |
|
9 |
+
function amp_custom_style() {
|
10 |
+
/* Style Improvements:
|
11 |
+
- Remove toggle-navigation style because it was replaced with toggle-navigationv2 */
|
12 |
+
?>
|
13 |
+
<style amp-custom>
|
14 |
+
amp-sidebar {
|
15 |
+
width: 250px;
|
16 |
+
}
|
17 |
+
.amp-sidebar-image {
|
18 |
+
line-height: 100px;
|
19 |
+
vertical-align:middle;
|
20 |
+
}
|
21 |
+
.amp-close-image {
|
22 |
+
top: 15px;
|
23 |
+
left: 225px;
|
24 |
+
cursor: pointer;
|
25 |
+
}
|
26 |
+
.toggle-navigationv2{
|
27 |
+
|
28 |
+
}
|
29 |
+
.toggle-navigationv2 ul {
|
30 |
+
list-style-type: none;
|
31 |
+
margin: 0;
|
32 |
+
padding: 0;
|
33 |
+
}
|
34 |
+
.toggle-navigationv2 ul ul li a {
|
35 |
+
padding-left: 35px;
|
36 |
+
background: #fff;
|
37 |
+
display: inline-block
|
38 |
+
}
|
39 |
+
.toggle-navigationv2 ul li a{
|
40 |
+
padding: 15px 25px;
|
41 |
+
width: 100%;
|
42 |
+
display: inline-block;
|
43 |
+
background: #fafafa;
|
44 |
+
font-size: 14px;
|
45 |
+
border-bottom: 1px solid #efefef;
|
46 |
+
}
|
47 |
+
.close-nav{
|
48 |
+
font-size: 12px;
|
49 |
+
background: rgba(0, 0, 0, 0.25);
|
50 |
+
letter-spacing: 1px;
|
51 |
+
display: inline-block;
|
52 |
+
padding: 10px;
|
53 |
+
border-radius: 100px;
|
54 |
+
line-height: 8px;
|
55 |
+
margin: 14px;
|
56 |
+
left: 191px;
|
57 |
+
color: #fff;
|
58 |
+
}
|
59 |
+
.close-nav:hover{
|
60 |
+
background: rgba(0, 0, 0, 0.45);
|
61 |
+
}
|
62 |
+
|
63 |
+
.sticky_social{
|
64 |
+
|
65 |
+
width: 100%;
|
66 |
+
bottom: 0;
|
67 |
+
display: block;
|
68 |
+
left: 0;
|
69 |
+
box-shadow: 0px 4px 7px #000;
|
70 |
+
background: #fff;
|
71 |
+
padding: 7px 0px 0px 0px;
|
72 |
+
position: fixed;
|
73 |
+
margin: 0;
|
74 |
+
z-index: 999;
|
75 |
+
text-align: center;
|
76 |
+
}
|
77 |
+
|
78 |
body{
|
79 |
font: 16px/1.4 Sans-serif;
|
80 |
}
|
92 |
line-height: 1;
|
93 |
margin: 15px;
|
94 |
}
|
95 |
+
.nav_container{
|
96 |
padding: 15px;
|
97 |
background: #312C7E;
|
98 |
color: #fff;
|
159 |
.subtitle{
|
160 |
font-size: 12px;
|
161 |
}
|
162 |
+
.toggle-navigation ul{
|
163 |
list-style-type: none;
|
164 |
margin: 0;
|
165 |
padding: 0;
|
170 |
content: "";
|
171 |
clear: both
|
172 |
}
|
173 |
+
.toggle-navigation ul li{
|
174 |
font-size: 13px;
|
175 |
border-bottom: 1px solid rgba(0, 0, 0, 0.11);
|
176 |
padding: 11px 0px;
|
177 |
width: 25%;
|
178 |
float: left;
|
179 |
+
text-align: center;
|
180 |
+
margin-top: 6px
|
181 |
}
|
182 |
+
.toggle-navigation ul ul{
|
183 |
display: none
|
184 |
}
|
185 |
+
.toggle-navigation ul li a{
|
186 |
+
color: #eee;
|
187 |
+
padding: 15px;
|
188 |
+
}
|
189 |
+
.toggle-navigation{
|
190 |
+
display: none;
|
191 |
+
background: #444;
|
192 |
}
|
193 |
.toggle-text{
|
194 |
color: #DCDCDC;
|
205 |
margin-left: -40px;
|
206 |
letter-spacing: 1px;
|
207 |
}
|
208 |
+
.nav_container:hover + .toggle-navigation,
|
209 |
+
.toggle-navigation:hover,
|
210 |
+
.toggle-navigation:active,
|
211 |
+
.toggle-navigation:focus{
|
212 |
+
display: inline-block;
|
213 |
+
width: 100%;
|
214 |
+
}
|
215 |
.clearfix{
|
216 |
clear: both
|
217 |
}
|
294 |
main{
|
295 |
padding: 25px 15% 25px 15%;
|
296 |
}
|
297 |
+
.toggle-navigation ul li{
|
298 |
width: 20%
|
299 |
}
|
300 |
|
310 |
main{
|
311 |
padding: 25px 18px 25px 18px;
|
312 |
}
|
313 |
+
.toggle-navigation ul li{
|
314 |
width: 50%
|
315 |
}
|
316 |
}
|
themes/default/header.php
CHANGED
@@ -1,6 +1,12 @@
|
|
1 |
<!doctype html>
|
2 |
<html amp>
|
|
|
3 |
<head>
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
<title>
|
6 |
<?php
|
@@ -57,9 +63,17 @@
|
|
57 |
</header>
|
58 |
|
59 |
<nav>
|
60 |
-
<a href="#" class="toggle-text">Navigate</a>
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
</div>
|
|
|
|
|
63 |
</nav>
|
64 |
|
65 |
<?php if ( is_single() ) {
|
1 |
<!doctype html>
|
2 |
<html amp>
|
3 |
+
|
4 |
<head>
|
5 |
+
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
|
6 |
+
|
7 |
+
<script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>
|
8 |
+
|
9 |
+
<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
|
10 |
|
11 |
<title>
|
12 |
<?php
|
63 |
</header>
|
64 |
|
65 |
<nav>
|
66 |
+
<div on='tap:sidebar.toggle' class="nav_container"> <a href="#" class="toggle-text">Navigate</a></div>
|
67 |
+
|
68 |
+
<amp-sidebar id='sidebar'
|
69 |
+
layout="nodisplay"
|
70 |
+
side="right">
|
71 |
+
<div class="toggle-navigationv2">
|
72 |
+
<div on='tap:sidebar.close' class="close-nav">X</div>
|
73 |
+
<?php wp_nav_menu( array( 'theme_location' => 'amp-menu' ) ); ?>
|
74 |
</div>
|
75 |
+
</amp-sidebar>
|
76 |
+
|
77 |
</nav>
|
78 |
|
79 |
<?php if ( is_single() ) {
|
themes/default/page.php
CHANGED
@@ -23,4 +23,47 @@
|
|
23 |
|
24 |
</div>
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
<?php get_footer(); ?>
|
23 |
|
24 |
</div>
|
25 |
|
26 |
+
<script type="application/ld+json">
|
27 |
+
{
|
28 |
+
"@context": "http://schema.org",
|
29 |
+
"@type": "NewsArticle",
|
30 |
+
"mainEntityOfPage": {
|
31 |
+
"@type": "WebPage",
|
32 |
+
"@id": "<?php the_permalink(); ?>"
|
33 |
+
},
|
34 |
+
"headline": "Article headline",
|
35 |
+
"image": {
|
36 |
+
"@type": "ImageObject",
|
37 |
+
|
38 |
+
<?php
|
39 |
+
$thumb_id = get_post_thumbnail_id();
|
40 |
+
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'large', true);
|
41 |
+
$thumb_url = $thumb_url_array[0];
|
42 |
+
?>
|
43 |
+
"url": "<?php echo $thumb_url ?>",
|
44 |
+
"height": 1024,
|
45 |
+
"width": 1024
|
46 |
+
},
|
47 |
+
"datePublished": "<?php echo the_time('c'); ?>",
|
48 |
+
"dateModified": "<?php echo the_time('c'); ?>",
|
49 |
+
"author": {
|
50 |
+
"@type": "Person",
|
51 |
+
"name": "<?php the_author_meta( 'nickname', $author_id ); ?>"
|
52 |
+
},
|
53 |
+
"publisher": {
|
54 |
+
"@type": "Organization",
|
55 |
+
"name": "<?php echo get_bloginfo( 'name' ); ?>",
|
56 |
+
"logo": {
|
57 |
+
"@type": "ImageObject",
|
58 |
+
"url": "<?php $site_logo = get_theme_mod('custom_logo'); echo wp_get_attachment_url($site_logo) ?>",
|
59 |
+
"width": 600,
|
60 |
+
"height": 60
|
61 |
+
}
|
62 |
+
},
|
63 |
+
"description": "A most wonderful article"
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
</script>
|
69 |
<?php get_footer(); ?>
|
themes/default/single.php
CHANGED
@@ -12,6 +12,26 @@
|
|
12 |
</div>
|
13 |
|
14 |
<div class="post">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
<?php the_content(); ?>
|
17 |
<?php wp_link_pages( 'before=<p>&after=</p>&next_or_number=number&pagelink=Page %' ); ?>
|
12 |
</div>
|
13 |
|
14 |
<div class="post">
|
15 |
+
<div class="sticky_social">
|
16 |
+
<amp-social-share type="twitter"
|
17 |
+
width="50"
|
18 |
+
height="28"> </amp-social-share>
|
19 |
+
<amp-social-share type="gplus"
|
20 |
+
width="50"
|
21 |
+
height="28"></amp-social-share>
|
22 |
+
<amp-social-share type="email"
|
23 |
+
width="50"
|
24 |
+
height="28"></amp-social-share>
|
25 |
+
<amp-social-share type="pinterest"
|
26 |
+
width="50"
|
27 |
+
height="28"></amp-social-share>
|
28 |
+
<amp-social-share type="linkedin"
|
29 |
+
width="50"
|
30 |
+
height="28"></amp-social-share>
|
31 |
+
<amp-social-share type="facebook"
|
32 |
+
width="50"
|
33 |
+
height="28"></amp-social-share>
|
34 |
+
</div>
|
35 |
|
36 |
<?php the_content(); ?>
|
37 |
<?php wp_link_pages( 'before=<p>&after=</p>&next_or_number=number&pagelink=Page %' ); ?>
|