Version Description
(15th May 2019) = * Added: Gutenberg Compatibility integrated #2427 * Added: Gallery Designs for Gutenberg Gallery #2868 * Added: Gutenburg column support in AMP #2847 * Added: Addthis Sharing option UX re-structured #3114 * Added: Photo Gallery plugin compatibility integrated #1811 * Added: Revolution Slider plugin compatibility integrated #1464 * Added: Posts offset option on category module in AMP Page Builder #2647 * Added: MEWE social network integrated #3020 * Added: Font Size and Color options for Dropcap #3010 * Added: Breadcrumbs feature for pages #2788 * Added: More parameters for ampforwp_get_setting functions #2911 * Fixed: Conditions for PageBuilder and Elementor for Page.php in Swift #3097 * Fixed: Code updated of Infinite Scroll when AMP Newspaper Theme is active #3031 * Fixed: Copy the Content in Custom AMP Editor is not working with Gutenberg #2824 * Fixed: If GTM gets enabled after Enabling the Analytics, then both codes load in the frontend #3121 * Fixed: P tag is missing when "copy the content" option is used in custom AMP editor #3122 * Fixed: When AMP is disabled on Homepagepage ?nonamp=1 redirect to random pages(blog) #2904 * Fixed: Issue with post title and "end point to ?amp" conflict #2991 * Fixed: Unspecified Type in Structured data for catgories/tags #3071 * Fixed: PHP Warning date() expects parameter 2 to be long, string given in #2959 * Fixed: Disquss comment is not scrollable in IOS device #2970 * Fixed: Vkontakte Share(social icon) does not open in a new tab #3089 * Fixed: Condition for requiring a file improved #3080 * Fixed: amp_content() used instead of AMP_Post_Template object in Design [ 1,2 and 3 ] #2700 * Fixed: Hyperlink in amp pages including emoji not working #2967 * Fixed: Unused amp js from amp pages removed #3086 * Fixed: "WP Forms for AMP" setting link is incorrect #3060 * Fixed: Navigation & alternate menu css is not loading when directory plus theme is active #2963 * Fixed: link to non-amp under breadcrumbs when Archives support is off. #2885 * Fixed: AddThis is causing validation error after Update - code updated #3068 * Fixed: Content not rendering on AMP with the Enfold theme version 4.5.6 #3124 * Fixed: Tags are also displaying in category selection in the AMP page builder's category module #3082 * Fixed: Author name wont show if you disable author bio in swift theme #3131 * Fixed: Link to non amp feature not works for thumbnail in design one and two #3004 * Fixed: Multibyte string links aren't working in AMP Version #2556 * Fixed: Leave Comment link Not working with ?amp #3093 * Fixed: When Sticky Header is enabled then Jump link's Title is getting hidden under the header #2915 * Fixed: Facebook comments not displaying if we add number more than 100 in the number of comments #3032 * Fixed: Featured image and link shared on twitter issues #3075 * Fixed: Infinity Scroll Option is not working when ?amp option is enabled in version beta #2475
Full changelog available in changelog.txt
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 0.9.97.52 |
Comparing to | |
See all releases |
Code changes from version 0.9.97.51.2 to 0.9.97.52
- README.md +60 -9
- accelerated-moblie-pages.php +10 -4
- changelog.txt +42 -0
- classes/class-ampforwp-photo-gallery-embed.php +322 -0
- classes/class-ampforwp-rev-slider.php +341 -0
- classes/class-ampforwp-youtube-embed.php +4 -1
- components/author-box/author-box.php +24 -10
- components/categories-tags/categories-tags.php +16 -8
- components/components-core.php +8 -3
- components/logo/logo.php +21 -29
- components/loop/loop.php +14 -8
- components/related-posts/related-posts.php +1 -1
- images/favicon-mewe.svg +19 -0
- includes/features/analytics/analytics-functions.php +1 -1
- includes/features/structure-data/structured-data-functions.php +7 -2
- includes/options/admin-config.php +147 -43
- includes/redirect.php +19 -11
- includes/thirdparty-compatibility.php +22 -0
- includes/vendor/amp/includes/class-amp-post-template.php +8 -2
- includes/vendor/amp/includes/embeds/class-amp-core-block-handler.php +117 -0
- includes/vendor/amp/includes/sanitizers/class-amp-base-sanitizer.php +21 -0
- includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php +11 -4
- includes/vendor/amp/includes/sanitizers/class-amp-block-sanitizer.php +133 -0
- includes/vendor/amp/includes/sanitizers/class-amp-gallery-block-sanitizer.php +366 -0
- includes/vendor/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php +3 -1
- includes/vendor/vendor-changelog.txt +3 -1
- pagebuilder/inc/adminAjaxContents.php +5 -1
- pagebuilder/inc/viewShowFrontData.php +2 -1
- pagebuilder/modules/accordion-mod-module.php +7 -10
- pagebuilder/modules/contents-module.php +8 -0
- readme.txt +60 -49
- templates/custom-amp-content-button.js +5 -0
- templates/design-manager/design-1/elements/bread-crumbs.php +1 -1
- templates/design-manager/design-1/elements/content.php +1 -38
- templates/design-manager/design-1/elements/meta-taxonomy.php +12 -5
- templates/design-manager/design-1/elements/related-posts.php +1 -1
- templates/design-manager/design-1/elements/social-icons.php +8 -1
- templates/design-manager/design-1/style.php +19 -4
- templates/design-manager/design-2/elements/bread-crumbs.php +1 -1
- templates/design-manager/design-2/elements/content.php +1 -42
- templates/design-manager/design-2/elements/meta-info.php +12 -5
- templates/design-manager/design-2/elements/related-posts.php +2 -2
- templates/design-manager/design-2/elements/social-icons.php +9 -1
- templates/design-manager/design-2/style.php +17 -4
- templates/design-manager/design-3/elements/bread-crumbs.php +1 -1
- templates/design-manager/design-3/elements/content.php +1 -40
- templates/design-manager/design-3/elements/meta-info.php +12 -6
- templates/design-manager/design-3/elements/related-posts.php +2 -2
- templates/design-manager/design-3/elements/social-icons.php +8 -1
- templates/design-manager/design-3/style.php +27 -5
- templates/design-manager/swift/footer.php +6 -0
- templates/design-manager/swift/functions.php +6 -0
- templates/design-manager/swift/index.php +3 -1
- templates/design-manager/swift/page.php +14 -12
- templates/design-manager/swift/single.php +38 -20
- templates/design-manager/swift/style.php +46 -26
- templates/features.php +65 -24
@@ -3,8 +3,8 @@ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
|
|
3 |
Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 0.9.97.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -31,18 +31,27 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
|
|
31 |
= Features: =
|
32 |
|
33 |
* NEW - Gutenberg Support
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
* NEW - GDPR Compliance
|
35 |
-
*
|
36 |
-
*
|
37 |
-
*
|
38 |
-
*
|
39 |
-
*
|
40 |
-
*
|
41 |
* Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
|
42 |
* AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
|
43 |
* Structured Data Options
|
44 |
* Page Break / NextPage (Pagination) Support
|
45 |
* Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
|
|
|
|
|
|
|
46 |
* Facebook Comments Support
|
47 |
* Github Gist Support
|
48 |
* Email Opt-in Subscription form support in AMP added
|
@@ -73,7 +82,7 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
|
|
73 |
* User Friendly Theme Options Panel.
|
74 |
* Unlimited Color Scheme.
|
75 |
* Image Logo Upload.
|
76 |
-
* Supports Posts and Pages.
|
77 |
* Proper rel canonical tags which means that Google know the original page.
|
78 |
* Overlay Navigation Menu bar.
|
79 |
* Social Sharing in the Single.
|
@@ -183,6 +192,48 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
|
|
183 |
|
184 |
== Changelog ==
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
= 0.9.97.51.2 (10th May 2019) =
|
187 |
* Fixed: AddThis is causing validation error after Update #3068
|
188 |
|
3 |
Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 5.2
|
7 |
+
Stable tag: 0.9.97.52
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
31 |
= Features: =
|
32 |
|
33 |
* NEW - Gutenberg Support
|
34 |
+
* NEW - Divi and Elementor Support [More Info](https://ampforwp.com/woocommerce/)
|
35 |
+
* NEW - Addthis Sharing Support
|
36 |
+
* NEW - AMP Infinity Scroll Support
|
37 |
+
* NEW - Revolution Slider plugin Support
|
38 |
+
* NEW - Photo Gallery by 10Web Support
|
39 |
+
* NEW - MEWE social network Support
|
40 |
* NEW - GDPR Compliance
|
41 |
+
* Introducing Page Builder 3.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
|
42 |
+
* New Default Theme for AMP called Swift
|
43 |
+
* 3 Pre-built AMP Layouts for Business websites and landing pages
|
44 |
+
* Alexa Metrics Compatibility added
|
45 |
+
* OneSignal Push Notifications integration
|
46 |
+
* Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
|
47 |
* Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
|
48 |
* AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
|
49 |
* Structured Data Options
|
50 |
* Page Break / NextPage (Pagination) Support
|
51 |
* Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
|
52 |
+
* Graviry Form Support [More Info](https://ampforwp.com/gravity-forms/)
|
53 |
+
* Caldera Form Support [More Info](https://ampforwp.com/caldera-forms-for-amp/)
|
54 |
+
* Ninja Form Support [More Info](https://ampforwp.com/ninja-forms/)
|
55 |
* Facebook Comments Support
|
56 |
* Github Gist Support
|
57 |
* Email Opt-in Subscription form support in AMP added
|
82 |
* User Friendly Theme Options Panel.
|
83 |
* Unlimited Color Scheme.
|
84 |
* Image Logo Upload.
|
85 |
+
* Supports Posts and Pages and other custom post types.
|
86 |
* Proper rel canonical tags which means that Google know the original page.
|
87 |
* Overlay Navigation Menu bar.
|
88 |
* Social Sharing in the Single.
|
192 |
|
193 |
== Changelog ==
|
194 |
|
195 |
+
= 0.9.97.52 (15th May 2019) =
|
196 |
+
* Added: Gutenberg Compatibility integrated #2427
|
197 |
+
* Added: Gallery Designs for Gutenberg Gallery #2868
|
198 |
+
* Added: Gutenburg column support in AMP #2847
|
199 |
+
* Added: Addthis Sharing option UX re-structured #3114
|
200 |
+
* Added: Photo Gallery plugin compatibility integrated #1811
|
201 |
+
* Added: Revolution Slider plugin compatibility integrated #1464
|
202 |
+
* Added: Posts offset option on category module in AMP Page Builder #2647
|
203 |
+
* Added: MEWE social network integrated #3020
|
204 |
+
* Added: Font Size and Color options for Dropcap #3010
|
205 |
+
* Added: Breadcrumbs feature for pages #2788
|
206 |
+
* Added: More parameters for ampforwp_get_setting functions #2911
|
207 |
+
* Fixed: Conditions for PageBuilder and Elementor for Page.php in Swift #3097
|
208 |
+
* Fixed: Code updated of Infinite Scroll when AMP Newspaper Theme is active #3031
|
209 |
+
* Fixed: Copy the Content in Custom AMP Editor is not working with Gutenberg #2824
|
210 |
+
* Fixed: If GTM gets enabled after Enabling the Analytics, then both codes load in the frontend #3121
|
211 |
+
* Fixed: P tag is missing when "copy the content" option is used in custom AMP editor #3122
|
212 |
+
* Fixed: When AMP is disabled on Homepagepage ?nonamp=1 redirect to random pages(blog) #2904
|
213 |
+
* Fixed: Issue with post title and "end point to ?amp" conflict #2991
|
214 |
+
* Fixed: Unspecified Type in Structured data for catgories/tags #3071
|
215 |
+
* Fixed: PHP Warning date() expects parameter 2 to be long, string given in #2959
|
216 |
+
* Fixed: Disquss comment is not scrollable in IOS device #2970
|
217 |
+
* Fixed: Vkontakte Share(social icon) does not open in a new tab #3089
|
218 |
+
* Fixed: Condition for requiring a file improved #3080
|
219 |
+
* Fixed: amp_content() used instead of AMP_Post_Template object in Design [ 1,2 and 3 ] #2700
|
220 |
+
* Fixed: Hyperlink in amp pages including emoji not working #2967
|
221 |
+
* Fixed: Unused amp js from amp pages removed #3086
|
222 |
+
* Fixed: "WP Forms for AMP" setting link is incorrect #3060
|
223 |
+
* Fixed: Navigation & alternate menu css is not loading when directory plus theme is active #2963
|
224 |
+
* Fixed: link to non-amp under breadcrumbs when Archives support is off. #2885
|
225 |
+
* Fixed: AddThis is causing validation error after Update - code updated #3068
|
226 |
+
* Fixed: Content not rendering on AMP with the Enfold theme version 4.5.6 #3124
|
227 |
+
* Fixed: Tags are also displaying in category selection in the AMP page builder's category module #3082
|
228 |
+
* Fixed: Author name won´t show if you disable author bio in swift theme #3131
|
229 |
+
* Fixed: Link to non amp feature not works for thumbnail in design one and two #3004
|
230 |
+
* Fixed: Multibyte string links aren't working in AMP Version #2556
|
231 |
+
* Fixed: Leave Comment link Not working with ?amp #3093
|
232 |
+
* Fixed: When Sticky Header is enabled then Jump link's Title is getting hidden under the header #2915
|
233 |
+
* Fixed: Facebook comments not displaying if we add number more than 100 in the number of comments #3032
|
234 |
+
* Fixed: Featured image and link shared on twitter issues #3075
|
235 |
+
* Fixed: Infinity Scroll Option is not working when ?amp option is enabled in version beta #2475
|
236 |
+
|
237 |
= 0.9.97.51.2 (10th May 2019) =
|
238 |
* Fixed: AddThis is causing validation error after Update #3068
|
239 |
|
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: AMP for WP - Accelerated Mobile Pages for WordPress
|
6 |
-
Version: 0.9.97.
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
|
|
20 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
21 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
22 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
23 |
-
define('AMPFORWP_VERSION','0.9.97.
|
24 |
define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
|
25 |
// any changes to AMP_QUERY_VAR should be refelected here
|
26 |
function ampforwp_generate_endpoint(){
|
@@ -758,8 +758,8 @@ if ( ! function_exists('ampforwp_customizer_is_enabled') ) {
|
|
758 |
}
|
759 |
}
|
760 |
|
761 |
-
// Get Settings from Redux #2177
|
762 |
-
function ampforwp_get_setting( $opt_name='' ){
|
763 |
global $redux_builder_amp;
|
764 |
if(empty($redux_builder_amp)){
|
765 |
$redux_builder_amp = (array) get_option('redux_builder_amp');
|
@@ -767,6 +767,12 @@ function ampforwp_get_setting( $opt_name='' ){
|
|
767 |
$opt_value = '';
|
768 |
if ( isset($redux_builder_amp[$opt_name]) ) {
|
769 |
$opt_value = $redux_builder_amp[$opt_name];
|
|
|
|
|
|
|
|
|
|
|
|
|
770 |
}
|
771 |
return $opt_value;
|
772 |
}
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: AMP for WP - Accelerated Mobile Pages for WordPress
|
6 |
+
Version: 0.9.97.52
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
20 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
21 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
22 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
23 |
+
define('AMPFORWP_VERSION','0.9.97.52');
|
24 |
define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
|
25 |
// any changes to AMP_QUERY_VAR should be refelected here
|
26 |
function ampforwp_generate_endpoint(){
|
758 |
}
|
759 |
}
|
760 |
|
761 |
+
// Get Settings from Redux #2177 & #2911
|
762 |
+
function ampforwp_get_setting( $opt_name='', $child_option='', $sanitize_method='' ){
|
763 |
global $redux_builder_amp;
|
764 |
if(empty($redux_builder_amp)){
|
765 |
$redux_builder_amp = (array) get_option('redux_builder_amp');
|
767 |
$opt_value = '';
|
768 |
if ( isset($redux_builder_amp[$opt_name]) ) {
|
769 |
$opt_value = $redux_builder_amp[$opt_name];
|
770 |
+
if ( '' !== $child_option && isset($redux_builder_amp[$opt_name][$child_option]) ){
|
771 |
+
$opt_value = $redux_builder_amp[$opt_name][$child_option];
|
772 |
+
}
|
773 |
+
}
|
774 |
+
if ( '' !== $sanitize_method && function_exists($sanitize_method) ){
|
775 |
+
return $sanitize_method($opt_value);
|
776 |
}
|
777 |
return $opt_value;
|
778 |
}
|
@@ -1,5 +1,47 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 0.9.97.51.2 (10th May 2019) =
|
4 |
* Fixed: AddThis is causing validation error after Update #3068
|
5 |
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 0.9.97.52 (15th May 2019) =
|
4 |
+
* Added: Gutenberg Compatibility integrated #2427
|
5 |
+
* Added: Gallery Designs for Gutenberg Gallery #2868
|
6 |
+
* Added: Gutenburg column support in AMP #2847
|
7 |
+
* Added: Addthis Sharing option UX re-structured #3114
|
8 |
+
* Added: Photo Gallery plugin compatibility integrated #1811
|
9 |
+
* Added: Revolution Slider plugin compatibility integrated #1464
|
10 |
+
* Added: Posts offset option on category module in AMP Page Builder #2647
|
11 |
+
* Added: MEWE social network integrated #3020
|
12 |
+
* Added: Font Size and Color options for Dropcap #3010
|
13 |
+
* Added: Breadcrumbs feature for pages #2788
|
14 |
+
* Added: More parameters for ampforwp_get_setting functions #2911
|
15 |
+
* Fixed: Conditions for PageBuilder and Elementor for Page.php in Swift #3097
|
16 |
+
* Fixed: Code updated of Infinite Scroll when AMP Newspaper Theme is active #3031
|
17 |
+
* Fixed: Copy the Content in Custom AMP Editor is not working with Gutenberg #2824
|
18 |
+
* Fixed: If GTM gets enabled after Enabling the Analytics, then both codes load in the frontend #3121
|
19 |
+
* Fixed: P tag is missing when "copy the content" option is used in custom AMP editor #3122
|
20 |
+
* Fixed: When AMP is disabled on Homepagepage ?nonamp=1 redirect to random pages(blog) #2904
|
21 |
+
* Fixed: Issue with post title and "end point to ?amp" conflict #2991
|
22 |
+
* Fixed: Unspecified Type in Structured data for catgories/tags #3071
|
23 |
+
* Fixed: PHP Warning date() expects parameter 2 to be long, string given in #2959
|
24 |
+
* Fixed: Disquss comment is not scrollable in IOS device #2970
|
25 |
+
* Fixed: Vkontakte Share(social icon) does not open in a new tab #3089
|
26 |
+
* Fixed: Condition for requiring a file improved #3080
|
27 |
+
* Fixed: amp_content() used instead of AMP_Post_Template object in Design [ 1,2 and 3 ] #2700
|
28 |
+
* Fixed: Hyperlink in amp pages including emoji not working #2967
|
29 |
+
* Fixed: Unused amp js from amp pages removed #3086
|
30 |
+
* Fixed: "WP Forms for AMP" setting link is incorrect #3060
|
31 |
+
* Fixed: Navigation & alternate menu css is not loading when directory plus theme is active #2963
|
32 |
+
* Fixed: link to non-amp under breadcrumbs when Archives support is off. #2885
|
33 |
+
* Fixed: AddThis is causing validation error after Update - code updated #3068
|
34 |
+
* Fixed: Content not rendering on AMP with the Enfold theme version 4.5.6 #3124
|
35 |
+
* Fixed: Tags are also displaying in category selection in the AMP page builder's category module #3082
|
36 |
+
* Fixed: Author name won´t show if you disable author bio in swift theme #3131
|
37 |
+
* Fixed: Link to non amp feature not works for thumbnail in design one and two #3004
|
38 |
+
* Fixed: Multibyte string links aren't working in AMP Version #2556
|
39 |
+
* Fixed: Leave Comment link Not working with ?amp #3093
|
40 |
+
* Fixed: When Sticky Header is enabled then Jump link's Title is getting hidden under the header #2915
|
41 |
+
* Fixed: Facebook comments not displaying if we add number more than 100 in the number of comments #3032
|
42 |
+
* Fixed: Featured image and link shared on twitter issues #3075
|
43 |
+
* Fixed: Infinity Scroll Option is not working when ?amp option is enabled in version beta #2475
|
44 |
+
|
45 |
= 0.9.97.51.2 (10th May 2019) =
|
46 |
* Fixed: AddThis is causing validation error after Update #3068
|
47 |
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Most of the code is taken from class-amp-gallery-embed.php and Photo Gallery Plugin https://wordpress.org/plugins/photo-gallery/
|
4 |
+
*/
|
5 |
+
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );
|
6 |
+
|
7 |
+
class AMPforWP_Photo_Gallery_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Handler {
|
8 |
+
private static $script_slug = 'amp-carousel';
|
9 |
+
private static $script_src = 'https://cdn.ampproject.org/v0/amp-carousel-0.1.js';
|
10 |
+
|
11 |
+
public function register_embed() {
|
12 |
+
add_shortcode( 'Best_Wordpress_Gallery', array( $this, 'shortcode' ) );
|
13 |
+
}
|
14 |
+
|
15 |
+
public function unregister_embed() {
|
16 |
+
remove_shortcode( 'Best_Wordpress_Gallery' );
|
17 |
+
}
|
18 |
+
|
19 |
+
public function get_scripts() {
|
20 |
+
if ( ! $this->did_convert_elements ) {
|
21 |
+
return array();
|
22 |
+
}
|
23 |
+
|
24 |
+
return array( self::$script_slug => self::$script_src );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function shortcode( $args ) {
|
28 |
+
|
29 |
+
$params = array();
|
30 |
+
$params['id'] = WDWLibrary::get('shortcode_id', 0);
|
31 |
+
// Get values for elementor widget.
|
32 |
+
$params['gallery_type'] = WDWLibrary::get('gallery_type', 'thumbnails');
|
33 |
+
$params['gallery_id'] = WDWLibrary::get('gallery_id', 0);
|
34 |
+
$params['tag'] = WDWLibrary::get('tag', 0);
|
35 |
+
$params['album_id'] = WDWLibrary::get('album_id', 0);
|
36 |
+
$params['theme_id'] = WDWLibrary::get('theme_id', 0);
|
37 |
+
$params['ajax'] = TRUE;
|
38 |
+
if ( isset($params['id']) && $params['id'] ) {
|
39 |
+
global $wpdb;
|
40 |
+
$shortcode = $wpdb->get_var($wpdb->prepare("SELECT tagtext FROM " . $wpdb->prefix . "bwg_shortcode WHERE id='%d'", $params['id']));
|
41 |
+
if ($shortcode) {
|
42 |
+
$shortcode_params = explode('" ', $shortcode);
|
43 |
+
foreach ($shortcode_params as $shortcode_param) {
|
44 |
+
$shortcode_param = str_replace('"', '', $shortcode_param);
|
45 |
+
$shortcode_elem = explode('=', $shortcode_param);
|
46 |
+
$params[str_replace(' ', '', $shortcode_elem[0])] = $shortcode_elem[1];
|
47 |
+
}
|
48 |
+
}
|
49 |
+
else {
|
50 |
+
return;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
// 'gallery_type' is the only parameter not being checked.
|
55 |
+
// Checking for incomplete shortcodes.
|
56 |
+
if ( isset($params['gallery_type']) ) {
|
57 |
+
$pairs = WDWLibrary::get_shortcode_option_params( $params );
|
58 |
+
if ( isset($params['ajax']) ) {
|
59 |
+
$pairs['ajax'] = $params['ajax'];
|
60 |
+
}
|
61 |
+
ob_start();
|
62 |
+
$this->front_end( $pairs );
|
63 |
+
$output = str_replace( array( "\r\n", "\n", "\r" ), '', ob_get_clean() );
|
64 |
+
$dom = '';
|
65 |
+
$nodes = '';
|
66 |
+
$num_nodes = '';
|
67 |
+
$urls = array();
|
68 |
+
if( !empty( $output ) ){
|
69 |
+
// Create a new document
|
70 |
+
$dom = new DOMDocument();
|
71 |
+
if( function_exists( 'mb_convert_encoding' ) ){
|
72 |
+
$output = mb_convert_encoding($output, 'HTML-ENTITIES', 'UTF-8');
|
73 |
+
}
|
74 |
+
else{
|
75 |
+
$output = preg_replace( '/&.*?;/', 'x', $output ); // multi-byte characters converted to X
|
76 |
+
}
|
77 |
+
// To Suppress Warnings
|
78 |
+
libxml_use_internal_errors(true);
|
79 |
+
$dom->loadHTML($output);
|
80 |
+
libxml_use_internal_errors(false);
|
81 |
+
// get all the img's
|
82 |
+
$nodes = $dom->getElementsByTagName( 'img' );
|
83 |
+
$num_nodes = $nodes->length;
|
84 |
+
for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
|
85 |
+
$url = $width = $height = '';
|
86 |
+
$node = $nodes->item( $i );
|
87 |
+
$urls[] = apply_filters('amp_photo_gallery_image_params', array(
|
88 |
+
'url' => $node->getAttribute( 'src' ),
|
89 |
+
'width' => 500,
|
90 |
+
'height' => 500,
|
91 |
+
));
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
return $this->render( array(
|
96 |
+
'images' => $urls,
|
97 |
+
) );
|
98 |
+
}
|
99 |
+
|
100 |
+
public function front_end($params) {
|
101 |
+
require_once(BWG()->plugin_dir . '/framework/WDWLibraryEmbed.php');
|
102 |
+
require_once(BWG()->plugin_dir . '/frontend/controllers/controller.php');
|
103 |
+
$controller = new BWGControllerSite( ucfirst( $params[ 'gallery_type' ] ) );
|
104 |
+
if ( WDWLibrary::get('shortcode_id', 0) || isset($params['ajax']) ) {
|
105 |
+
$controller->execute($params, 1, WDWLibrary::get('bwg', 0));
|
106 |
+
}
|
107 |
+
else {
|
108 |
+
$bwg = WDWLibrary::unique_number();
|
109 |
+
$controller->execute($params, 1, $bwg);
|
110 |
+
}
|
111 |
+
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
public function render( $args ) {
|
115 |
+
global $redux_builder_amp,$carousel_markup_all;
|
116 |
+
$this->did_convert_elements = true;
|
117 |
+
|
118 |
+
$args = wp_parse_args( $args, array(
|
119 |
+
'images' => false,
|
120 |
+
) );
|
121 |
+
|
122 |
+
if ( empty( $args['images'] ) ) {
|
123 |
+
return '';
|
124 |
+
}
|
125 |
+
|
126 |
+
/*Filter*/
|
127 |
+
$carousel_markup = $amp_image_lightbox = '';
|
128 |
+
|
129 |
+
$carousel_markup_all = array(
|
130 |
+
'1'=>array(
|
131 |
+
'main-html'=>'{{with_carousel}}
|
132 |
+
{{amp_image_lightbox}}',
|
133 |
+
'image-with-caption-html'=>'<figure><div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div><figcaption {{openbrack}}class{{closebrack}}="expanded? \'expanded\' : \'\'" on="tap:AMP.setState({expanded: !expanded})" tabindex="0" role="button" >{{main_images_caption}}<span {{openbrack}}text{{closebrack}}="expanded ? \'less\' : \'more\'">more</span> </figcaption></figure>',
|
134 |
+
'image-without-caption-html' =>'<div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div>',
|
135 |
+
'gallery_css' => '',
|
136 |
+
|
137 |
+
'scripts' => array()
|
138 |
+
),
|
139 |
+
'2' => array(
|
140 |
+
'main-html'=>'{{with_carousel}}
|
141 |
+
{{with_carousel_thumbnail}}
|
142 |
+
{{amp_image_lightbox}}',
|
143 |
+
'image-with-caption-html'=>'<figure><div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div><figcaption {{openbrack}}class{{closebrack}}="expanded? \'expanded\' : \'\'" on="tap:AMP.setState({expanded: !expanded})" tabindex="0" role="button" >{{main_images_caption}}<span {{openbrack}}text{{closebrack}}="expanded ? \'less\' : \'more\'">more</span> </figcaption></figure>',
|
144 |
+
'image-without-caption-html' =>'<div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div>',
|
145 |
+
'carousel_with_thumbnail_html'=>'<button on="tap:carousel-with-carousel-preview-{{unique_id}}.goToSlide(index={{unique_index}})" class="amp-carousel-slide amp-scrollable-carousel-slide">{{thumbnail}}</button>',
|
146 |
+
'gallery_css' => '
|
147 |
+
.carousel-preview button{padding:0;}
|
148 |
+
.carousel-preview amp-img{height:40px;width:60px;position:relative;}
|
149 |
+
.carousel-preview {width: 100%;display: inline-block;text-align: center;margin: 20px 0px;}
|
150 |
+
',
|
151 |
+
'scripts' => array()
|
152 |
+
),
|
153 |
+
'3' => array(
|
154 |
+
'main-html'=>'<div class="gal_w">{{with_images}}</div>
|
155 |
+
{{amp_image_lightbox}}',
|
156 |
+
'image-with-caption-html'=>'',
|
157 |
+
'image-without-caption-html' =>'{{main_images}}',
|
158 |
+
'gallery_css' => '
|
159 |
+
.gal_w{display:inline-block;width:100%}
|
160 |
+
.gal_w amp-img{background:#f1f1f1;height:134px;width:150px;position: relative;float:left;margin:10px;}
|
161 |
+
.cls-btn{background:#0d0d0d;border:none;position: absolute;right: 10px;}
|
162 |
+
.cls-btn:after{content:"X";display:inline-block;color:#fff;font-size:20px;padding:20px;}
|
163 |
+
',
|
164 |
+
'scripts' => array()
|
165 |
+
),
|
166 |
+
);
|
167 |
+
|
168 |
+
$carousel_markup_all = apply_filters("ampforwp_manage_gallery_markup", $carousel_markup_all);
|
169 |
+
//Default markup
|
170 |
+
$markup = $carousel_markup_all[1];
|
171 |
+
|
172 |
+
if( isset($redux_builder_amp['ampforwp-gallery-design-type']) && isset($carousel_markup_all[$redux_builder_amp['ampforwp-gallery-design-type'] ] ) ){
|
173 |
+
$markup = $carousel_markup_all[$redux_builder_amp['ampforwp-gallery-design-type']];
|
174 |
+
}
|
175 |
+
|
176 |
+
$amp_images = array();
|
177 |
+
foreach ( $args['images'] as $key => $image ) {
|
178 |
+
$amp_img_arr = array(
|
179 |
+
'src' => $image['url'],
|
180 |
+
'width' => $image['width'],
|
181 |
+
'height' => $image['height'],
|
182 |
+
'layout' => 'fill',
|
183 |
+
'class' => 'amp-carousel-img',
|
184 |
+
);
|
185 |
+
if( 3 == ampforwp_get_setting('ampforwp-gallery-design-type') || true == ampforwp_get_setting('ampforwp-gallery-lightbox') ){
|
186 |
+
$design3_additional_attr = array('on'=> 'tap:gallery-lightbox', 'role'=>'button',
|
187 |
+
'tabindex'=>$key);
|
188 |
+
$amp_img_arr = array_merge($amp_img_arr, $design3_additional_attr);
|
189 |
+
$amp_image_lightbox = '<amp-image-lightbox id="gallery-lightbox" layout="nodisplay">
|
190 |
+
<div on="tap:gallery-lightbox.close" role="button"
|
191 |
+
tabindex="0">
|
192 |
+
<button class="cls-btn" on="tap:gallery-lightbox.close"
|
193 |
+
role="button" tabindex="0"></button>
|
194 |
+
</div>
|
195 |
+
</amp-image-lightbox>';
|
196 |
+
}
|
197 |
+
$amp_images[$key] = AMP_HTML_Utils::build_tag(
|
198 |
+
'amp-img',
|
199 |
+
$amp_img_arr
|
200 |
+
);
|
201 |
+
|
202 |
+
//Small Thumbnail Images
|
203 |
+
$thumb_url = ampforwp_aq_resize( $image['url'], 120, 60, true, false ); //resize & crop the image
|
204 |
+
if($thumb_url!=false){
|
205 |
+
$smallimage = $thumb_url[0];
|
206 |
+
$smallwidth = $thumb_url[1];
|
207 |
+
$smallheight = $thumb_url[2];
|
208 |
+
}else{
|
209 |
+
$smallimage = $image['url'];
|
210 |
+
$smallwidth = $image['width'];
|
211 |
+
$smallheight = $image['height'];
|
212 |
+
}
|
213 |
+
|
214 |
+
$amp_images_small[$key] = AMP_HTML_Utils::build_tag(
|
215 |
+
'amp-img',
|
216 |
+
array(
|
217 |
+
'src' => $smallimage,
|
218 |
+
'width' => $smallwidth,
|
219 |
+
'height' => $smallheight,
|
220 |
+
'layout' => 'fill',
|
221 |
+
'class' => 'amp-carousel-img',
|
222 |
+
)
|
223 |
+
);
|
224 |
+
|
225 |
+
//Image markups loading
|
226 |
+
$returnHtml = '';
|
227 |
+
//Check if the attachment has caption or not
|
228 |
+
if(isset($image['caption']) && $image['caption'] != '' && isset($markup['image-with-caption-html']) && $markup['image-with-caption-html'] != ''){
|
229 |
+
// To enable the carousel magic
|
230 |
+
$caption = $image['caption'];
|
231 |
+
// Append the caption with image
|
232 |
+
$returnHtml = isset($markup['image-with-caption-html'])? $markup['image-with-caption-html']:'';
|
233 |
+
$returnHtml = str_replace('{{main_images}}', $amp_images[$key] , $returnHtml);
|
234 |
+
$returnHtml = str_replace('{{main_images_caption}}', wp_kses_data( $caption ), $returnHtml);
|
235 |
+
// Replace the openbrack with [ and closebrack with ]
|
236 |
+
$returnHtml = str_replace('{{openbrack}}', '[', $returnHtml);
|
237 |
+
$returnHtml = str_replace('{{closebrack}}', ']', $returnHtml);
|
238 |
+
}
|
239 |
+
elseif( isset($markup['image-without-caption-html']) ){
|
240 |
+
// If there is no caption
|
241 |
+
$returnHtml = isset($markup['image-without-caption-html'])? $markup['image-without-caption-html'] :'';
|
242 |
+
$returnHtml = str_replace('{{main_images}}', $amp_images[$key] , $returnHtml);
|
243 |
+
}
|
244 |
+
|
245 |
+
$images[$key] = apply_filters('amp_gallery_images', $returnHtml, $image, $markup);
|
246 |
+
}// foreach Closed
|
247 |
+
|
248 |
+
//replacements
|
249 |
+
$r = rand(1,100);
|
250 |
+
$amp_carousel = AMP_HTML_Utils::build_tag(
|
251 |
+
'amp-carousel',
|
252 |
+
array(
|
253 |
+
'width' => $this->args['width'],
|
254 |
+
'height' => $this->args['height'],
|
255 |
+
'type' => 'slides',
|
256 |
+
'layout' => 'responsive',
|
257 |
+
'class' => 'collapsible-captions',
|
258 |
+
'id' => 'carousel-with-carousel-preview-'.$r
|
259 |
+
),
|
260 |
+
implode( PHP_EOL, $images ));
|
261 |
+
|
262 |
+
$amp_carousel_with_thumbnail_nav = apply_filters('amp_thumbnail_images', $amp_images_small, $r, $markup);
|
263 |
+
$amp_carousel_thumbnail ='';
|
264 |
+
if(!empty($amp_carousel_with_thumbnail_nav)){
|
265 |
+
$amp_carousel_thumbnail = AMP_HTML_Utils::build_tag(
|
266 |
+
'amp-carousel',
|
267 |
+
array(
|
268 |
+
'width' => 'auto',
|
269 |
+
'height' => 48,
|
270 |
+
'type' => 'carousel',
|
271 |
+
'layout' => 'fixed-height',
|
272 |
+
'class' => 'carousel-preview'
|
273 |
+
),
|
274 |
+
implode( PHP_EOL, $amp_carousel_with_thumbnail_nav ));
|
275 |
+
|
276 |
+
}
|
277 |
+
$amp_carousel_thumbnail = apply_filters('amp_gallery_markup', $amp_carousel_thumbnail);
|
278 |
+
|
279 |
+
$returnCompleteHtml = $markup['main-html'];
|
280 |
+
//last changes
|
281 |
+
$returnCompleteHtml = str_replace('{{with_carousel}}', $amp_carousel, $returnCompleteHtml);
|
282 |
+
$returnCompleteHtml = str_replace('{{with_carousel_thumbnail}}', $amp_carousel_thumbnail, $returnCompleteHtml);
|
283 |
+
$returnCompleteHtml = str_replace('{{amp_image_lightbox}}', $amp_image_lightbox, $returnCompleteHtml);
|
284 |
+
$returnCompleteHtml = str_replace('{{with_images}}', implode( PHP_EOL, $images ), $returnCompleteHtml);
|
285 |
+
return $returnCompleteHtml;
|
286 |
+
}
|
287 |
+
}// Class closed
|
288 |
+
|
289 |
+
// Add Caption in the Gallery Image
|
290 |
+
add_filter('amp_gallery_images','AMPforWP\\AMPVendor\\ampforwp_new_gallery_images', 10, 3);
|
291 |
+
function ampforwp_new_gallery_images($images_markup, $image, $markup_arr){
|
292 |
+
add_action('amp_post_template_css', 'AMPforWP\\AMPVendor\\ampforwp_additional_gallery_style');
|
293 |
+
add_filter('amp_post_template_data','ampforwp_carousel_bind_script');
|
294 |
+
add_action('amp_post_template_css', 'ampforwp_additional_style_carousel_caption');
|
295 |
+
return $images_markup;
|
296 |
+
}
|
297 |
+
|
298 |
+
if( ! function_exists( 'ampforwp_additional_gallery_style' ) ){
|
299 |
+
function ampforwp_additional_gallery_style(){
|
300 |
+
global $redux_builder_amp,$carousel_markup_all;
|
301 |
+
$design_type = '';
|
302 |
+
$design_type = $redux_builder_amp['ampforwp-gallery-design-type'];
|
303 |
+
|
304 |
+
if(isset($design_type) && $design_type!==''){
|
305 |
+
echo $carousel_markup_all[$design_type]['gallery_css'];
|
306 |
+
}
|
307 |
+
}
|
308 |
+
}
|
309 |
+
|
310 |
+
add_filter('amp_thumbnail_images','AMPforWP\\AMPVendor\\ampforwp_new_thumbnail_images',10,3);
|
311 |
+
function ampforwp_new_thumbnail_images($amp_images, $uniqueid, $markup_arr){
|
312 |
+
if(!isset($markup_arr['carousel_with_thumbnail_html'])){return '';}
|
313 |
+
$amp_thumb_image_buttons = '';
|
314 |
+
foreach ($amp_images as $key => $value) {
|
315 |
+
$returnHtml = $markup_arr['carousel_with_thumbnail_html'];
|
316 |
+
$returnHtml = str_replace('{{thumbnail}}', $value , $returnHtml);
|
317 |
+
$returnHtml = str_replace('{{unique_id}}', $uniqueid , $returnHtml);
|
318 |
+
$returnHtml = str_replace('{{unique_index}}', $key , $returnHtml);
|
319 |
+
$amp_thumb_image_buttons[$key] = $returnHtml;
|
320 |
+
}
|
321 |
+
return $amp_thumb_image_buttons;
|
322 |
+
}
|
@@ -0,0 +1,341 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
Most of the code is taken from class-amp-gallery-embed.php and Slider Revolution https://revolution.themepunch.com/
|
5 |
+
*/
|
6 |
+
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );
|
7 |
+
|
8 |
+
class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Handler {
|
9 |
+
private static $script_slug = 'amp-carousel';
|
10 |
+
private static $script_src = 'https://cdn.ampproject.org/v0/amp-carousel-0.1.js';
|
11 |
+
|
12 |
+
public function register_embed() {
|
13 |
+
add_shortcode( 'rev_slider', array( $this, 'shortcode' ) );
|
14 |
+
}
|
15 |
+
|
16 |
+
public function unregister_embed() {
|
17 |
+
remove_shortcode( 'rev_slider' );
|
18 |
+
}
|
19 |
+
|
20 |
+
public function get_scripts() {
|
21 |
+
if ( ! $this->did_convert_elements ) {
|
22 |
+
return array();
|
23 |
+
}
|
24 |
+
|
25 |
+
return array( self::$script_slug => self::$script_src );
|
26 |
+
}
|
27 |
+
|
28 |
+
public function shortcode( $args, $mid_content = null ) {
|
29 |
+
extract(shortcode_atts(array('alias' => ''), $args, 'rev_slider'));
|
30 |
+
extract(shortcode_atts(array('settings' => ''), $args, 'rev_slider'));
|
31 |
+
extract(shortcode_atts(array('order' => ''), $args, 'rev_slider'));
|
32 |
+
|
33 |
+
if($settings !== '') $settings = json_decode(str_replace(array('({', '})', "'"), array('[', ']', '"'), $settings) ,true);
|
34 |
+
if($order !== '') $order = explode(',', $order);
|
35 |
+
|
36 |
+
$sliderAlias = ($alias != '') ? $alias : RevSliderFunctions::getVal($args,0);
|
37 |
+
|
38 |
+
$gal_ids = RevSliderFunctionsWP::check_for_shortcodes($mid_content);
|
39 |
+
ob_start();
|
40 |
+
if(!empty($gal_ids)){ //add a gallery based slider
|
41 |
+
$slider = RevSliderOutput::putSlider($sliderAlias, '', $gal_ids);
|
42 |
+
}else{
|
43 |
+
$slider = RevSliderOutput::putSlider($sliderAlias, '', array(), $settings, $order);
|
44 |
+
}
|
45 |
+
$content = ob_get_contents();
|
46 |
+
ob_clean();
|
47 |
+
ob_end_clean();
|
48 |
+
$ids = array();
|
49 |
+
$slides = $slider->getSlidesForOutput(true,'',$gal_ids);
|
50 |
+
foreach ($slides as $slide) {
|
51 |
+
$ids[] = $slide->getImageID();
|
52 |
+
|
53 |
+
}
|
54 |
+
$attr['ids'] = implode(',', $ids);
|
55 |
+
|
56 |
+
if ( ! empty( $attr['ids'] ) ) {
|
57 |
+
// 'ids' is explicitly ordered, unless you specify otherwise.
|
58 |
+
if ( empty( $attr['orderby'] ) ) {
|
59 |
+
$attr['orderby'] = 'post__in';
|
60 |
+
}
|
61 |
+
$attr['include'] = $attr['ids'];
|
62 |
+
}
|
63 |
+
|
64 |
+
$atts = shortcode_atts( array(
|
65 |
+
'order' => 'ASC',
|
66 |
+
'orderby' => 'menu_order ID',
|
67 |
+
'id' => $post ? $post->ID : 0,
|
68 |
+
'include' => '',
|
69 |
+
'exclude' => '',
|
70 |
+
//'size' => array( $this->args['width'], $this->args['height'] ),
|
71 |
+
//'size' => isset($attr['size'])? $attr['size']:'thumbnail',
|
72 |
+
'size' => 'large'
|
73 |
+
), $attr, 'gallery' );
|
74 |
+
|
75 |
+
$id = intval( $atts['id'] );
|
76 |
+
|
77 |
+
if ( ! empty( $atts['include'] ) ) {
|
78 |
+
$attachments = get_posts( array(
|
79 |
+
'include' => $atts['include'],
|
80 |
+
'post_status' => 'inherit',
|
81 |
+
'post_type' => 'attachment',
|
82 |
+
'post_mime_type' => 'image',
|
83 |
+
'order' => $atts['order'],
|
84 |
+
'orderby' => $atts['orderby'],
|
85 |
+
'fields' => 'ids',
|
86 |
+
) );
|
87 |
+
} elseif ( ! empty( $atts['exclude'] ) ) {
|
88 |
+
$attachments = get_children( array(
|
89 |
+
'post_parent' => $id,
|
90 |
+
'exclude' => $atts['exclude'],
|
91 |
+
'post_status' => 'inherit',
|
92 |
+
'post_type' => 'attachment',
|
93 |
+
'post_mime_type' => 'image',
|
94 |
+
'order' => $atts['order'],
|
95 |
+
'orderby' => $atts['orderby'],
|
96 |
+
'fields' => 'ids',
|
97 |
+
) );
|
98 |
+
} else {
|
99 |
+
$attachments = get_children( array(
|
100 |
+
'post_parent' => $id,
|
101 |
+
'post_status' => 'inherit',
|
102 |
+
'post_type' => 'attachment',
|
103 |
+
'post_mime_type' => 'image',
|
104 |
+
'order' => $atts['order'],
|
105 |
+
'orderby' => $atts['orderby'],
|
106 |
+
'fields' => 'ids',
|
107 |
+
) );
|
108 |
+
}
|
109 |
+
|
110 |
+
if ( empty( $attachments ) ) {
|
111 |
+
return '';
|
112 |
+
}
|
113 |
+
|
114 |
+
$urls = array();
|
115 |
+
foreach ( $attachments as $attachment_id ) {
|
116 |
+
list( $url, $width, $height ) = wp_get_attachment_image_src( $attachment_id, $atts['size'], true );
|
117 |
+
|
118 |
+
if ( ! $url ) {
|
119 |
+
continue;
|
120 |
+
}
|
121 |
+
|
122 |
+
$urls[] = apply_filters('amp_gallery_image_params', array(
|
123 |
+
'url' => $url,
|
124 |
+
'width' => $width,
|
125 |
+
'height' => $height,
|
126 |
+
),$attachment_id);
|
127 |
+
}
|
128 |
+
return $this->render( array(
|
129 |
+
'images' => $urls,
|
130 |
+
) );
|
131 |
+
}
|
132 |
+
|
133 |
+
public function render( $args ) {
|
134 |
+
global $redux_builder_amp,$carousel_markup_all;
|
135 |
+
$this->did_convert_elements = true;
|
136 |
+
|
137 |
+
$args = wp_parse_args( $args, array(
|
138 |
+
'images' => false,
|
139 |
+
) );
|
140 |
+
|
141 |
+
if ( empty( $args['images'] ) ) {
|
142 |
+
return '';
|
143 |
+
}
|
144 |
+
|
145 |
+
/*Filter*/
|
146 |
+
$carousel_markup = $amp_image_lightbox = '';
|
147 |
+
|
148 |
+
$carousel_markup_all = array(
|
149 |
+
'1'=>array(
|
150 |
+
'main-html'=>'{{with_carousel}}
|
151 |
+
{{amp_image_lightbox}}',
|
152 |
+
'image-with-caption-html'=>'<figure><div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div><figcaption {{openbrack}}class{{closebrack}}="expanded? \'expanded\' : \'\'" on="tap:AMP.setState({expanded: !expanded})" tabindex="0" role="button" >{{main_images_caption}}<span {{openbrack}}text{{closebrack}}="expanded ? \'less\' : \'more\'">more</span> </figcaption></figure>',
|
153 |
+
'image-without-caption-html' =>'<div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div>',
|
154 |
+
'gallery_css' => '',
|
155 |
+
|
156 |
+
'scripts' => array()
|
157 |
+
),
|
158 |
+
'2' => array(
|
159 |
+
'main-html'=>'{{with_carousel}}
|
160 |
+
{{with_carousel_thumbnail}}
|
161 |
+
{{amp_image_lightbox}}',
|
162 |
+
'image-with-caption-html'=>'<figure><div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div><figcaption {{openbrack}}class{{closebrack}}="expanded? \'expanded\' : \'\'" on="tap:AMP.setState({expanded: !expanded})" tabindex="0" role="button" >{{main_images_caption}}<span {{openbrack}}text{{closebrack}}="expanded ? \'less\' : \'more\'">more</span> </figcaption></figure>',
|
163 |
+
'image-without-caption-html' =>'<div class="ampforwp-gallery-item amp-carousel-container">{{main_images}} </div>',
|
164 |
+
'carousel_with_thumbnail_html'=>'<button on="tap:carousel-with-carousel-preview-{{unique_id}}.goToSlide(index={{unique_index}})" class="amp-carousel-slide amp-scrollable-carousel-slide">{{thumbnail}}</button>',
|
165 |
+
'gallery_css' => '
|
166 |
+
.carousel-preview button{padding:0;}
|
167 |
+
.carousel-preview amp-img{height:40px;width:60px;position:relative;}
|
168 |
+
.carousel-preview {width: 100%;display: inline-block;text-align: center;margin: 20px 0px;}
|
169 |
+
',
|
170 |
+
'scripts' => array()
|
171 |
+
),
|
172 |
+
'3' => array(
|
173 |
+
'main-html'=>'<div class="gal_w">{{with_images}}</div>
|
174 |
+
{{amp_image_lightbox}}',
|
175 |
+
'image-with-caption-html'=>'',
|
176 |
+
'image-without-caption-html' =>'{{main_images}}',
|
177 |
+
'gallery_css' => '
|
178 |
+
.gal_w{display:inline-block;width:100%}
|
179 |
+
.gal_w amp-img{background:#f1f1f1;height:134px;width:150px;position: relative;float:left;margin:10px;}
|
180 |
+
.cls-btn{background:#0d0d0d;border:none;position: absolute;right: 10px;}
|
181 |
+
.cls-btn:after{content:"X";display:inline-block;color:#fff;font-size:20px;padding:20px;}
|
182 |
+
',
|
183 |
+
'scripts' => array()
|
184 |
+
),
|
185 |
+
);
|
186 |
+
|
187 |
+
$carousel_markup_all = apply_filters("ampforwp_manage_gallery_markup", $carousel_markup_all);
|
188 |
+
//Default markup
|
189 |
+
$markup = $carousel_markup_all[1];
|
190 |
+
|
191 |
+
if( isset($redux_builder_amp['ampforwp-gallery-design-type']) && isset($carousel_markup_all[$redux_builder_amp['ampforwp-gallery-design-type'] ] ) ){
|
192 |
+
$markup = $carousel_markup_all[$redux_builder_amp['ampforwp-gallery-design-type']];
|
193 |
+
}
|
194 |
+
|
195 |
+
$amp_images = array();
|
196 |
+
foreach ( $args['images'] as $key => $image ) {
|
197 |
+
$amp_img_arr = array(
|
198 |
+
'src' => $image['url'],
|
199 |
+
'width' => $image['width'],
|
200 |
+
'height' => $image['height'],
|
201 |
+
'layout' => 'fill',
|
202 |
+
'class' => 'amp-carousel-img',
|
203 |
+
);
|
204 |
+
if( 3 == ampforwp_get_setting('ampforwp-gallery-design-type') || true == ampforwp_get_setting('ampforwp-gallery-lightbox') ){
|
205 |
+
$design3_additional_attr = array('on'=> 'tap:gallery-lightbox', 'role'=>'button',
|
206 |
+
'tabindex'=>$key);
|
207 |
+
$amp_img_arr = array_merge($amp_img_arr, $design3_additional_attr);
|
208 |
+
$amp_image_lightbox = '<amp-image-lightbox id="gallery-lightbox" layout="nodisplay">
|
209 |
+
<div on="tap:gallery-lightbox.close" role="button"
|
210 |
+
tabindex="0">
|
211 |
+
<button class="cls-btn" on="tap:gallery-lightbox.close"
|
212 |
+
role="button" tabindex="0"></button>
|
213 |
+
</div>
|
214 |
+
</amp-image-lightbox>';
|
215 |
+
}
|
216 |
+
$amp_images[$key] = AMP_HTML_Utils::build_tag(
|
217 |
+
'amp-img',
|
218 |
+
$amp_img_arr
|
219 |
+
);
|
220 |
+
|
221 |
+
//Small Thumbnail Images
|
222 |
+
$thumb_url = ampforwp_aq_resize( $image['url'], 120, 60, true, false ); //resize & crop the image
|
223 |
+
if($thumb_url!=false){
|
224 |
+
$smallimage = $thumb_url[0];
|
225 |
+
$smallwidth = $thumb_url[1];
|
226 |
+
$smallheight = $thumb_url[2];
|
227 |
+
}else{
|
228 |
+
$smallimage = $image['url'];
|
229 |
+
$smallwidth = $image['width'];
|
230 |
+
$smallheight = $image['height'];
|
231 |
+
}
|
232 |
+
|
233 |
+
$amp_images_small[$key] = AMP_HTML_Utils::build_tag(
|
234 |
+
'amp-img',
|
235 |
+
array(
|
236 |
+
'src' => $smallimage,
|
237 |
+
'width' => $smallwidth,
|
238 |
+
'height' => $smallheight,
|
239 |
+
'layout' => 'fill',
|
240 |
+
'class' => 'amp-carousel-img',
|
241 |
+
)
|
242 |
+
);
|
243 |
+
|
244 |
+
//Image markups loading
|
245 |
+
$returnHtml = '';
|
246 |
+
//Check if the attachment has caption or not
|
247 |
+
if(isset($image['caption']) && $image['caption'] != '' && isset($markup['image-with-caption-html']) && $markup['image-with-caption-html'] != ''){
|
248 |
+
// To enable the carousel magic
|
249 |
+
$caption = $image['caption'];
|
250 |
+
// Append the caption with image
|
251 |
+
$returnHtml = isset($markup['image-with-caption-html'])? $markup['image-with-caption-html']:'';
|
252 |
+
$returnHtml = str_replace('{{main_images}}', $amp_images[$key] , $returnHtml);
|
253 |
+
$returnHtml = str_replace('{{main_images_caption}}', wp_kses_data( $caption ), $returnHtml);
|
254 |
+
// Replace the openbrack with [ and closebrack with ]
|
255 |
+
$returnHtml = str_replace('{{openbrack}}', '[', $returnHtml);
|
256 |
+
$returnHtml = str_replace('{{closebrack}}', ']', $returnHtml);
|
257 |
+
}
|
258 |
+
elseif( isset($markup['image-without-caption-html']) ){
|
259 |
+
// If there is no caption
|
260 |
+
$returnHtml = isset($markup['image-without-caption-html'])? $markup['image-without-caption-html'] :'';
|
261 |
+
$returnHtml = str_replace('{{main_images}}', $amp_images[$key] , $returnHtml);
|
262 |
+
}
|
263 |
+
|
264 |
+
$images[$key] = apply_filters('amp_gallery_images', $returnHtml, $image, $markup);
|
265 |
+
}// foreach Closed
|
266 |
+
|
267 |
+
//replacements
|
268 |
+
$r = rand(1,100);
|
269 |
+
$amp_carousel = AMP_HTML_Utils::build_tag(
|
270 |
+
'amp-carousel',
|
271 |
+
array(
|
272 |
+
'width' => $this->args['width'],
|
273 |
+
'height' => $this->args['height'],
|
274 |
+
'type' => 'slides',
|
275 |
+
'layout' => 'responsive',
|
276 |
+
'class' => 'collapsible-captions',
|
277 |
+
'id' => 'carousel-with-carousel-preview-'.$r
|
278 |
+
),
|
279 |
+
implode( PHP_EOL, $images ));
|
280 |
+
|
281 |
+
$amp_carousel_with_thumbnail_nav = apply_filters('amp_thumbnail_images', $amp_images_small, $r, $markup);
|
282 |
+
$amp_carousel_thumbnail ='';
|
283 |
+
if(!empty($amp_carousel_with_thumbnail_nav)){
|
284 |
+
$amp_carousel_thumbnail = AMP_HTML_Utils::build_tag(
|
285 |
+
'amp-carousel',
|
286 |
+
array(
|
287 |
+
'width' => 'auto',
|
288 |
+
'height' => 48,
|
289 |
+
'type' => 'carousel',
|
290 |
+
'layout' => 'fixed-height',
|
291 |
+
'class' => 'carousel-preview'
|
292 |
+
),
|
293 |
+
implode( PHP_EOL, $amp_carousel_with_thumbnail_nav ));
|
294 |
+
|
295 |
+
}
|
296 |
+
$amp_carousel_thumbnail = apply_filters('amp_gallery_markup', $amp_carousel_thumbnail);
|
297 |
+
|
298 |
+
$returnCompleteHtml = $markup['main-html'];
|
299 |
+
//last changes
|
300 |
+
$returnCompleteHtml = str_replace('{{with_carousel}}', $amp_carousel, $returnCompleteHtml);
|
301 |
+
$returnCompleteHtml = str_replace('{{with_carousel_thumbnail}}', $amp_carousel_thumbnail, $returnCompleteHtml);
|
302 |
+
$returnCompleteHtml = str_replace('{{amp_image_lightbox}}', $amp_image_lightbox, $returnCompleteHtml);
|
303 |
+
$returnCompleteHtml = str_replace('{{with_images}}', implode( PHP_EOL, $images ), $returnCompleteHtml);
|
304 |
+
return $returnCompleteHtml;
|
305 |
+
}
|
306 |
+
}// Class closed
|
307 |
+
|
308 |
+
// Add Caption in the Gallery Image
|
309 |
+
add_filter('amp_gallery_images','AMPforWP\\AMPVendor\\ampforwp_new_gallery_images', 10, 3);
|
310 |
+
function ampforwp_new_gallery_images($images_markup, $image, $markup_arr){
|
311 |
+
add_action('amp_post_template_css', 'AMPforWP\\AMPVendor\\ampforwp_additional_gallery_style');
|
312 |
+
add_filter('amp_post_template_data','ampforwp_carousel_bind_script');
|
313 |
+
add_action('amp_post_template_css', 'ampforwp_additional_style_carousel_caption');
|
314 |
+
return $images_markup;
|
315 |
+
}
|
316 |
+
|
317 |
+
if( ! function_exists( 'ampforwp_additional_gallery_style' ) ){
|
318 |
+
function ampforwp_additional_gallery_style(){
|
319 |
+
global $redux_builder_amp,$carousel_markup_all;
|
320 |
+
$design_type = '';
|
321 |
+
$design_type = $redux_builder_amp['ampforwp-gallery-design-type'];
|
322 |
+
|
323 |
+
if(isset($design_type) && $design_type!==''){
|
324 |
+
echo $carousel_markup_all[$design_type]['gallery_css'];
|
325 |
+
}
|
326 |
+
}
|
327 |
+
}
|
328 |
+
|
329 |
+
add_filter('amp_thumbnail_images','AMPforWP\\AMPVendor\\ampforwp_new_thumbnail_images',10,3);
|
330 |
+
function ampforwp_new_thumbnail_images($amp_images, $uniqueid, $markup_arr){
|
331 |
+
if(!isset($markup_arr['carousel_with_thumbnail_html'])){return '';}
|
332 |
+
$amp_thumb_image_buttons = '';
|
333 |
+
foreach ($amp_images as $key => $value) {
|
334 |
+
$returnHtml = $markup_arr['carousel_with_thumbnail_html'];
|
335 |
+
$returnHtml = str_replace('{{thumbnail}}', $value , $returnHtml);
|
336 |
+
$returnHtml = str_replace('{{unique_id}}', $uniqueid , $returnHtml);
|
337 |
+
$returnHtml = str_replace('{{unique_index}}', $key , $returnHtml);
|
338 |
+
$amp_thumb_image_buttons[$key] = $returnHtml;
|
339 |
+
}
|
340 |
+
return $amp_thumb_image_buttons;
|
341 |
+
}
|
@@ -6,7 +6,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
6 |
}
|
7 |
use AMPforWP\AMPVendor\AMP_Base_Embed_Handler;
|
8 |
use AMPforWP\AMPVendor\AMP_HTML_Utils;
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
// Much of this class is borrowed from Jetpack embeds
|
12 |
class AMPforWP_YouTube_Embed_Handler extends AMP_Base_Embed_Handler {
|
6 |
}
|
7 |
use AMPforWP\AMPVendor\AMP_Base_Embed_Handler;
|
8 |
use AMPforWP\AMPVendor\AMP_HTML_Utils;
|
9 |
+
$file_path = AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php';
|
10 |
+
if( file_exists($file_path) ){
|
11 |
+
require_once $file_path;
|
12 |
+
}
|
13 |
|
14 |
// Much of this class is borrowed from Jetpack embeds
|
15 |
class AMPforWP_YouTube_Embed_Handler extends AMP_Base_Embed_Handler {
|
@@ -11,6 +11,7 @@ if ( ! is_array($args) ) {
|
|
11 |
}
|
12 |
|
13 |
$avatar = false; //To show author Avater
|
|
|
14 |
$avatar_size = 40;
|
15 |
$author_description = false;
|
16 |
$class = $author_prefix = $author_wrapper_class = '';
|
@@ -28,6 +29,10 @@ if ( function_exists('coauthors_posts_links') ) {
|
|
28 |
}
|
29 |
$author_image_wrapper = '';
|
30 |
|
|
|
|
|
|
|
|
|
31 |
if ( isset($args['avatar']) ) {
|
32 |
$avatar = $args['avatar'];
|
33 |
}
|
@@ -76,19 +81,26 @@ if ( isset($args['show_time']) ) {
|
|
76 |
</div>
|
77 |
<?php } ?>
|
78 |
<?php echo '<div class="author-details '. esc_attr($author_wrapper_class) .'">';
|
79 |
-
if ( true ==
|
80 |
if ( function_exists('coauthors_posts_links') ) {
|
81 |
-
|
82 |
-
|
|
|
|
|
83 |
}
|
84 |
else {
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
}
|
88 |
}
|
89 |
-
else
|
90 |
-
echo '<span class="author-name">' . esc_attr($author_prefix) . esc_html( $author_name ) . '</span>';
|
91 |
-
echo ampforwp_yoast_twitter_handle();
|
92 |
|
93 |
//to show date and time
|
94 |
if ( $show_date || $show_time ) {
|
@@ -102,8 +114,10 @@ if ( isset($args['show_time']) ) {
|
|
102 |
echo '</span>';
|
103 |
}
|
104 |
if ( $author_description ) {
|
105 |
-
|
106 |
-
|
|
|
|
|
107 |
} ?>
|
108 |
</div>
|
109 |
</div>
|
11 |
}
|
12 |
|
13 |
$avatar = false; //To show author Avater
|
14 |
+
$author_pub_name = false; //To show author name
|
15 |
$avatar_size = 40;
|
16 |
$author_description = false;
|
17 |
$class = $author_prefix = $author_wrapper_class = '';
|
29 |
}
|
30 |
$author_image_wrapper = '';
|
31 |
|
32 |
+
if ( isset($args['author_pub_name']) ) {
|
33 |
+
$author_pub_name = $args['author_pub_name'];
|
34 |
+
}
|
35 |
+
|
36 |
if ( isset($args['avatar']) ) {
|
37 |
$avatar = $args['avatar'];
|
38 |
}
|
81 |
</div>
|
82 |
<?php } ?>
|
83 |
<?php echo '<div class="author-details '. esc_attr($author_wrapper_class) .'">';
|
84 |
+
if ( true == ampforwp_get_setting('ampforwp-author-page-url') ){
|
85 |
if ( function_exists('coauthors_posts_links') ) {
|
86 |
+
if( $author_pub_name ){
|
87 |
+
echo '<span class="author-name">' .esc_html($author_prefix) . esc_url($author_link) . ' </span>';
|
88 |
+
echo ampforwp_yoast_twitter_handle();
|
89 |
+
}
|
90 |
}
|
91 |
else {
|
92 |
+
if( $author_pub_name ){
|
93 |
+
echo '<span class="author-name">' .esc_html($author_prefix) . ' <a href="'. esc_url(ampforwp_url_controller($author_link)).'"> ' .esc_html( $author_name ).'</a></span>';
|
94 |
+
echo ampforwp_yoast_twitter_handle();
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
else{
|
99 |
+
if( $author_pub_name ){
|
100 |
+
echo '<span class="author-name">' . esc_html($author_prefix) . esc_html( $author_name ) . '</span>';
|
101 |
+
echo ampforwp_yoast_twitter_handle();
|
102 |
}
|
103 |
}
|
|
|
|
|
|
|
104 |
|
105 |
//to show date and time
|
106 |
if ( $show_date || $show_time ) {
|
114 |
echo '</span>';
|
115 |
}
|
116 |
if ( $author_description ) {
|
117 |
+
if( true == ampforwp_get_setting('amp-author-box-description') ){
|
118 |
+
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
119 |
+
echo "<p>".strip_tags($post_author->description,$allowed_tags)."</p>";
|
120 |
+
}
|
121 |
} ?>
|
122 |
</div>
|
123 |
</div>
|
@@ -12,14 +12,22 @@ function ampforwp_framework_get_categories_list( $separator = '' ){
|
|
12 |
<div class="amp-category">
|
13 |
<span><?php echo esc_html(ampforwp_translation($redux_builder_amp['amp-translator-categories-text'], 'Categories' )); ?></span>
|
14 |
<?php foreach ($ampforwp_categories as $key=>$cat ) {
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
} ?>
|
24 |
</div>
|
25 |
<?php endif;
|
12 |
<div class="amp-category">
|
13 |
<span><?php echo esc_html(ampforwp_translation($redux_builder_amp['amp-translator-categories-text'], 'Categories' )); ?></span>
|
14 |
<?php foreach ($ampforwp_categories as $key=>$cat ) {
|
15 |
+
$term_id = $cat->term_id;
|
16 |
+
$term_name = $cat->name;
|
17 |
+
$term_url = get_category_link( $cat->term_id );
|
18 |
+
if(false == ampforwp_get_setting('ampforwp-cats-tags-links-single')){
|
19 |
+
$term_url = false;
|
20 |
+
}
|
21 |
+
elseif( true == ampforwp_get_setting('ampforwp-archive-support') && true == ampforwp_get_setting('ampforwp-cats-tags-links-single')) {
|
22 |
+
// #934
|
23 |
+
$term_url = ampforwp_url_controller( $term_url );
|
24 |
+
}
|
25 |
+
echo ('<span class="amp-cat amp-cat-'. esc_attr($term_id) . '" >
|
26 |
+
'. (!empty($term_url)? ' <a href="'. esc_url( $term_url) . '" > ':''). esc_html($term_name). (!empty($term_url)? '</a> ':'').' </span>');
|
27 |
+
|
28 |
+
if(!empty($separator) && count($ampforwp_categories)-1 > $key){
|
29 |
+
echo esc_html($separator);
|
30 |
+
}
|
31 |
} ?>
|
32 |
</div>
|
33 |
<?php endif;
|
@@ -492,8 +492,13 @@ function amp_content($post_id= ''){
|
|
492 |
}
|
493 |
}
|
494 |
|
495 |
-
$thisTemplate = $ampforwpTemplate;
|
496 |
-
|
|
|
|
|
|
|
|
|
|
|
497 |
$amp_custom_content_enable = get_post_meta( $thisTemplate->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
|
498 |
// Normal Content
|
499 |
if ( ! $amp_custom_content_enable ) {
|
@@ -677,7 +682,7 @@ function ampforwp_addThis_support(){
|
|
677 |
$data_widget_id = ampforwp_get_setting('add-this-widget-id');
|
678 |
if ( is_single() || (is_page() && ampforwp_get_setting('ampforwp-page-social')) ) {
|
679 |
if( ampforwp_get_setting('enable-add-this-option') ) {
|
680 |
-
if( 4 == ampforwp_get_setting('amp-design-selector')){
|
681 |
$amp_addthis = '<amp-addthis width="290" height="92" data-pub-id="'.esc_html($data_pub_id).'" data-widget-id="'. esc_html($data_widget_id).'"></amp-addthis>';
|
682 |
}
|
683 |
else{
|
492 |
}
|
493 |
}
|
494 |
|
495 |
+
$thisTemplate = $ampforwpTemplate;
|
496 |
+
if ( 1 == ampforwp_get_setting('amp-design-selector') ) {
|
497 |
+
do_action('ampforwp_inside_post_content_before',$thisTemplate);
|
498 |
+
}
|
499 |
+
else{
|
500 |
+
do_action('ampforwp_before_post_content',$thisTemplate);
|
501 |
+
}
|
502 |
$amp_custom_content_enable = get_post_meta( $thisTemplate->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
|
503 |
// Normal Content
|
504 |
if ( ! $amp_custom_content_enable ) {
|
682 |
$data_widget_id = ampforwp_get_setting('add-this-widget-id');
|
683 |
if ( is_single() || (is_page() && ampforwp_get_setting('ampforwp-page-social')) ) {
|
684 |
if( ampforwp_get_setting('enable-add-this-option') ) {
|
685 |
+
if( 4 == ampforwp_get_setting('amp-design-selector') && 'default' == ampforwp_get_setting('swift-add-this-position') ){
|
686 |
$amp_addthis = '<amp-addthis width="290" height="92" data-pub-id="'.esc_html($data_pub_id).'" data-widget-id="'. esc_html($data_widget_id).'"></amp-addthis>';
|
687 |
}
|
688 |
else{
|
@@ -1,37 +1,29 @@
|
|
1 |
<?php
|
2 |
function ampforwp_framework_get_logo(){
|
3 |
global $redux_builder_amp; ?>
|
4 |
-
<div class="amp-logo"
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
}
|
24 |
-
}
|
25 |
-
}
|
26 |
-
$ampforwp_home_url = apply_filters('ampforwp_header_url', $ampforwp_home_url);
|
27 |
-
if ( true == ($redux_builder_amp['opt-media']['url']) ) {
|
28 |
-
$alt = $logo_url = "";
|
29 |
-
$alt = ampforwp_default_logo('alt');
|
30 |
-
$logo_url = __( $redux_builder_amp['opt-media']['url'], 'accelerated-mobile-pages' );
|
31 |
-
?><a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?>><amp-img src="<?php echo esc_url( $logo_url ); ?>" width="<?php echo esc_attr(ampforwp_default_logo('width')); ?>" height="<?php echo esc_attr(ampforwp_default_logo('height')); ?>" alt="<?php echo esc_attr($alt); ?>" class="amp-logo" layout="responsive"></amp-img></a><?php } else { if(is_single()){ ?>
|
32 |
<h2> <?php } else{?><h1><?php }?>
|
33 |
<a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> ><?php bloginfo('name'); ?></a><?php if(is_single()){?></h2><?php } else{?></h1><?php }
|
34 |
-
}
|
|
|
35 |
<?php }
|
36 |
|
37 |
add_action('amp_post_template_css','amp_framework_logo_styles',11);
|
1 |
<?php
|
2 |
function ampforwp_framework_get_logo(){
|
3 |
global $redux_builder_amp; ?>
|
4 |
+
<div class="amp-logo">
|
5 |
+
<?php
|
6 |
+
do_action('amp_header_top');
|
7 |
+
$set_rel_to_noamp = false;
|
8 |
+
$ampforwp_home_url = user_trailingslashit( get_bloginfo('url') );
|
9 |
+
if ( true == ampforwp_get_setting('ampforwp-homepage-on-off-support') && !ampforwp_get_setting('amp-on-off-support-for-non-amp-home-page') ) {
|
10 |
+
$ampforwp_home_url = ampforwp_url_controller( get_bloginfo('url') );
|
11 |
+
}
|
12 |
+
if ( ampforwp_get_setting('amp-on-off-support-for-non-amp-home-page') && ampforwp_get_setting('amp-mobile-redirection') ) {
|
13 |
+
$ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
|
14 |
+
$set_rel_to_noamp = true;
|
15 |
+
}
|
16 |
+
$ampforwp_home_url = apply_filters('ampforwp_header_url', $ampforwp_home_url); ?>
|
17 |
+
<?php if ( true == ($redux_builder_amp['opt-media']['url']) ) {
|
18 |
+
$alt = ampforwp_default_logo('alt');
|
19 |
+
$logo_url = __( $redux_builder_amp['opt-media']['url'], 'accelerated-mobile-pages' ); ?>
|
20 |
+
<a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
|
21 |
+
<amp-img src="<?php echo esc_url( $logo_url ); ?>" width="<?php echo esc_attr(ampforwp_default_logo('width')); ?>" height="<?php echo esc_attr(ampforwp_default_logo('height')); ?>" alt="<?php echo esc_attr($alt); ?>" class="amp-logo" layout="responsive"></amp-img></a>
|
22 |
+
<?php } else { if(is_single()){ ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
<h2> <?php } else{?><h1><?php }?>
|
24 |
<a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> ><?php bloginfo('name'); ?></a><?php if(is_single()){?></h2><?php } else{?></h1><?php }
|
25 |
+
} ?>
|
26 |
+
</div>
|
27 |
<?php }
|
28 |
|
29 |
add_action('amp_post_template_css','amp_framework_logo_styles',11);
|
@@ -346,16 +346,22 @@ function amp_loop_all_content($tag = 'p'){
|
|
346 |
echo ('<'.$tag.'>'. $fullContent .'</'.$tag.'>');
|
347 |
}
|
348 |
|
349 |
-
function amp_loop_permalink($return
|
350 |
-
|
351 |
-
|
352 |
-
return ampforwp_url_controller( get_permalink() ) ;
|
353 |
}
|
354 |
-
|
355 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
}
|
357 |
-
else
|
358 |
-
echo ampforwp_url_controller( get_permalink() );
|
359 |
}
|
360 |
function amp_loop_image( $data=array() ) {
|
361 |
global $ampLoopData, $counterOffset, $redux_builder_amp;
|
346 |
echo ('<'.$tag.'>'. $fullContent .'</'.$tag.'>');
|
347 |
}
|
348 |
|
349 |
+
function amp_loop_permalink($return = ''){
|
350 |
+
if (is_single() && ampforwp_get_setting('ampforwp-single-related-posts-link')) {
|
351 |
+
return get_permalink();
|
|
|
352 |
}
|
353 |
+
return ampforwp_url_controller( get_permalink() ) ;
|
354 |
+
}
|
355 |
+
|
356 |
+
if (! function_exists('amp_loop_get_permalink')){
|
357 |
+
function amp_loop_get_permalink(){
|
358 |
+
return amp_loop_permalink();
|
359 |
+
}
|
360 |
+
}
|
361 |
+
if (! function_exists('amp_loop_the_permalink')){
|
362 |
+
function amp_loop_the_permalink(){
|
363 |
+
echo amp_loop_get_permalink();
|
364 |
}
|
|
|
|
|
365 |
}
|
366 |
function amp_loop_image( $data=array() ) {
|
367 |
global $ampLoopData, $counterOffset, $redux_builder_amp;
|
@@ -117,7 +117,7 @@ function ampforwp_related_post(){
|
|
117 |
function ampforwp_get_relatedpost_image( $imagetype ='thumbnail', $data=array() ){
|
118 |
global $redux_builder_amp;
|
119 |
$related_post_permalink = ampforwp_url_controller( get_permalink() );
|
120 |
-
if (
|
121 |
$related_post_permalink = get_permalink();
|
122 |
}
|
123 |
$show_image = (isset($data['show_image']) ? $data['show_image'] : true);
|
117 |
function ampforwp_get_relatedpost_image( $imagetype ='thumbnail', $data=array() ){
|
118 |
global $redux_builder_amp;
|
119 |
$related_post_permalink = ampforwp_url_controller( get_permalink() );
|
120 |
+
if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
|
121 |
$related_post_permalink = get_permalink();
|
122 |
}
|
123 |
$show_image = (isset($data['show_image']) ? $data['show_image'] : true);
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
3 |
+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
4 |
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
5 |
+
width="16.000000pt" height="16.000000pt" viewBox="0 0 16.000000 16.000000"
|
6 |
+
preserveAspectRatio="xMidYMid meet">
|
7 |
+
|
8 |
+
<g transform="translate(0.000000,16.000000) scale(0.100000,-0.100000)"
|
9 |
+
fill="#000000" stroke="none">
|
10 |
+
<path d="M0 85 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
|
11 |
+
-7 -15 -15z"/>
|
12 |
+
<path d="M50 85 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
|
13 |
+
-7 -15 -15z"/>
|
14 |
+
<path d="M90 85 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0 -15
|
15 |
+
-7 -15 -15z"/>
|
16 |
+
<path d="M130 85 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
|
17 |
+
-15 -7 -15 -15z"/>
|
18 |
+
</g>
|
19 |
+
</svg>
|
@@ -4,7 +4,7 @@ add_action('amp_post_template_footer','ampforwp_analytics',11);
|
|
4 |
function ampforwp_analytics() {
|
5 |
// 10.1 Analytics Support added for Google Analytics
|
6 |
global $redux_builder_amp;
|
7 |
-
if ( true == ampforwp_get_setting('ampforwp-ga-switch')){
|
8 |
$ga_fields = array();
|
9 |
$ampforwp_ga_fields = array();
|
10 |
$ga_account = '';
|
4 |
function ampforwp_analytics() {
|
5 |
// 10.1 Analytics Support added for Google Analytics
|
6 |
global $redux_builder_amp;
|
7 |
+
if ( true == ampforwp_get_setting('ampforwp-ga-switch') && false == ampforwp_get_setting('amp-use-gtm-option') ){
|
8 |
$ga_fields = array();
|
9 |
$ampforwp_ga_fields = array();
|
10 |
$ga_account = '';
|
@@ -90,7 +90,7 @@
|
|
90 |
$structured_data_image = __($redux_builder_amp['amp-structured-data-placeholder-image']['url'], 'accelerated-mobile-pages');
|
91 |
$structured_data_height = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-height'));
|
92 |
$structured_data_width = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-width'));
|
93 |
-
$structured_data_archive_title =
|
94 |
$structured_data_author = get_userdata( 1 );
|
95 |
if ( $structured_data_author ) {
|
96 |
$structured_data_author = $structured_data_author->display_name ;
|
@@ -291,7 +291,12 @@ function ampforwp_structured_data_type( $metadata ) {
|
|
291 |
if(isset($metadata['@type']) && $metadata['@type']){
|
292 |
$metadata['@type'] = $set_sd_page;
|
293 |
}
|
294 |
-
}
|
|
|
|
|
|
|
|
|
|
|
295 |
if(isset($metadata['@type']) && $metadata['@type'] == 'NewsArticle'){
|
296 |
$post_id = ampforwp_get_the_ID();
|
297 |
$description=addslashes( wp_trim_words( strip_tags( get_post_field('post_content', $post_id) ) , 15 ) );
|
90 |
$structured_data_image = __($redux_builder_amp['amp-structured-data-placeholder-image']['url'], 'accelerated-mobile-pages');
|
91 |
$structured_data_height = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-height'));
|
92 |
$structured_data_width = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-width'));
|
93 |
+
$structured_data_archive_title = esc_html(get_the_archive_title());
|
94 |
$structured_data_author = get_userdata( 1 );
|
95 |
if ( $structured_data_author ) {
|
96 |
$structured_data_author = $structured_data_author->display_name ;
|
291 |
if(isset($metadata['@type']) && $metadata['@type']){
|
292 |
$metadata['@type'] = $set_sd_page;
|
293 |
}
|
294 |
+
}
|
295 |
+
if(is_archive()){
|
296 |
+
if(isset($metadata['@type']) && $metadata['@type']){
|
297 |
+
$metadata['@type'] = 'CollectionPage';
|
298 |
+
}
|
299 |
+
}
|
300 |
if(isset($metadata['@type']) && $metadata['@type'] == 'NewsArticle'){
|
301 |
$post_id = ampforwp_get_the_ID();
|
302 |
$description=addslashes( wp_trim_words( strip_tags( get_post_field('post_content', $post_id) ) , 15 ) );
|
@@ -16,6 +16,7 @@ require_once AMPFORWP_PLUGIN_DIR."includes/features/contact-form/contact-form-op
|
|
16 |
// Option name where all the Redux data is stored.
|
17 |
$opt_name = "redux_builder_amp";
|
18 |
$comment_desc = "";
|
|
|
19 |
$amptfad = '<strong>DID YOU KNOW?</strong></br ><a href="https://ampforwp.com/amp-theme-framework/" target="_blank">You can create your own <strong>Custom theme with AMP Theme Framework</strong></a>';
|
20 |
// #1093 Display only If AMP Comments is Not Installed
|
21 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
@@ -182,7 +183,6 @@ $extension_listing_array = array(
|
|
182 |
'item_name'=>'WP Forms for AMP',
|
183 |
'store_url'=>'https://accounts.ampforwp.com',
|
184 |
'is_activated'=>(is_plugin_active('wp-forms-for-amp/amp-wpforms.php')? 1 : 2),
|
185 |
-
'settingUrl'=>'{ampforwp-wpf-subsection}',
|
186 |
),
|
187 |
array(
|
188 |
'name'=>'Email Opt-in Forms',
|
@@ -1816,7 +1816,8 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1816 |
'class' => 'child_opt child_opt_arrow',
|
1817 |
'id' => 'ampforwp-number-of-fb-no-of-comments',
|
1818 |
'type' => 'text',
|
1819 |
-
'tooltip-subtitle' =>
|
|
|
1820 |
'title' => esc_html__('No of Comments', 'accelerated-mobile-pages'),
|
1821 |
'default' => 10,
|
1822 |
'required' => array(
|
@@ -3225,6 +3226,25 @@ Redux::setSection( $opt_name, array(
|
|
3225 |
);
|
3226 |
$amp_fontparts = array_merge($amp_fontparts ,$fonts_settings);
|
3227 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3228 |
$global_settings = array(
|
3229 |
array(
|
3230 |
'id' => 'general_sdbar',
|
@@ -3307,14 +3327,7 @@ Redux::setSection( $opt_name, array(
|
|
3307 |
'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a>', esc_html__('Read more about it here:', 'accelerated-mobile-pages'), esc_url('https://www.ampproject.org/docs/reference/components/amp-next-page'), esc_html__('amp-next-page','accelerated-mobile-pages')),
|
3308 |
'default' => false,
|
3309 |
),
|
3310 |
-
|
3311 |
-
'id' => 'ampforwp-infinite-scroll-home',
|
3312 |
-
'type' => 'switch',
|
3313 |
-
'class' => 'child_opt child_opt_arrow',
|
3314 |
-
'title' => esc_html__('Home & Archives', 'accelerated-mobile-pages'),
|
3315 |
-
'default' => true,
|
3316 |
-
'required' => array( 'ampforwp-infinite-scroll', '=' , 1 )
|
3317 |
-
),
|
3318 |
array(
|
3319 |
'id' => 'ampforwp-infinite-scroll-single',
|
3320 |
'type' => 'switch',
|
@@ -4385,7 +4398,27 @@ $single_page_options = array(
|
|
4385 |
'type' => 'switch',
|
4386 |
'default' => '0',
|
4387 |
'title' => esc_html__('Dropcap', 'accelerated-mobile-pages'),
|
4388 |
-
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4389 |
//Breadcrumb ON/OFF
|
4390 |
array(
|
4391 |
'id' => 'ampforwp-bread-crumb',
|
@@ -4429,7 +4462,6 @@ $single_page_options = array(
|
|
4429 |
'type' => 'switch',
|
4430 |
'default' => '1',
|
4431 |
'title' => esc_html__('Categories & Tags Links', 'accelerated-mobile-pages'),
|
4432 |
-
'required' => array('ampforwp-archive-support', '=' , '1'),
|
4433 |
),
|
4434 |
// Social Icons ON/OFF
|
4435 |
array(
|
@@ -4453,21 +4485,56 @@ $single_page_options = array(
|
|
4453 |
'title' => esc_html__('Next-Previous Links', 'accelerated-mobile-pages'),
|
4454 |
'default' => 1,
|
4455 |
),
|
4456 |
-
|
4457 |
array(
|
4458 |
'id' => 'amp-author-name',
|
4459 |
'type' => 'switch',
|
4460 |
'title' => esc_html__( 'Author Name', 'accelerated-mobile-pages' ),
|
4461 |
'default' => '1',
|
4462 |
-
'required' => array(
|
|
|
|
|
4463 |
),
|
4464 |
-
|
4465 |
array(
|
4466 |
'id' => 'amp-author-description',
|
4467 |
'type' => 'switch',
|
4468 |
'title' => esc_html__( 'Author Bio', 'accelerated-mobile-pages' ),
|
4469 |
'default' => '1',
|
4470 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4471 |
// Pagination //#1015
|
4472 |
array(
|
4473 |
'id' => 'amp-pagination',
|
@@ -4678,13 +4745,6 @@ $single_page_options = array(
|
|
4678 |
'layout_type' => 'accordion',
|
4679 |
'accordion-open'=> 0,
|
4680 |
),
|
4681 |
-
// Author Pages
|
4682 |
-
array(
|
4683 |
-
'id' => 'ampforwp-author-page-url',
|
4684 |
-
'type' => 'switch',
|
4685 |
-
'title' => esc_html__( 'Link to Author Pages', 'accelerated-mobile-pages' ),
|
4686 |
-
'default' => '0',
|
4687 |
-
),
|
4688 |
array(
|
4689 |
'id' => 'ampforwp-swift-recent-posts',
|
4690 |
'type' => 'switch',
|
@@ -5260,6 +5320,13 @@ else{
|
|
5260 |
'tooltip-subtitle' => esc_html__('Enable Featured Image on Pages.'),
|
5261 |
'required' => array('amp-design-selector','=','4'),
|
5262 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5263 |
array(
|
5264 |
'id' => 'meta_page',
|
5265 |
'type' => 'switch',
|
@@ -5305,46 +5372,76 @@ else{
|
|
5305 |
'indent' => true,
|
5306 |
'layout_type' => 'accordion',
|
5307 |
'accordion-open'=> 1,
|
5308 |
-
|
5309 |
|
5310 |
-
|
5311 |
'id' => 'enable-add-this-option',
|
5312 |
'type' => 'switch',
|
5313 |
-
'title' => esc_html__('
|
5314 |
-
'
|
5315 |
'default' => false,
|
5316 |
-
|
5317 |
-
|
5318 |
'id' => 'swift-add-this-position',
|
5319 |
'type' => 'select',
|
5320 |
'title' => esc_html__( 'Position', 'accelerated-mobile-pages' ),
|
5321 |
-
'options' => array(
|
5322 |
-
'default'
|
5323 |
'above-content' => 'Above Content',
|
5324 |
'below-content' => 'Below Content'
|
5325 |
),
|
5326 |
'default' => 'default',
|
5327 |
'required' => array(
|
5328 |
array('amp-design-selector', '=', '4'),
|
5329 |
-
array('enable-add-this-option', '=', '1')
|
5330 |
-
|
5331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5332 |
'id' => 'add-this-pub-id',
|
5333 |
-
'title' => esc_html__('
|
5334 |
'type' => 'text',
|
5335 |
'required' => array('enable-add-this-option', '=' , '1'),
|
5336 |
-
'
|
5337 |
-
|
5338 |
-
|
5339 |
-
array(
|
5340 |
'id' => 'add-this-widget-id',
|
5341 |
-
'title' => esc_html__('
|
5342 |
'type' => 'text',
|
5343 |
'required' => array('enable-add-this-option', '=' , '1'),
|
5344 |
-
'
|
5345 |
-
|
5346 |
-
),
|
5347 |
-
|
5348 |
//End AddThis Support
|
5349 |
array(
|
5350 |
'id' => 'social-shre',
|
@@ -5554,6 +5651,13 @@ else{
|
|
5554 |
array('amp-design-selector', '=' , '4')
|
5555 |
),
|
5556 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5557 |
array(
|
5558 |
'id' => 'social-prfl',
|
5559 |
'type' => 'section',
|
16 |
// Option name where all the Redux data is stored.
|
17 |
$opt_name = "redux_builder_amp";
|
18 |
$comment_desc = "";
|
19 |
+
$newspaper_theme_check = array();
|
20 |
$amptfad = '<strong>DID YOU KNOW?</strong></br ><a href="https://ampforwp.com/amp-theme-framework/" target="_blank">You can create your own <strong>Custom theme with AMP Theme Framework</strong></a>';
|
21 |
// #1093 Display only If AMP Comments is Not Installed
|
22 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
183 |
'item_name'=>'WP Forms for AMP',
|
184 |
'store_url'=>'https://accounts.ampforwp.com',
|
185 |
'is_activated'=>(is_plugin_active('wp-forms-for-amp/amp-wpforms.php')? 1 : 2),
|
|
|
186 |
),
|
187 |
array(
|
188 |
'name'=>'Email Opt-in Forms',
|
1816 |
'class' => 'child_opt child_opt_arrow',
|
1817 |
'id' => 'ampforwp-number-of-fb-no-of-comments',
|
1818 |
'type' => 'text',
|
1819 |
+
'tooltip-subtitle' =>
|
1820 |
+
sprintf('%s <a href="https://developers.facebook.com/docs/plugins/comments" target="_blank">%s</a>.',esc_html__( 'Enter the number of comments to show, Currently Facebook SDK limits this to max 100. For details, see the','accelerated-mobile-pages' ),esc_html__('Facebook comments documentation','accelerated-mobile-pages') ),
|
1821 |
'title' => esc_html__('No of Comments', 'accelerated-mobile-pages'),
|
1822 |
'default' => 10,
|
1823 |
'required' => array(
|
3226 |
);
|
3227 |
$amp_fontparts = array_merge($amp_fontparts ,$fonts_settings);
|
3228 |
}
|
3229 |
+
if( function_exists('ampforwp_custom_theme_files_register') ){
|
3230 |
+
global $redux_builder_amp;
|
3231 |
+
$newspaper_theme_checker = '';
|
3232 |
+
$newspaper_theme_checker = ampforwp_get_setting('ampforwp-infinite-scroll-home');
|
3233 |
+
if($newspaper_theme_checker){
|
3234 |
+
$redux_builder_amp['ampforwp-infinite-scroll-home'] = false;
|
3235 |
+
update_option( 'redux_builder_amp', $redux_builder_amp );
|
3236 |
+
}
|
3237 |
+
}
|
3238 |
+
if( !function_exists('ampforwp_custom_theme_files_register') ){
|
3239 |
+
$newspaper_theme_check = array(
|
3240 |
+
'id' => 'ampforwp-infinite-scroll-home',
|
3241 |
+
'type' => 'switch',
|
3242 |
+
'class' => 'child_opt child_opt_arrow',
|
3243 |
+
'title' => esc_html__('Home & Archives', 'accelerated-mobile-pages'),
|
3244 |
+
'default' => true,
|
3245 |
+
'required' => array( 'ampforwp-infinite-scroll', '=' , 1 )
|
3246 |
+
);
|
3247 |
+
}
|
3248 |
$global_settings = array(
|
3249 |
array(
|
3250 |
'id' => 'general_sdbar',
|
3327 |
'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a>', esc_html__('Read more about it here:', 'accelerated-mobile-pages'), esc_url('https://www.ampproject.org/docs/reference/components/amp-next-page'), esc_html__('amp-next-page','accelerated-mobile-pages')),
|
3328 |
'default' => false,
|
3329 |
),
|
3330 |
+
$newspaper_theme_check,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3331 |
array(
|
3332 |
'id' => 'ampforwp-infinite-scroll-single',
|
3333 |
'type' => 'switch',
|
4398 |
'type' => 'switch',
|
4399 |
'default' => '0',
|
4400 |
'title' => esc_html__('Dropcap', 'accelerated-mobile-pages'),
|
4401 |
+
),
|
4402 |
+
array(
|
4403 |
+
'class' => 'child_opt',
|
4404 |
+
'id' => 'ampforwp-dropcap-font',
|
4405 |
+
'type' => 'text',
|
4406 |
+
'title' => esc_html__('Font Size', 'accelerated-mobile-pages'),
|
4407 |
+
'tooltip-subtitle' => esc_html__('Default font size is 75 pixels', 'accelerated-mobile-pages'),
|
4408 |
+
'default' => '75',
|
4409 |
+
'required'=>array('ampforwp-dropcap','=', '1'),
|
4410 |
+
),
|
4411 |
+
array(
|
4412 |
+
'class' => 'child_opt',
|
4413 |
+
'id' => 'ampforwp-dropcap-color',
|
4414 |
+
'title' => esc_html__('Color', 'accelerated-mobile-pages'),
|
4415 |
+
'tooltip-subtitle' => esc_html__('Choose the color for dropcap','accelerated-mobile-pages'),
|
4416 |
+
'type' => 'color_rgba',
|
4417 |
+
'default' => array(
|
4418 |
+
'color' => '#000',
|
4419 |
+
),
|
4420 |
+
'required'=>array('ampforwp-dropcap','=', '1'),
|
4421 |
+
),
|
4422 |
//Breadcrumb ON/OFF
|
4423 |
array(
|
4424 |
'id' => 'ampforwp-bread-crumb',
|
4462 |
'type' => 'switch',
|
4463 |
'default' => '1',
|
4464 |
'title' => esc_html__('Categories & Tags Links', 'accelerated-mobile-pages'),
|
|
|
4465 |
),
|
4466 |
// Social Icons ON/OFF
|
4467 |
array(
|
4485 |
'title' => esc_html__('Next-Previous Links', 'accelerated-mobile-pages'),
|
4486 |
'default' => 1,
|
4487 |
),
|
4488 |
+
// Author name
|
4489 |
array(
|
4490 |
'id' => 'amp-author-name',
|
4491 |
'type' => 'switch',
|
4492 |
'title' => esc_html__( 'Author Name', 'accelerated-mobile-pages' ),
|
4493 |
'default' => '1',
|
4494 |
+
'required' => array(
|
4495 |
+
array('amp-design-selector' , '=' , '4'),
|
4496 |
+
)
|
4497 |
),
|
4498 |
+
// Author Bio
|
4499 |
array(
|
4500 |
'id' => 'amp-author-description',
|
4501 |
'type' => 'switch',
|
4502 |
'title' => esc_html__( 'Author Bio', 'accelerated-mobile-pages' ),
|
4503 |
'default' => '1',
|
4504 |
),
|
4505 |
+
// Author name
|
4506 |
+
array(
|
4507 |
+
'id' => 'amp-author-bio-name',
|
4508 |
+
'class' => 'child_opt child_opt_arrow',
|
4509 |
+
'type' => 'switch',
|
4510 |
+
'title' => esc_html__( 'Author Bio Name', 'accelerated-mobile-pages' ),
|
4511 |
+
'default' => '1',
|
4512 |
+
'required' => array(
|
4513 |
+
array('amp-design-selector' , '=' , '4'),
|
4514 |
+
array('amp-author-description' , '=' , '1'),
|
4515 |
+
)
|
4516 |
+
),
|
4517 |
+
// Author description
|
4518 |
+
array(
|
4519 |
+
'id' => 'amp-author-box-description',
|
4520 |
+
'class' => 'child_opt child_opt_arrow',
|
4521 |
+
'type' => 'switch',
|
4522 |
+
'title' => esc_html__( 'Author Description', 'accelerated-mobile-pages' ),
|
4523 |
+
'default' => '1',
|
4524 |
+
'required' => array(
|
4525 |
+
array('amp-design-selector' , '=' , '4'),
|
4526 |
+
array('amp-author-description' , '=' , '1'),
|
4527 |
+
)
|
4528 |
+
),
|
4529 |
+
// Author Pages
|
4530 |
+
array(
|
4531 |
+
'id' => 'ampforwp-author-page-url',
|
4532 |
+
'class' => 'child_opt child_opt_arrow',
|
4533 |
+
'type' => 'switch',
|
4534 |
+
'title' => esc_html__( 'Link to Author Pages', 'accelerated-mobile-pages' ),
|
4535 |
+
'default' => '0',
|
4536 |
+
'required' => array('amp-author-description' , '=' , '1'),
|
4537 |
+
),
|
4538 |
// Pagination //#1015
|
4539 |
array(
|
4540 |
'id' => 'amp-pagination',
|
4745 |
'layout_type' => 'accordion',
|
4746 |
'accordion-open'=> 0,
|
4747 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4748 |
array(
|
4749 |
'id' => 'ampforwp-swift-recent-posts',
|
4750 |
'type' => 'switch',
|
5320 |
'tooltip-subtitle' => esc_html__('Enable Featured Image on Pages.'),
|
5321 |
'required' => array('amp-design-selector','=','4'),
|
5322 |
),
|
5323 |
+
array(
|
5324 |
+
'id' => 'ampforwp_pages_breadcrumbs',
|
5325 |
+
'type' => 'switch',
|
5326 |
+
'default' => '0',
|
5327 |
+
'title' => esc_html__('Breadcrumbs', 'accelerated-mobile-pages'),
|
5328 |
+
'tooltip-subtitle' => esc_html__('Enable Breadcrumbs on Pages.','accelerated-mobile-pages'),
|
5329 |
+
),
|
5330 |
array(
|
5331 |
'id' => 'meta_page',
|
5332 |
'type' => 'switch',
|
5372 |
'indent' => true,
|
5373 |
'layout_type' => 'accordion',
|
5374 |
'accordion-open'=> 1,
|
5375 |
+
),
|
5376 |
|
5377 |
+
array(
|
5378 |
'id' => 'enable-add-this-option',
|
5379 |
'type' => 'switch',
|
5380 |
+
'title' => esc_html__('AddThis Sharing', 'accelerated-mobile-pages'),
|
5381 |
+
'tooltip-subtitle' => sprintf('%s <a href="https://www.addthis.com/register" target="_blank">%s</a>, %s <a href="https://www.addthis.com/academy/how-to-customize-your-share-buttons-on-the-amp-for-wp-plugin" target="_blank">%s</a>',esc_html__('You are using the default AddThis share buttons. To customize your share buttons, create a free account at','accelerated-mobile-pages'),esc_html__('AddThis.com','accelerated-mobile-pages'),esc_html__('then activate the Inline Share Buttons. Once your buttons are activated, replace the default Pub ID and Tool ID with your personalized IDs. For instructions, visit','accelerated-mobile-pages'),esc_html__('here','accelerated-mobile-pages')),
|
5382 |
'default' => false,
|
5383 |
+
),
|
5384 |
+
array(
|
5385 |
'id' => 'swift-add-this-position',
|
5386 |
'type' => 'select',
|
5387 |
'title' => esc_html__( 'Position', 'accelerated-mobile-pages' ),
|
5388 |
+
'options' => array(
|
5389 |
+
'default' => 'Single Sidebar (left side)',
|
5390 |
'above-content' => 'Above Content',
|
5391 |
'below-content' => 'Below Content'
|
5392 |
),
|
5393 |
'default' => 'default',
|
5394 |
'required' => array(
|
5395 |
array('amp-design-selector', '=', '4'),
|
5396 |
+
array('enable-add-this-option', '=', '1'),
|
5397 |
+
array('single-design-type', '=', '1'),
|
5398 |
+
)
|
5399 |
+
),
|
5400 |
+
array(
|
5401 |
+
'id' => 'swift-layout-addthis-pos',
|
5402 |
+
'type' => 'select',
|
5403 |
+
'title' => esc_html__( 'Position', 'accelerated-mobile-pages' ),
|
5404 |
+
'options' => array(
|
5405 |
+
'above-content' => 'Above Content',
|
5406 |
+
'below-content' => 'Below Content'
|
5407 |
+
),
|
5408 |
+
'default' => 'below-content',
|
5409 |
+
'required' => array(
|
5410 |
+
array('amp-design-selector', '=', '4'),
|
5411 |
+
array('enable-add-this-option', '=', '1'),
|
5412 |
+
array('single-design-type', '!=', '1'),
|
5413 |
+
array('single-design-type', '!=', '6'),
|
5414 |
+
)
|
5415 |
+
),
|
5416 |
+
array(
|
5417 |
+
'id' => 'swift-layout-6-addthis-pos',
|
5418 |
+
'type' => 'select',
|
5419 |
+
'title' => esc_html__( 'Position', 'accelerated-mobile-pages' ),
|
5420 |
+
'options' => array(
|
5421 |
+
'above-content' => 'Above Content',
|
5422 |
+
'below-content' => 'Below Content'
|
5423 |
+
),
|
5424 |
+
'default' => 'above-content',
|
5425 |
+
'required' => array(
|
5426 |
+
array('amp-design-selector', '=', '4'),
|
5427 |
+
array('enable-add-this-option', '=', '1'),
|
5428 |
+
array('single-design-type', '=', '6'),
|
5429 |
+
)
|
5430 |
+
),
|
5431 |
+
array(
|
5432 |
'id' => 'add-this-pub-id',
|
5433 |
+
'title' => esc_html__('Pub ID', 'accelerated-mobile-pages'),
|
5434 |
'type' => 'text',
|
5435 |
'required' => array('enable-add-this-option', '=' , '1'),
|
5436 |
+
'default' => esc_html__('ra-5cc8551aa4f16f5c','accelerated-mobile-pages'),
|
5437 |
+
),
|
5438 |
+
array(
|
|
|
5439 |
'id' => 'add-this-widget-id',
|
5440 |
+
'title' => esc_html__('Tool ID', 'accelerated-mobile-pages'),
|
5441 |
'type' => 'text',
|
5442 |
'required' => array('enable-add-this-option', '=' , '1'),
|
5443 |
+
'default' => esc_html__('cwgj','accelerated-mobile-pages'),
|
5444 |
+
),
|
|
|
|
|
5445 |
//End AddThis Support
|
5446 |
array(
|
5447 |
'id' => 'social-shre',
|
5651 |
array('amp-design-selector', '=' , '4')
|
5652 |
),
|
5653 |
),
|
5654 |
+
// MeWe
|
5655 |
+
array(
|
5656 |
+
'id' => 'enable-single-mewe-share',
|
5657 |
+
'type' => 'switch',
|
5658 |
+
'title' => esc_html__('MeWe', 'accelerated-mobile-pages'),
|
5659 |
+
'default' => 0,
|
5660 |
+
),
|
5661 |
array(
|
5662 |
'id' => 'social-prfl',
|
5663 |
'type' => 'section',
|
@@ -258,7 +258,7 @@ function ampforwp_page_template_redirect() {
|
|
258 |
return;
|
259 |
}
|
260 |
|
261 |
-
if ( $isMobile && 'mobile-on' == $_SESSION['ampforwp_amp_mode'] && 1 == $_GET['nonamp'] ) {
|
262 |
// non mobile session variable creation
|
263 |
session_start();
|
264 |
$_SESSION['ampforwp_mobile'] = 'exit';
|
@@ -272,7 +272,6 @@ function ampforwp_page_template_redirect() {
|
|
272 |
}
|
273 |
// Check if we are on Mobile phones then start redirection process
|
274 |
if ( $redirectToAMP ) {
|
275 |
-
|
276 |
if ( ! isset($_SESSION['ampforwp_amp_mode']) || ! isset($_GET['nonamp']) ) {
|
277 |
|
278 |
$_SESSION['ampforwp_amp_mode'] = 'mobile-on';
|
@@ -327,13 +326,18 @@ function ampforwp_redirect_to_orginal_url(){
|
|
327 |
$go_to_url = remove_query_arg('nonamp', $url);
|
328 |
$go_to_url = explode('/', $go_to_url);
|
329 |
$go_to_url = array_flip($go_to_url);
|
330 |
-
|
|
|
|
|
|
|
|
|
|
|
331 |
$go_to_url = array_flip($go_to_url);
|
332 |
$go_to_url = implode('/', $go_to_url);
|
333 |
|
334 |
wp_safe_redirect( $go_to_url, 301 );
|
335 |
exit;
|
336 |
-
|
337 |
else{
|
338 |
return;
|
339 |
}
|
@@ -346,15 +350,19 @@ function ampforwp_redirect_to_orginal_url(){
|
|
346 |
add_action('template_redirect', 'ampforwp_redirect_proper_qendpoint' );
|
347 |
if ( ! function_exists('ampforwp_redirect_proper_qendpoint') ) {
|
348 |
function ampforwp_redirect_proper_qendpoint($current_url){
|
349 |
-
if ( ampforwp_is_amp_endpoint() && true == ampforwp_get_setting('amp-core-end-point') ){
|
350 |
-
global $wp;
|
351 |
$current_url = $endpoint = $new_url = '';
|
352 |
$current_url = home_url($wp->request);
|
353 |
-
$
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
|
|
|
|
|
|
|
|
|
|
358 |
}
|
359 |
}
|
360 |
}
|
258 |
return;
|
259 |
}
|
260 |
|
261 |
+
if ( $isMobile && isset($_GET['ampforwp_amp_mode']) && 'mobile-on' == $_SESSION['ampforwp_amp_mode'] && ( isset($_GET['nonamp']) && 1 == $_GET['nonamp'] ) ){
|
262 |
// non mobile session variable creation
|
263 |
session_start();
|
264 |
$_SESSION['ampforwp_mobile'] = 'exit';
|
272 |
}
|
273 |
// Check if we are on Mobile phones then start redirection process
|
274 |
if ( $redirectToAMP ) {
|
|
|
275 |
if ( ! isset($_SESSION['ampforwp_amp_mode']) || ! isset($_GET['nonamp']) ) {
|
276 |
|
277 |
$_SESSION['ampforwp_amp_mode'] = 'mobile-on';
|
326 |
$go_to_url = remove_query_arg('nonamp', $url);
|
327 |
$go_to_url = explode('/', $go_to_url);
|
328 |
$go_to_url = array_flip($go_to_url);
|
329 |
+
if( true == ampforwp_get_setting('amp-core-end-point') || isset($go_to_url['?amp']) ){
|
330 |
+
unset($go_to_url['?amp']);
|
331 |
+
}
|
332 |
+
if( isset($go_to_url['amp']) ){
|
333 |
+
unset($go_to_url['amp']);
|
334 |
+
}
|
335 |
$go_to_url = array_flip($go_to_url);
|
336 |
$go_to_url = implode('/', $go_to_url);
|
337 |
|
338 |
wp_safe_redirect( $go_to_url, 301 );
|
339 |
exit;
|
340 |
+
}
|
341 |
else{
|
342 |
return;
|
343 |
}
|
350 |
add_action('template_redirect', 'ampforwp_redirect_proper_qendpoint' );
|
351 |
if ( ! function_exists('ampforwp_redirect_proper_qendpoint') ) {
|
352 |
function ampforwp_redirect_proper_qendpoint($current_url){
|
353 |
+
if ( ampforwp_is_amp_endpoint() && true == ampforwp_get_setting('amp-core-end-point') ){
|
|
|
354 |
$current_url = $endpoint = $new_url = '';
|
355 |
$current_url = home_url($wp->request);
|
356 |
+
$amp = AMPFORWP_AMP_QUERY_VAR;
|
357 |
+
$endpoint = '?'.$amp;
|
358 |
+
$checker = explode('/', $current_url);
|
359 |
+
$amp_check = in_array($amp, $checker);
|
360 |
+
if ( true == $amp_check && $amp == end($checker) ) {
|
361 |
+
$pos = strrpos( $current_url , '/'.$amp);
|
362 |
+
$search_length = strlen('/'.$amp);
|
363 |
+
$new_url = substr_replace( $current_url , $endpoint , $pos , $search_length );
|
364 |
+
wp_safe_redirect( $new_url );
|
365 |
+
exit;
|
366 |
}
|
367 |
}
|
368 |
}
|
@@ -35,6 +35,10 @@ function ampforwp_schema_lazy_load_remover(){
|
|
35 |
if ( function_exists( 'mvp_setup' ) && ampforwp_get_setting('amp-design-selector') != 4 ) {
|
36 |
remove_action( 'amp_post_template_head','ampforwp_add_meta_viewport');
|
37 |
}
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
//Updater to check license
|
@@ -963,3 +967,21 @@ if ( ! function_exists('ampforwp_yoast_twitter_handle') ) {
|
|
963 |
return '';
|
964 |
}
|
965 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
if ( function_exists( 'mvp_setup' ) && ampforwp_get_setting('amp-design-selector') != 4 ) {
|
36 |
remove_action( 'amp_post_template_head','ampforwp_add_meta_viewport');
|
37 |
}
|
38 |
+
//Menu css is not loading when directory plus theme is active. #2963
|
39 |
+
remove_filter('wp_nav_menu_args',array('AitMenu','modify_arguments'),100);
|
40 |
+
// #3124 enfold theme shortcodes removed
|
41 |
+
add_filter('the_content','ampforwp_remove_enfold_theme_shortcodes_tags');
|
42 |
}
|
43 |
|
44 |
//Updater to check license
|
967 |
return '';
|
968 |
}
|
969 |
}
|
970 |
+
// #3124 enfold theme shortcodes removed
|
971 |
+
add_action('init','ampforwp_enfold_theme_compatibility',2);
|
972 |
+
if(!function_exists('ampforwp_enfold_theme_compatibility')){
|
973 |
+
function ampforwp_enfold_theme_compatibility(){
|
974 |
+
$url_path = trim(parse_url(add_query_arg(array()), PHP_URL_PATH),'/' );
|
975 |
+
$explode_path = explode('/', $url_path);
|
976 |
+
if ( AMPFORWP_AMP_QUERY_VAR === end( $explode_path) ) {
|
977 |
+
remove_filter('avia_load_shortcodes','add_shortcode_folder');
|
978 |
+
}
|
979 |
+
}
|
980 |
+
}
|
981 |
+
if(!function_exists('ampforwp_remove_enfold_theme_shortcodes_tags')){
|
982 |
+
function ampforwp_remove_enfold_theme_shortcodes_tags($content){
|
983 |
+
$content = preg_replace('/\[av_(.*?)]/', ' ', $content);
|
984 |
+
$content = preg_replace('/\[\/av_(.*?)]/', ' ', $content);
|
985 |
+
return $content;
|
986 |
+
}
|
987 |
+
}
|
@@ -18,6 +18,8 @@ require_once( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-playbuzz-sani
|
|
18 |
require_once( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-rule-spec.php' );
|
19 |
require_once( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-allowed-tags-generated.php' );
|
20 |
require_once( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php' );
|
|
|
|
|
21 |
|
22 |
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-twitter-embed.php' );
|
23 |
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-youtube-embed.php' );
|
@@ -30,6 +32,7 @@ require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-vimeo-embed.php'
|
|
30 |
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-soundcloud-embed.php' );
|
31 |
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-pinterest-embed.php' );
|
32 |
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-wistia-embed.php' );
|
|
|
33 |
|
34 |
class AMP_Post_Template {
|
35 |
const SITE_ICON_SIZE = 32;
|
@@ -198,8 +201,8 @@ class AMP_Post_Template {
|
|
198 |
'name' => $this->get( 'blog_name' ),
|
199 |
),
|
200 |
'headline' => $post_title,
|
201 |
-
'datePublished' =>
|
202 |
-
'dateModified' =>
|
203 |
'author' => array(
|
204 |
'@type' => 'Person',
|
205 |
'name' => $post_author_name,
|
@@ -262,6 +265,7 @@ class AMP_Post_Template {
|
|
262 |
|
263 |
$amp_content = new AMP_Content( $new_post_content,
|
264 |
apply_filters( 'amp_content_embed_handlers', array(
|
|
|
265 |
'AMP_Twitter_Embed_Handler' => array(),
|
266 |
'AMP_YouTube_Embed_Handler' => array(),
|
267 |
'AMP_DailyMotion_Embed_Handler' => array(),
|
@@ -278,12 +282,14 @@ class AMP_Post_Template {
|
|
278 |
'AMP_Style_Sanitizer' => array(),
|
279 |
'AMP_Blacklist_Sanitizer' => array(),
|
280 |
'AMP_Img_Sanitizer' => array(),
|
|
|
281 |
'AMP_Video_Sanitizer' => array(),
|
282 |
'AMP_Audio_Sanitizer' => array(),
|
283 |
'AMP_Playbuzz_Sanitizer' => array(),
|
284 |
'AMP_Iframe_Sanitizer' => array(
|
285 |
'add_placeholder' => true,
|
286 |
),
|
|
|
287 |
), $this->post ),
|
288 |
array(
|
289 |
'content_max_width' => $this->get( 'content_max_width' ),
|
18 |
require_once( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-rule-spec.php' );
|
19 |
require_once( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-allowed-tags-generated.php' );
|
20 |
require_once( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php' );
|
21 |
+
require_once( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-gallery-block-sanitizer.php' );
|
22 |
+
require_once( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-block-sanitizer.php' );
|
23 |
|
24 |
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-twitter-embed.php' );
|
25 |
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-youtube-embed.php' );
|
32 |
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-soundcloud-embed.php' );
|
33 |
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-pinterest-embed.php' );
|
34 |
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-wistia-embed.php' );
|
35 |
+
require_once( AMP__VENDOR__DIR__ . '/includes/embeds/class-amp-core-block-handler.php' );
|
36 |
|
37 |
class AMP_Post_Template {
|
38 |
const SITE_ICON_SIZE = 32;
|
201 |
'name' => $this->get( 'blog_name' ),
|
202 |
),
|
203 |
'headline' => $post_title,
|
204 |
+
'datePublished' => mysql2date( 'c', $post->post_date_gmt, false ),
|
205 |
+
'dateModified' => mysql2date( 'c', $post->post_modified_gmt, false ),
|
206 |
'author' => array(
|
207 |
'@type' => 'Person',
|
208 |
'name' => $post_author_name,
|
265 |
|
266 |
$amp_content = new AMP_Content( $new_post_content,
|
267 |
apply_filters( 'amp_content_embed_handlers', array(
|
268 |
+
'AMP_Core_Block_Handler' => array(),
|
269 |
'AMP_Twitter_Embed_Handler' => array(),
|
270 |
'AMP_YouTube_Embed_Handler' => array(),
|
271 |
'AMP_DailyMotion_Embed_Handler' => array(),
|
282 |
'AMP_Style_Sanitizer' => array(),
|
283 |
'AMP_Blacklist_Sanitizer' => array(),
|
284 |
'AMP_Img_Sanitizer' => array(),
|
285 |
+
'AMP_Gallery_Block_Sanitizer' => array(),
|
286 |
'AMP_Video_Sanitizer' => array(),
|
287 |
'AMP_Audio_Sanitizer' => array(),
|
288 |
'AMP_Playbuzz_Sanitizer' => array(),
|
289 |
'AMP_Iframe_Sanitizer' => array(
|
290 |
'add_placeholder' => true,
|
291 |
),
|
292 |
+
'AMP_Block_Sanitizer' => array(),
|
293 |
), $this->post ),
|
294 |
array(
|
295 |
'content_max_width' => $this->get( 'content_max_width' ),
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace AMPforWP\AMPVendor;
|
3 |
+
/**
|
4 |
+
* Class AMP_Core_Block_Handler
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class AMP_Core_Block_Handler
|
10 |
+
*
|
11 |
+
* @since 1.0
|
12 |
+
*/
|
13 |
+
class AMP_Core_Block_Handler extends AMP_Base_Embed_Handler {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Original block callback.
|
17 |
+
*
|
18 |
+
* @var array
|
19 |
+
*/
|
20 |
+
public $original_categories_callback;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Block name.
|
24 |
+
*
|
25 |
+
* @var string
|
26 |
+
*/
|
27 |
+
public $block_name = 'core/categories';
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Register embed.
|
31 |
+
*/
|
32 |
+
public function register_embed() {
|
33 |
+
if ( class_exists( 'WP_Block_Type_Registry' ) ) {
|
34 |
+
$registry = \WP_Block_Type_Registry::get_instance();
|
35 |
+
$block = $registry->get_registered( $this->block_name );
|
36 |
+
|
37 |
+
if ( $block ) {
|
38 |
+
$this->original_categories_callback = $block->render_callback;
|
39 |
+
$block->render_callback = array( $this, 'render' );
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Unregister embed.
|
46 |
+
*/
|
47 |
+
public function unregister_embed() {
|
48 |
+
if ( class_exists( 'WP_Block_Type_Registry' ) ) {
|
49 |
+
$registry = \WP_Block_Type_Registry::get_instance();
|
50 |
+
$block = $registry->get_registered( $this->block_name );
|
51 |
+
|
52 |
+
if ( $block && ! empty( $this->original_categories_callback ) ) {
|
53 |
+
$block->render_callback = $this->original_categories_callback;
|
54 |
+
$this->original_categories_callback = null;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Render Gutenberg block. This is essentially the same method as the original.
|
61 |
+
* Difference is excluding the disallowed JS script, adding <form> tags, and using on:change for <select>.
|
62 |
+
*
|
63 |
+
* @param array $attributes Attributes.
|
64 |
+
* @return string Rendered.
|
65 |
+
*/
|
66 |
+
public function render( $attributes ) {
|
67 |
+
static $block_id = 0;
|
68 |
+
$block_id++;
|
69 |
+
|
70 |
+
$align = 'center';
|
71 |
+
if ( isset( $attributes['align'] ) && in_array( $attributes['align'], array( 'left', 'right', 'full' ), true ) ) {
|
72 |
+
$align = $attributes['align'];
|
73 |
+
}
|
74 |
+
|
75 |
+
$args = array(
|
76 |
+
'echo' => false,
|
77 |
+
'hierarchical' => ! empty( $attributes['showHierarchy'] ),
|
78 |
+
'orderby' => 'name',
|
79 |
+
'show_count' => ! empty( $attributes['showPostCounts'] ),
|
80 |
+
'title_li' => '',
|
81 |
+
);
|
82 |
+
|
83 |
+
if ( ! empty( $attributes['displayAsDropdown'] ) ) {
|
84 |
+
$id = 'wp-block-categories-dropdown-' . $block_id;
|
85 |
+
$form_id = $id . '-form';
|
86 |
+
$args['id'] = $id;
|
87 |
+
$args['show_option_none'] = __( 'Select Category', 'amp' );
|
88 |
+
$wrapper_markup = '<div class="%1$s">%2$s</div>';
|
89 |
+
$items_markup = wp_dropdown_categories( $args );
|
90 |
+
$type = 'dropdown';
|
91 |
+
|
92 |
+
$items_markup = preg_replace(
|
93 |
+
'/(?<=<select\b)/',
|
94 |
+
sprintf( ' on="change:%s.submit"', esc_attr( $form_id ) ),
|
95 |
+
$items_markup,
|
96 |
+
1
|
97 |
+
);
|
98 |
+
} else {
|
99 |
+
$wrapper_markup = '<div class="%1$s"><ul>%2$s</ul></div>';
|
100 |
+
$items_markup = wp_list_categories( $args );
|
101 |
+
$type = 'list';
|
102 |
+
}
|
103 |
+
|
104 |
+
$class = "wp-block-categories wp-block-categories-{$type} align{$align}";
|
105 |
+
|
106 |
+
$block_content = sprintf(
|
107 |
+
$wrapper_markup,
|
108 |
+
esc_attr( $class ),
|
109 |
+
$items_markup
|
110 |
+
);
|
111 |
+
|
112 |
+
if ( ! empty( $attributes['displayAsDropdown'] ) ) {
|
113 |
+
$block_content = sprintf( '<form action="%s" method="get" target="_top" id="%s">%s</form>', esc_url( home_url() ), esc_attr( $form_id ), $block_content );
|
114 |
+
}
|
115 |
+
return $block_content;
|
116 |
+
}
|
117 |
+
}
|
@@ -8,6 +8,7 @@ abstract class AMP_Base_Sanitizer {
|
|
8 |
protected $dom;
|
9 |
protected $args;
|
10 |
protected $did_convert_elements = false;
|
|
|
11 |
/**
|
12 |
* The root element used for sanitization. Either html or body.
|
13 |
*
|
@@ -197,4 +198,24 @@ abstract class AMP_Base_Sanitizer {
|
|
197 |
}
|
198 |
}
|
199 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
}
|
8 |
protected $dom;
|
9 |
protected $args;
|
10 |
protected $did_convert_elements = false;
|
11 |
+
const AMP_IMAGE_LIGHTBOX_ID = 'amp-image-lightbox';
|
12 |
/**
|
13 |
* The root element used for sanitization. Either html or body.
|
14 |
*
|
198 |
}
|
199 |
}
|
200 |
}
|
201 |
+
/**
|
202 |
+
* Add <amp-image-lightbox> element to body tag if it doesn't exist yet.
|
203 |
+
*/
|
204 |
+
public function maybe_add_amp_image_lightbox_node() {
|
205 |
+
$nodes = $this->dom->getElementById( self::AMP_IMAGE_LIGHTBOX_ID );
|
206 |
+
if ( null !== $nodes ) {
|
207 |
+
return;
|
208 |
+
}
|
209 |
+
$nodes = $this->dom->getElementsByTagName( 'body' );
|
210 |
+
if ( ! $nodes->length ) {
|
211 |
+
return;
|
212 |
+
}
|
213 |
+
$body_node = $nodes->item( 0 );
|
214 |
+
$amp_image_lightbox = AMP_DOM_Utils::create_node( $this->dom, 'amp-image-lightbox', array(
|
215 |
+
'id' => self::AMP_IMAGE_LIGHTBOX_ID,
|
216 |
+
'layout' => 'nodisplay',
|
217 |
+
'data-close-button-aria-label' => esc_html__( 'Close', 'amp' ),
|
218 |
+
) );
|
219 |
+
$body_node->appendChild( $amp_image_lightbox );
|
220 |
+
}
|
221 |
}
|
@@ -176,9 +176,14 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
|
|
176 |
if ( strpos($href, ' ') ){
|
177 |
$href = esc_url($href);
|
178 |
}
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
|
|
|
|
|
|
|
|
182 |
}
|
183 |
|
184 |
if ( ! in_array( $protocol, $valid_protocols, true ) ) {
|
@@ -220,7 +225,9 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
|
|
220 |
'javascript',
|
221 |
) );
|
222 |
}
|
223 |
-
|
|
|
|
|
224 |
private function get_blacklisted_tags() {
|
225 |
return $this->merge_defaults_with_args( 'add_blacklisted_tags', apply_filters('amp_blacklisted_tags' , array(
|
226 |
'script',
|
176 |
if ( strpos($href, ' ') ){
|
177 |
$href = esc_url($href);
|
178 |
}
|
179 |
+
/* Issue was with multibyte string.
|
180 |
+
* For more info check: https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/2556 and https://github.com/ahmedkaludi/accelerated-mobile-pages/issues/2967
|
181 |
+
*/
|
182 |
+
if( false === $this->contains_any_multibyte($href) ){
|
183 |
+
if ( false === filter_var( $href, FILTER_VALIDATE_URL )
|
184 |
+
&& ! in_array( $protocol, $special_protocols, true ) ) {
|
185 |
+
return false;
|
186 |
+
}
|
187 |
}
|
188 |
|
189 |
if ( ! in_array( $protocol, $valid_protocols, true ) ) {
|
225 |
'javascript',
|
226 |
) );
|
227 |
}
|
228 |
+
private function contains_any_multibyte($string){
|
229 |
+
return !mb_check_encoding($string, 'ASCII') && mb_check_encoding($string, 'UTF-8');
|
230 |
+
}
|
231 |
private function get_blacklisted_tags() {
|
232 |
return $this->merge_defaults_with_args( 'add_blacklisted_tags', apply_filters('amp_blacklisted_tags' , array(
|
233 |
'script',
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace AMPforWP\AMPVendor;
|
3 |
+
/**
|
4 |
+
* Class AMP_Block_Sanitizer.
|
5 |
+
*
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class AMP_Block_Sanitizer
|
10 |
+
*
|
11 |
+
* Modifies elements created as blocks to match the blocks' AMP-specific configuration.
|
12 |
+
*/
|
13 |
+
class AMP_Block_Sanitizer extends AMP_Base_Sanitizer {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Tag.
|
17 |
+
*
|
18 |
+
* @var string Figure tag to identify wrapper around AMP elements.
|
19 |
+
* @since 1.0
|
20 |
+
*/
|
21 |
+
public static $tag = 'figure';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Sanitize the AMP elements contained by <figure> element where necessary.
|
25 |
+
*
|
26 |
+
* @since 0.2
|
27 |
+
*/
|
28 |
+
public function sanitize() {
|
29 |
+
$nodes = $this->dom->getElementsByTagName( self::$tag );
|
30 |
+
$num_nodes = $nodes->length;
|
31 |
+
if ( 0 === $num_nodes ) {
|
32 |
+
return;
|
33 |
+
}
|
34 |
+
|
35 |
+
for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
|
36 |
+
$node = $nodes->item( $i );
|
37 |
+
|
38 |
+
// We're looking for <figure> elements that have one child node only.
|
39 |
+
if ( 1 !== count( $node->childNodes ) ) {
|
40 |
+
continue;
|
41 |
+
}
|
42 |
+
|
43 |
+
$attributes = AMP_DOM_Utils::get_node_attributes_as_assoc_array( $node );
|
44 |
+
|
45 |
+
// We are only looking for <figure> elements which have wp-block-embed as class.
|
46 |
+
if ( ! isset( $attributes['class'] ) || false === strpos( $attributes['class'], 'wp-block-embed' ) ) {
|
47 |
+
continue;
|
48 |
+
}
|
49 |
+
|
50 |
+
// We are looking for <figure> elements with layout attribute only.
|
51 |
+
if (
|
52 |
+
! isset( $attributes['data-amp-layout'] ) &&
|
53 |
+
! isset( $attributes['data-amp-noloading'] ) &&
|
54 |
+
! isset( $attributes['data-amp-lightbox'] )
|
55 |
+
) {
|
56 |
+
continue;
|
57 |
+
}
|
58 |
+
|
59 |
+
$amp_el_found = false;
|
60 |
+
|
61 |
+
foreach ( $node->childNodes as $child_node ) {
|
62 |
+
|
63 |
+
// We are looking for child elements which start with 'amp-'.
|
64 |
+
if ( 0 !== strpos( $child_node->tagName, 'amp-' ) ) {
|
65 |
+
continue;
|
66 |
+
}
|
67 |
+
$amp_el_found = true;
|
68 |
+
|
69 |
+
$this->set_attributes( $child_node, $node, $attributes );
|
70 |
+
}
|
71 |
+
|
72 |
+
if ( false === $amp_el_found ) {
|
73 |
+
continue;
|
74 |
+
}
|
75 |
+
$this->did_convert_elements = true;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Sets necessary attributes to both parent and AMP element node.
|
81 |
+
*
|
82 |
+
* @param DOMNode $node AMP element node.
|
83 |
+
* @param DOMNode $parent_node <figure> node.
|
84 |
+
* @param array $attributes Current attributes of the AMP element.
|
85 |
+
*/
|
86 |
+
protected function set_attributes( $node, $parent_node, $attributes ) {
|
87 |
+
|
88 |
+
if ( isset( $attributes['data-amp-layout'] ) ) {
|
89 |
+
$node->setAttribute( 'layout', $attributes['data-amp-layout'] );
|
90 |
+
}
|
91 |
+
if ( isset( $attributes['data-amp-noloading'] ) && true === filter_var( $attributes['data-amp-noloading'], FILTER_VALIDATE_BOOLEAN ) ) {
|
92 |
+
$node->setAttribute( 'noloading', '' );
|
93 |
+
}
|
94 |
+
|
95 |
+
$layout = $node->getAttribute( 'layout' );
|
96 |
+
|
97 |
+
// The width has to be unset / auto in case of fixed-height.
|
98 |
+
if ( 'fixed-height' === $layout ) {
|
99 |
+
if ( ! isset( $attributes['height'] ) ) {
|
100 |
+
$node->setAttribute( 'height', self::FALLBACK_HEIGHT );
|
101 |
+
}
|
102 |
+
$node->setAttribute( 'width', 'auto' );
|
103 |
+
|
104 |
+
$height = $node->getAttribute( 'height' );
|
105 |
+
if ( is_numeric( $height ) ) {
|
106 |
+
$height .= 'px';
|
107 |
+
}
|
108 |
+
$parent_node->setAttribute( 'style', "height: $height; width: auto;" );
|
109 |
+
|
110 |
+
// The parent element should have width/height set and position set in case of 'fill'.
|
111 |
+
} elseif ( 'fill' === $layout ) {
|
112 |
+
if ( ! isset( $attributes['height'] ) ) {
|
113 |
+
$attributes['height'] = self::FALLBACK_HEIGHT;
|
114 |
+
}
|
115 |
+
$parent_node->setAttribute( 'style', 'position:relative; width: 100%; height: ' . $attributes['height'] . 'px;' );
|
116 |
+
$node->removeAttribute( 'width' );
|
117 |
+
$node->removeAttribute( 'height' );
|
118 |
+
} elseif ( 'responsive' === $layout ) {
|
119 |
+
$parent_node->setAttribute( 'style', 'position:relative; width: 100%; height: auto' );
|
120 |
+
} elseif ( 'fixed' === $layout ) {
|
121 |
+
if ( ! isset( $attributes['height'] ) ) {
|
122 |
+
$node->setAttribute( 'height', self::FALLBACK_HEIGHT );
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
// Set the fallback layout in case needed.
|
127 |
+
$attributes = AMP_DOM_Utils::get_node_attributes_as_assoc_array( $node );
|
128 |
+
$attributes = $this->set_layout( $attributes );
|
129 |
+
if ( $layout !== $attributes['layout'] ) {
|
130 |
+
$node->setAttribute( 'layout', $attributes['layout'] );
|
131 |
+
}
|
132 |
+
}
|
133 |
+
}
|
@@ -0,0 +1,366 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace AMPforWP\AMPVendor;
|
3 |
+
require_once( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-base-sanitizer.php' );
|
4 |
+
/**
|
5 |
+
* Class AMP_Gallery_Block_Sanitizer.
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class AMP_Gallery_Block_Sanitizer
|
11 |
+
*
|
12 |
+
* Modifies gallery block to match the block's AMP-specific configuration.
|
13 |
+
*/
|
14 |
+
class AMP_Gallery_Block_Sanitizer extends AMP_Base_Sanitizer {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Value used for width of amp-carousel.
|
18 |
+
*
|
19 |
+
* @since 1.0
|
20 |
+
*
|
21 |
+
* @const int
|
22 |
+
*/
|
23 |
+
const FALLBACK_WIDTH = 600;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Value used for height of amp-carousel.
|
27 |
+
*
|
28 |
+
* @since 1.0
|
29 |
+
*
|
30 |
+
* @const int
|
31 |
+
*/
|
32 |
+
const FALLBACK_HEIGHT = 480;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Tag.
|
36 |
+
*
|
37 |
+
* @var string Ul tag to identify wrapper around gallery block.
|
38 |
+
* @since 1.0
|
39 |
+
*/
|
40 |
+
public static $tag = 'ul';
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Array of flags used to control sanitization.
|
44 |
+
*
|
45 |
+
* @var array {
|
46 |
+
* @type int $content_max_width Max width of content.
|
47 |
+
* @type bool $carousel_required Whether carousels are required. This is used when amp theme support is not present, for back-compat.
|
48 |
+
* }
|
49 |
+
*/
|
50 |
+
protected $args;
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Default args.
|
54 |
+
*
|
55 |
+
* @var array
|
56 |
+
*/
|
57 |
+
protected $DEFAULT_ARGS = array(
|
58 |
+
'carousel_required' => true,
|
59 |
+
);
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Sanitize the gallery block contained by <ul> element where necessary.
|
63 |
+
*
|
64 |
+
* @since 0.2
|
65 |
+
*/
|
66 |
+
public function sanitize() {
|
67 |
+
$nodes = $this->dom->getElementsByTagName( self::$tag );
|
68 |
+
$num_nodes = $nodes->length;
|
69 |
+
if ( 0 === $num_nodes ) {
|
70 |
+
return;
|
71 |
+
}
|
72 |
+
|
73 |
+
for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
|
74 |
+
$node = $nodes->item( $i );
|
75 |
+
|
76 |
+
// We're looking for <ul> elements that at least one child.
|
77 |
+
if ( 0 === count( $node->childNodes ) ) {
|
78 |
+
continue;
|
79 |
+
}
|
80 |
+
|
81 |
+
$attributes = AMP_DOM_Utils::get_node_attributes_as_assoc_array( $node );
|
82 |
+
if ( !isset($attributes['class']) || ( isset($attributes['class']) && ! preg_match('/wp-block-gallery/', $attributes['class']) ) ) {
|
83 |
+
continue;
|
84 |
+
}
|
85 |
+
$is_amp_lightbox = isset( $attributes['data-amp-lightbox'] ) && true === filter_var( $attributes['data-amp-lightbox'], FILTER_VALIDATE_BOOLEAN );
|
86 |
+
$is_amp_carousel = ! empty( $this->args['carousel_required'] ) || ( isset( $attributes['data-amp-carousel'] ) && true === filter_var( $attributes['data-amp-carousel'], FILTER_VALIDATE_BOOLEAN ) );
|
87 |
+
|
88 |
+
// We are only looking for <ul> elements which have amp-carousel / amp-lightbox true.
|
89 |
+
if ( ! $is_amp_carousel && ! $is_amp_lightbox ) {
|
90 |
+
continue;
|
91 |
+
}
|
92 |
+
|
93 |
+
// If lightbox is set, we should add lightbox feature to the gallery images.
|
94 |
+
if ( $is_amp_lightbox ) {
|
95 |
+
$this->add_lightbox_attributes_to_image_nodes( $node );
|
96 |
+
$this->maybe_add_amp_image_lightbox_node();
|
97 |
+
}
|
98 |
+
|
99 |
+
// If amp-carousel is not set, nothing else to do here.
|
100 |
+
if ( ! $is_amp_carousel ) {
|
101 |
+
continue;
|
102 |
+
}
|
103 |
+
|
104 |
+
$images = array();
|
105 |
+
$urls = array();
|
106 |
+
// If it's not AMP lightbox, look for links first.
|
107 |
+
if ( ! $is_amp_lightbox ) {
|
108 |
+
foreach ( $node->getElementsByTagName( 'a' ) as $element ) {
|
109 |
+
$images[] = $element;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
// If not linking to anything then look for <amp-img>.
|
113 |
+
if ( empty( $images ) ) {
|
114 |
+
foreach ( $node->getElementsByTagName( 'amp-img' ) as $element ) {
|
115 |
+
$url = $element->getAttribute('src');
|
116 |
+
$width = $element->getAttribute('width');
|
117 |
+
$height = $element->getAttribute('height');
|
118 |
+
$attachment_id = attachment_url_to_postid($url);
|
119 |
+
$images[] = $element;
|
120 |
+
$urls[] = apply_filters('amp_gallery_image_params', array(
|
121 |
+
'url' => $url,
|
122 |
+
'width' => $width,
|
123 |
+
'height' => $height,
|
124 |
+
),$attachment_id);
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
// Skip if no images found.
|
129 |
+
if ( empty( $images ) ) {
|
130 |
+
continue;
|
131 |
+
}
|
132 |
+
$amp_carousel_node = $this->render( array(
|
133 |
+
'images' => $urls,
|
134 |
+
), $node );
|
135 |
+
|
136 |
+
$node->parentNode->replaceChild( $amp_carousel_node, $node );
|
137 |
+
}
|
138 |
+
$this->did_convert_elements = true;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Get carousel height by containing images.
|
143 |
+
*
|
144 |
+
* @param DOMElement $element The UL element.
|
145 |
+
* @return int Height.
|
146 |
+
*/
|
147 |
+
protected function get_carousel_height( $element ) {
|
148 |
+
$images = $element->getElementsByTagName( 'amp-img' );
|
149 |
+
$num_images = $images->length;
|
150 |
+
$max_height = 0;
|
151 |
+
$max_width = 0;
|
152 |
+
if ( 0 === $num_images ) {
|
153 |
+
return self::FALLBACK_HEIGHT;
|
154 |
+
}
|
155 |
+
foreach ( $images as $image ) {
|
156 |
+
/**
|
157 |
+
* Image.
|
158 |
+
*
|
159 |
+
* @var DOMElement $image
|
160 |
+
*/
|
161 |
+
$image_height = $image->getAttribute( 'height' );
|
162 |
+
if ( is_numeric( $image_height ) ) {
|
163 |
+
$max_height = max( $max_height, $image_height );
|
164 |
+
}
|
165 |
+
$image_width = $image->getAttribute( 'height' );
|
166 |
+
if ( is_numeric( $image_width ) ) {
|
167 |
+
$max_width = max( $max_width, $image_width );
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
if ( ! empty( $this->args['content_max_width'] ) && $max_height > 0 && $max_width > $this->args['content_max_width'] ) {
|
172 |
+
$max_height = ( $max_width * $this->args['content_max_width'] ) / $max_height;
|
173 |
+
}
|
174 |
+
|
175 |
+
return ! $max_height ? self::FALLBACK_HEIGHT : $max_height;
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Set lightbox related attributes to <amp-img> within gallery.
|
180 |
+
*
|
181 |
+
* @param DOMElement $element The UL element.
|
182 |
+
*/
|
183 |
+
protected function add_lightbox_attributes_to_image_nodes( $element ) {
|
184 |
+
$images = $element->getElementsByTagName( 'amp-img' );
|
185 |
+
$num_images = $images->length;
|
186 |
+
if ( 0 === $num_images ) {
|
187 |
+
return;
|
188 |
+
}
|
189 |
+
$attributes = array(
|
190 |
+
'data-amp-lightbox' => '',
|
191 |
+
'on' => 'tap:' . self::AMP_IMAGE_LIGHTBOX_ID,
|
192 |
+
'role' => 'button',
|
193 |
+
'tabindex' => 0,
|
194 |
+
);
|
195 |
+
|
196 |
+
for ( $j = $num_images - 1; $j >= 0; $j-- ) {
|
197 |
+
$image_node = $images->item( $j );
|
198 |
+
foreach ( $attributes as $att => $value ) {
|
199 |
+
$image_node->setAttribute( $att, $value );
|
200 |
+
}
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
public function render( $args, $node ) {
|
205 |
+
global $redux_builder_amp,$carousel_styling;
|
206 |
+
$this->did_convert_elements = true;
|
207 |
+
|
208 |
+
$args = wp_parse_args( $args, array(
|
209 |
+
'images' => false,
|
210 |
+
) );
|
211 |
+
|
212 |
+
if ( empty( $args['images'] ) ) {
|
213 |
+
return '';
|
214 |
+
}
|
215 |
+
|
216 |
+
/*Filter*/
|
217 |
+
$carousel_markup = $amp_image_lightbox = '';
|
218 |
+
$carousel_styling = '';
|
219 |
+
//Default markup
|
220 |
+
$markup = 1;
|
221 |
+
if ( ampforwp_get_setting('ampforwp-gallery-design-type') ) {
|
222 |
+
$markup = ampforwp_get_setting('ampforwp-gallery-design-type');
|
223 |
+
}
|
224 |
+
|
225 |
+
$amp_images = array();
|
226 |
+
foreach ( $args['images'] as $key => $image ) {
|
227 |
+
$amp_img_arr = array(
|
228 |
+
'src' => $image['url'],
|
229 |
+
'width' => $image['width'],
|
230 |
+
'height' => $image['height'],
|
231 |
+
'layout' => 'fill',
|
232 |
+
'class' => 'amp-carousel-img',
|
233 |
+
);
|
234 |
+
if( 3 == ampforwp_get_setting('ampforwp-gallery-design-type') || true == ampforwp_get_setting('ampforwp-gallery-lightbox') ){
|
235 |
+
$design3_additional_attr = array('on'=> 'tap:gallery-lightbox', 'role'=>'button',
|
236 |
+
'tabindex'=>$key);
|
237 |
+
$amp_img_arr = array_merge($amp_img_arr, $design3_additional_attr);
|
238 |
+
$amp_image_lightbox = true;
|
239 |
+
}
|
240 |
+
$amp_image_node = AMP_DOM_Utils::create_node( $this->dom, 'amp-img', $amp_img_arr );
|
241 |
+
$amp_images[$key] = $amp_image_node;
|
242 |
+
if ( 3 != ampforwp_get_setting('ampforwp-gallery-design-type') ) {
|
243 |
+
$image_div = AMP_DOM_Utils::create_node( $this->dom, 'div', array('class'=>'ampforwp-gallery-item amp-carousel-container') );
|
244 |
+
$image_div->appendChild($amp_image_node);
|
245 |
+
if ( isset($image['caption']) ) {
|
246 |
+
$figure_node = AMP_DOM_Utils::create_node($this->dom, 'figure', array());
|
247 |
+
$fig_caption = AMP_DOM_Utils::create_node($this->dom, 'figcaption', array('on'=>"tap:AMP.setState({expanded: !expanded})",'tabindex'=>0,'role'=>'button'));
|
248 |
+
$fig_caption->nodeValue = $image['caption'];
|
249 |
+
$figure_node->appendChild($image_div);
|
250 |
+
$figure_node->appendChild($fig_caption);
|
251 |
+
$amp_images[$key] = $figure_node;
|
252 |
+
}
|
253 |
+
else
|
254 |
+
$amp_images[$key] = $image_div;
|
255 |
+
}
|
256 |
+
|
257 |
+
if ( 2 == ampforwp_get_setting('ampforwp-gallery-design-type') ) {
|
258 |
+
//Small Thumbnail Images
|
259 |
+
$thumb_url = ampforwp_aq_resize( $image['url'], 120, 60, true, false ); //resize & crop the image
|
260 |
+
if($thumb_url!=false){
|
261 |
+
$smallimage = $thumb_url[0];
|
262 |
+
$smallwidth = $thumb_url[1];
|
263 |
+
$smallheight = $thumb_url[2];
|
264 |
+
}else{
|
265 |
+
$smallimage = $image['url'];
|
266 |
+
$smallwidth = $image['width'];
|
267 |
+
$smallheight = $image['height'];
|
268 |
+
}
|
269 |
+
|
270 |
+
$amp_images_small[$key] = AMP_DOM_Utils::create_node(
|
271 |
+
$this->dom,
|
272 |
+
'amp-img',
|
273 |
+
array(
|
274 |
+
'src' => $smallimage,
|
275 |
+
'width' => $smallwidth,
|
276 |
+
'height' => $smallheight,
|
277 |
+
'layout' => 'fill',
|
278 |
+
'class' => 'amp-carousel-img',
|
279 |
+
)
|
280 |
+
);
|
281 |
+
|
282 |
+
}
|
283 |
+
|
284 |
+
}// foreach Closed
|
285 |
+
|
286 |
+
//replacements
|
287 |
+
$r = rand(1,100);
|
288 |
+
if ( 3 != ampforwp_get_setting('ampforwp-gallery-design-type') ){
|
289 |
+
$amp_carousel = AMP_DOM_Utils::create_node($this->dom,
|
290 |
+
'amp-carousel',
|
291 |
+
array(
|
292 |
+
'width' => 600,
|
293 |
+
'height' => 480,
|
294 |
+
'type' => 'slides',
|
295 |
+
'layout' => 'responsive',
|
296 |
+
'class' => 'collapsible-captions',
|
297 |
+
'id' => 'carousel-with-carousel-preview-'.$r
|
298 |
+
)
|
299 |
+
);
|
300 |
+
foreach ($amp_images as $amp_image) {
|
301 |
+
$amp_carousel->appendChild( $amp_image );
|
302 |
+
}
|
303 |
+
}
|
304 |
+
|
305 |
+
if ( 2 == ampforwp_get_setting('ampforwp-gallery-design-type') ) {
|
306 |
+
$button_nodes = array();
|
307 |
+
$amp_carousel_thumbnail = AMP_DOM_Utils::create_node(
|
308 |
+
$this->dom,
|
309 |
+
'amp-carousel',
|
310 |
+
array(
|
311 |
+
'width' => 'auto',
|
312 |
+
'height' => 48,
|
313 |
+
'type' => 'carousel',
|
314 |
+
'layout' => 'fixed-height',
|
315 |
+
'class' => 'carousel-preview'
|
316 |
+
)
|
317 |
+
);
|
318 |
+
foreach ($amp_images_small as $key => $value) {
|
319 |
+
$button_node = AMP_DOM_Utils::create_node(
|
320 |
+
$this->dom,
|
321 |
+
'button',
|
322 |
+
array(
|
323 |
+
'on'=>'tap:carousel-with-carousel-preview-'.$r.'.goToSlide(index='.$key.')',
|
324 |
+
'class'=>'amp-carousel-slide amp-scrollable-carousel-slide')
|
325 |
+
);
|
326 |
+
$button_node->appendChild($value);
|
327 |
+
$amp_carousel_thumbnail->appendChild($button_node);
|
328 |
+
}
|
329 |
+
$node->parentNode->insertBefore($amp_carousel_thumbnail,$node->nextSibling);
|
330 |
+
add_action('amp_post_template_css', 'AMPforWP\\AMPVendor\\ampforwp_gal_des_2');
|
331 |
+
}
|
332 |
+
|
333 |
+
elseif ( 3 == ampforwp_get_setting('ampforwp-gallery-design-type') ) {
|
334 |
+
$gal_div = AMP_DOM_Utils::create_node($this->dom, 'div', array('class'=>'gal_w') );
|
335 |
+
foreach ($amp_images as $amp_image) {
|
336 |
+
$gal_div->appendChild( $amp_image );
|
337 |
+
}
|
338 |
+
$amp_carousel = $gal_div;
|
339 |
+
add_action('amp_post_template_css', 'AMPforWP\\AMPVendor\\ampforwp_gal_des_3');
|
340 |
+
}
|
341 |
+
if ( $amp_image_lightbox ) {
|
342 |
+
add_action('ampforwp_after_post_content', 'AMPforWP\\AMPVendor\\ampforwp_gallery_lightbox');
|
343 |
+
}
|
344 |
+
add_filter('amp_post_template_data','ampforwp_carousel_bind_script');
|
345 |
+
add_action('amp_post_template_css', 'ampforwp_additional_style_carousel_caption');
|
346 |
+
return $amp_carousel;
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
function ampforwp_gal_des_2(){
|
351 |
+
echo ".carousel-preview button{padding:0;}.carousel-preview amp-img{height:40px;width:60px;position:relative;}.carousel-preview {width: 100%;display: inline-block;text-align: center;margin: 20px 0px;}";
|
352 |
+
}
|
353 |
+
function ampforwp_gal_des_3(){
|
354 |
+
echo '.gal_w{display:inline-block;width:100%}.gal_w amp-img{background:#f1f1f1;height:134px;width:150px;position: relative;float:left;margin:10px;}.cls-btn{background:#0d0d0d;border:none;position: absolute;right: 10px;}.cls-btn:after{content:"X";display:inline-block;color:#fff;font-size:20px;padding:20px;}';
|
355 |
+
}
|
356 |
+
function ampforwp_gallery_lightbox(){
|
357 |
+
$amp_image_lightbox = '';
|
358 |
+
$amp_image_lightbox = '<amp-image-lightbox id="gallery-lightbox" layout="nodisplay">
|
359 |
+
<div on="tap:gallery-lightbox.close" role="button"
|
360 |
+
tabindex="0">
|
361 |
+
<button class="cls-btn" on="tap:gallery-lightbox.close"
|
362 |
+
role="button" tabindex="0"></button>
|
363 |
+
</div>
|
364 |
+
</amp-image-lightbox>';
|
365 |
+
echo $amp_image_lightbox;
|
366 |
+
}
|
@@ -214,7 +214,9 @@ class AMP_Tag_And_Attribute_Sanitizer extends AMP_Base_Sanitizer {
|
|
214 |
$version
|
215 |
);
|
216 |
}
|
217 |
-
|
|
|
|
|
218 |
remove_filter('the_content', 'wpautop');
|
219 |
}
|
220 |
return $scriptArray;
|
214 |
$version
|
215 |
);
|
216 |
}
|
217 |
+
$checking_scripts = array("amp-carousel","amp-accordion");
|
218 |
+
$script_intersect = array_intersect($checking_scripts,$scriptArray);
|
219 |
+
if(count($script_intersect)>0){
|
220 |
remove_filter('the_content', 'wpautop');
|
221 |
}
|
222 |
return $scriptArray;
|
@@ -69,4 +69,6 @@ Reason: To extend the functionality of sidebars and Pagebuilder
|
|
69 |
42. AMP_Content_Sanitizer updated #2287
|
70 |
43. CSS syntax error in tag 'style amp-custom' - bad url #2974
|
71 |
44. Updated Schema for author image #2919
|
72 |
-
45. class-amp-iframe-sanitizer.php updated #2836
|
|
|
|
69 |
42. AMP_Content_Sanitizer updated #2287
|
70 |
43. CSS syntax error in tag 'style amp-custom' - bad url #2974
|
71 |
44. Updated Schema for author image #2919
|
72 |
+
45. class-amp-iframe-sanitizer.php updated #2836
|
73 |
+
45. Class-amp-gallery-block-sanitizer file Updated for new Gallery Designs #2868
|
74 |
+
45. Added class-amp-gallery-block-sanitizer.php, class-amp-block-sanitizer.php in Vendor AMP Sanitizers and class-amp-core-block-handler.php in Vendor AMP Embed Handlers #2427
|
@@ -230,7 +230,11 @@ function ampforwp_pb_cats(){
|
|
230 |
$post = $_POST['selected_val'];
|
231 |
$taxs = get_object_taxonomies( $post );
|
232 |
if(!empty($taxs)){
|
233 |
-
$cats = get_terms($taxs
|
|
|
|
|
|
|
|
|
234 |
}
|
235 |
$return = array();
|
236 |
if($cats){
|
230 |
$post = $_POST['selected_val'];
|
231 |
$taxs = get_object_taxonomies( $post );
|
232 |
if(!empty($taxs)){
|
233 |
+
$cats = get_terms($taxs['0'],array(
|
234 |
+
'orderby' => 'name',
|
235 |
+
'order' => 'ASC',
|
236 |
+
'number' => 500
|
237 |
+
) );
|
238 |
}
|
239 |
$return = array();
|
240 |
if($cats){
|
@@ -843,10 +843,11 @@ function ampforwp_rowData($container,$col,$moduleTemplate){
|
|
843 |
$fieldValues[$field['name']]= $contentArray[$field['name']];
|
844 |
}
|
845 |
}
|
846 |
-
|
847 |
$args = array(
|
848 |
//'cat' => $fieldValues['category_selection'],
|
849 |
'posts_per_page' => $fieldValues['show_total_posts'],
|
|
|
850 |
'has_password' => false,
|
851 |
'post_status'=> 'publish',
|
852 |
'post_type' => $fieldValues['post_type_selection']
|
843 |
$fieldValues[$field['name']]= $contentArray[$field['name']];
|
844 |
}
|
845 |
}
|
846 |
+
$posts_offset = (integer) $fieldValues['posts_offset'];
|
847 |
$args = array(
|
848 |
//'cat' => $fieldValues['category_selection'],
|
849 |
'posts_per_page' => $fieldValues['show_total_posts'],
|
850 |
+
'offset' => $posts_offset,
|
851 |
'has_password' => false,
|
852 |
'post_status'=> 'publish',
|
853 |
'post_type' => $fieldValues['post_type_selection']
|
@@ -1,16 +1,6 @@
|
|
1 |
<?php
|
2 |
// Exit if accessed directly.
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
-
add_filter( 'amp_post_template_data', 'ampforwp_framework_pagebuilder_accordions_scripts' );
|
5 |
-
function ampforwp_framework_pagebuilder_accordions_scripts( $data ) {
|
6 |
-
|
7 |
-
if ( empty( $data['amp_component_scripts']['amp-accordion'] ) ) {
|
8 |
-
$data['amp_component_scripts']['amp-accordion'] = 'https://cdn.ampproject.org/v0/amp-accordion-0.1.js';
|
9 |
-
}
|
10 |
-
|
11 |
-
|
12 |
-
return $data;
|
13 |
-
}
|
14 |
$output =
|
15 |
'<amp-accordion {{if_id}}id="{{id}}"{{ifend_id}} {{if_user_class}}class="{{user_class}}{{ifend_user_class}}">{{repeater}}</amp-accordion>';
|
16 |
$css = '
|
@@ -71,6 +61,13 @@ return array(
|
|
71 |
),
|
72 |
'content_type'=>'css',
|
73 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
array(
|
75 |
'type' =>'spacing',
|
76 |
'name' =>"padding_css",
|
1 |
<?php
|
2 |
// Exit if accessed directly.
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
$output =
|
5 |
'<amp-accordion {{if_id}}id="{{id}}"{{ifend_id}} {{if_user_class}}class="{{user_class}}{{ifend_user_class}}">{{repeater}}</amp-accordion>';
|
6 |
$css = '
|
61 |
),
|
62 |
'content_type'=>'css',
|
63 |
),
|
64 |
+
array(
|
65 |
+
'type' =>'require_script',
|
66 |
+
'name' =>"accordion_script",
|
67 |
+
'label' =>'amp-accordion',
|
68 |
+
'default' =>'https://cdn.ampproject.org/v0/amp-accordion-0.1.js',
|
69 |
+
'content_type'=>'js',
|
70 |
+
),
|
71 |
array(
|
72 |
'type' =>'spacing',
|
73 |
'name' =>"padding_css",
|
@@ -164,6 +164,14 @@ if ( is_admin() ) {
|
|
164 |
'default' =>'3',
|
165 |
'content_type'=>'html',
|
166 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
array(
|
168 |
'type' =>'select',
|
169 |
'name' =>"ampforwp_show_excerpt",
|
164 |
'default' =>'3',
|
165 |
'content_type'=>'html',
|
166 |
),
|
167 |
+
array(
|
168 |
+
'type' =>'text',
|
169 |
+
'name' =>'posts_offset',
|
170 |
+
'label' => esc_html__('Offset','accelerated-mobile-pages'),
|
171 |
+
'tab' =>'customizer',
|
172 |
+
'default' =>'0',
|
173 |
+
'content_type'=>'html',
|
174 |
+
),
|
175 |
array(
|
176 |
'type' =>'select',
|
177 |
'name' =>"ampforwp_show_excerpt",
|
@@ -3,8 +3,8 @@ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
|
|
3 |
Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 0.9.97.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -32,18 +32,27 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
|
|
32 |
= Features: =
|
33 |
|
34 |
* NEW - Gutenberg Support
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
* NEW - GDPR Compliance
|
36 |
-
*
|
37 |
-
*
|
38 |
-
*
|
39 |
-
*
|
40 |
-
*
|
41 |
-
*
|
42 |
* Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
|
43 |
* AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
|
44 |
* Structured Data Options
|
45 |
* Page Break / NextPage (Pagination) Support
|
46 |
* Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
|
|
|
|
|
|
|
47 |
* Facebook Comments Support
|
48 |
* Github Gist Support
|
49 |
* Email Opt-in Subscription form support in AMP added
|
@@ -74,7 +83,7 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
|
|
74 |
* User Friendly Theme Options Panel.
|
75 |
* Unlimited Color Scheme.
|
76 |
* Image Logo Upload.
|
77 |
-
* Supports Posts and Pages.
|
78 |
* Proper rel canonical tags which means that Google know the original page.
|
79 |
* Overlay Navigation Menu bar.
|
80 |
* Social Sharing in the Single.
|
@@ -106,6 +115,7 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
|
|
106 |
* NEW - Make AMP & Non-AMP Same with just one click!
|
107 |
* NEW - Allows you to use AMP as primary website!
|
108 |
|
|
|
109 |
**[JOIN CHAT GROUP COMMUNITY](https://ampforwp.com/community/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
|
110 |
|
111 |
= Getting Started: =
|
@@ -184,45 +194,46 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
184 |
|
185 |
== Changelog ==
|
186 |
|
187 |
-
= 0.9.97.
|
188 |
-
*
|
189 |
-
|
190 |
-
|
191 |
-
*
|
192 |
-
*
|
193 |
-
|
194 |
-
|
195 |
-
* Added:
|
196 |
-
* Added:
|
197 |
-
* Added:
|
198 |
-
* Added:
|
199 |
-
*
|
200 |
-
* Fixed:
|
201 |
-
* Fixed:
|
202 |
-
* Fixed:
|
203 |
-
* Fixed:
|
204 |
-
* Fixed:
|
205 |
-
* Fixed:
|
206 |
-
* Fixed:
|
207 |
-
* Fixed:
|
208 |
-
* Fixed:
|
209 |
-
* Fixed:
|
210 |
-
* Fixed:
|
211 |
-
* Fixed:
|
212 |
-
* Fixed:
|
213 |
-
* Fixed:
|
214 |
-
* Fixed:
|
215 |
-
* Fixed:
|
216 |
-
* Fixed:
|
217 |
-
* Fixed:
|
218 |
-
* Fixed:
|
219 |
-
* Fixed:
|
220 |
-
* Fixed:
|
221 |
-
* Fixed:
|
222 |
-
* Fixed:
|
223 |
-
* Fixed:
|
224 |
-
* Fixed:
|
225 |
-
* Fixed:
|
226 |
-
* Fixed:
|
|
|
227 |
|
228 |
Full changelog available in changelog.txt
|
3 |
Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 5.2
|
7 |
+
Stable tag: 0.9.97.52
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
32 |
= Features: =
|
33 |
|
34 |
* NEW - Gutenberg Support
|
35 |
+
* NEW - Divi and Elementor Support [More Info](https://ampforwp.com/woocommerce/)
|
36 |
+
* NEW - Addthis Sharing Support
|
37 |
+
* NEW - AMP Infinity Scroll Support
|
38 |
+
* NEW - Revolution Slider plugin Support
|
39 |
+
* NEW - Photo Gallery by 10Web Support
|
40 |
+
* NEW - MEWE social network Support
|
41 |
* NEW - GDPR Compliance
|
42 |
+
* Introducing Page Builder 3.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
|
43 |
+
* New Default Theme for AMP called Swift
|
44 |
+
* 3 Pre-built AMP Layouts for Business websites and landing pages
|
45 |
+
* Alexa Metrics Compatibility added
|
46 |
+
* OneSignal Push Notifications integration
|
47 |
+
* Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
|
48 |
* Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
|
49 |
* AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
|
50 |
* Structured Data Options
|
51 |
* Page Break / NextPage (Pagination) Support
|
52 |
* Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
|
53 |
+
* Graviry Form Support [More Info](https://ampforwp.com/gravity-forms/)
|
54 |
+
* Caldera Form Support [More Info](https://ampforwp.com/caldera-forms-for-amp/)
|
55 |
+
* Ninja Form Support [More Info](https://ampforwp.com/ninja-forms/)
|
56 |
* Facebook Comments Support
|
57 |
* Github Gist Support
|
58 |
* Email Opt-in Subscription form support in AMP added
|
83 |
* User Friendly Theme Options Panel.
|
84 |
* Unlimited Color Scheme.
|
85 |
* Image Logo Upload.
|
86 |
+
* Supports Posts and Pages and other custom post types.
|
87 |
* Proper rel canonical tags which means that Google know the original page.
|
88 |
* Overlay Navigation Menu bar.
|
89 |
* Social Sharing in the Single.
|
115 |
* NEW - Make AMP & Non-AMP Same with just one click!
|
116 |
* NEW - Allows you to use AMP as primary website!
|
117 |
|
118 |
+
|
119 |
**[JOIN CHAT GROUP COMMUNITY](https://ampforwp.com/community/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
|
120 |
|
121 |
= Getting Started: =
|
194 |
|
195 |
== Changelog ==
|
196 |
|
197 |
+
= 0.9.97.52 (15th May 2019) =
|
198 |
+
* Added: Gutenberg Compatibility integrated #2427
|
199 |
+
* Added: Gallery Designs for Gutenberg Gallery #2868
|
200 |
+
* Added: Gutenburg column support in AMP #2847
|
201 |
+
* Added: Addthis Sharing option UX re-structured #3114
|
202 |
+
* Added: Photo Gallery plugin compatibility integrated #1811
|
203 |
+
* Added: Revolution Slider plugin compatibility integrated #1464
|
204 |
+
* Added: Posts offset option on category module in AMP Page Builder #2647
|
205 |
+
* Added: MEWE social network integrated #3020
|
206 |
+
* Added: Font Size and Color options for Dropcap #3010
|
207 |
+
* Added: Breadcrumbs feature for pages #2788
|
208 |
+
* Added: More parameters for ampforwp_get_setting functions #2911
|
209 |
+
* Fixed: Conditions for PageBuilder and Elementor for Page.php in Swift #3097
|
210 |
+
* Fixed: Code updated of Infinite Scroll when AMP Newspaper Theme is active #3031
|
211 |
+
* Fixed: Copy the Content in Custom AMP Editor is not working with Gutenberg #2824
|
212 |
+
* Fixed: If GTM gets enabled after Enabling the Analytics, then both codes load in the frontend #3121
|
213 |
+
* Fixed: P tag is missing when "copy the content" option is used in custom AMP editor #3122
|
214 |
+
* Fixed: When AMP is disabled on Homepagepage ?nonamp=1 redirect to random pages(blog) #2904
|
215 |
+
* Fixed: Issue with post title and "end point to ?amp" conflict #2991
|
216 |
+
* Fixed: Unspecified Type in Structured data for catgories/tags #3071
|
217 |
+
* Fixed: PHP Warning date() expects parameter 2 to be long, string given in #2959
|
218 |
+
* Fixed: Disquss comment is not scrollable in IOS device #2970
|
219 |
+
* Fixed: Vkontakte Share(social icon) does not open in a new tab #3089
|
220 |
+
* Fixed: Condition for requiring a file improved #3080
|
221 |
+
* Fixed: amp_content() used instead of AMP_Post_Template object in Design [ 1,2 and 3 ] #2700
|
222 |
+
* Fixed: Hyperlink in amp pages including emoji not working #2967
|
223 |
+
* Fixed: Unused amp js from amp pages removed #3086
|
224 |
+
* Fixed: "WP Forms for AMP" setting link is incorrect #3060
|
225 |
+
* Fixed: Navigation & alternate menu css is not loading when directory plus theme is active #2963
|
226 |
+
* Fixed: link to non-amp under breadcrumbs when Archives support is off. #2885
|
227 |
+
* Fixed: AddThis is causing validation error after Update - code updated #3068
|
228 |
+
* Fixed: Content not rendering on AMP with the Enfold theme version 4.5.6 #3124
|
229 |
+
* Fixed: Tags are also displaying in category selection in the AMP page builder's category module #3082
|
230 |
+
* Fixed: Author name won´t show if you disable author bio in swift theme #3131
|
231 |
+
* Fixed: Link to non amp feature not works for thumbnail in design one and two #3004
|
232 |
+
* Fixed: Multibyte string links aren't working in AMP Version #2556
|
233 |
+
* Fixed: Leave Comment link Not working with ?amp #3093
|
234 |
+
* Fixed: When Sticky Header is enabled then Jump link's Title is getting hidden under the header #2915
|
235 |
+
* Fixed: Facebook comments not displaying if we add number more than 100 in the number of comments #3032
|
236 |
+
* Fixed: Featured image and link shared on twitter issues #3075
|
237 |
+
* Fixed: Infinity Scroll Option is not working when ?amp option is enabled in version beta #2475
|
238 |
|
239 |
Full changelog available in changelog.txt
|
@@ -6,11 +6,16 @@
|
|
6 |
classes: 'ampforwp-copy-content-button ',
|
7 |
tooltip: 'Visual Editor to AMP Editor',
|
8 |
onclick: function() {
|
|
|
9 |
if(typeof tinymce.editors.content.getContent()!= undefined){
|
10 |
editor.insertContent(tinymce.editors.content.getContent());
|
11 |
}else{
|
12 |
editor.insertContent(document.getElementById('content').value());
|
13 |
}
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
});
|
16 |
});
|
6 |
classes: 'ampforwp-copy-content-button ',
|
7 |
tooltip: 'Visual Editor to AMP Editor',
|
8 |
onclick: function() {
|
9 |
+
if(wp.data === undefined){
|
10 |
if(typeof tinymce.editors.content.getContent()!= undefined){
|
11 |
editor.insertContent(tinymce.editors.content.getContent());
|
12 |
}else{
|
13 |
editor.insertContent(document.getElementById('content').value());
|
14 |
}
|
15 |
+
}else if(wp.data){
|
16 |
+
var editedContent = wp.data.select( "core/editor" ).getEditedPostContent();
|
17 |
+
editor.insertContent(editedContent);
|
18 |
+
}
|
19 |
}
|
20 |
});
|
21 |
});
|
@@ -1,5 +1,5 @@
|
|
1 |
<?php global $redux_builder_amp;
|
2 |
-
if (
|
3 |
$home_non_amp = $archive_non_amp = '';
|
4 |
if ( false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
|
5 |
$home_non_amp = 'nonamp';
|
1 |
<?php global $redux_builder_amp;
|
2 |
+
if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is_page() && ampforwp_get_setting('ampforwp_pages_breadcrumbs')) ) && !checkAMPforPageBuilderStatus(get_the_ID()) ) {
|
3 |
$home_non_amp = $archive_non_amp = '';
|
4 |
if ( false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
|
5 |
$home_non_amp = 'nonamp';
|
@@ -3,44 +3,7 @@
|
|
3 |
|
4 |
<div class="amp-wp-article-content">
|
5 |
<div class="amp-wp-content the_content">
|
6 |
-
<?php
|
7 |
-
do_action('ampforwp_inside_post_content_before',$this);
|
8 |
-
$amp_custom_content_enable = get_post_meta( $this->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
|
9 |
-
|
10 |
-
// Normal Front Page Content
|
11 |
-
if ( ! $amp_custom_content_enable ) {
|
12 |
-
$ampforwp_the_content = $this->get( 'post_amp_content' ); // amphtml content; no kses
|
13 |
-
} else {
|
14 |
-
// Custom/Alternative AMP content added through post meta
|
15 |
-
$ampforwp_the_content = $this->get( 'ampforwp_amp_content' );
|
16 |
-
}
|
17 |
-
// Muffin Builder Compatibility #1455 #1893
|
18 |
-
if ( function_exists('mfn_builder_print') && !$amp_custom_content_enable) {
|
19 |
-
ob_start();
|
20 |
-
mfn_builder_print( get_the_ID() );
|
21 |
-
$content = ob_get_contents();
|
22 |
-
ob_end_clean();
|
23 |
-
$sanitizer_obj = new AMPFORWP_Content( $content,
|
24 |
-
array(),
|
25 |
-
apply_filters( 'ampforwp_content_sanitizers',
|
26 |
-
array( 'AMP_Img_Sanitizer' => array(),
|
27 |
-
'AMP_Blacklist_Sanitizer' => array(),
|
28 |
-
'AMP_Style_Sanitizer' => array(),
|
29 |
-
'AMP_Video_Sanitizer' => array(),
|
30 |
-
'AMP_Audio_Sanitizer' => array(),
|
31 |
-
'AMP_Iframe_Sanitizer' => array(
|
32 |
-
'add_placeholder' => true,
|
33 |
-
),
|
34 |
-
)
|
35 |
-
)
|
36 |
-
);
|
37 |
-
$ampforwp_the_content = $sanitizer_obj->get_amp_content();
|
38 |
-
}
|
39 |
-
|
40 |
-
//Filter to modify the Content
|
41 |
-
$ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
|
42 |
-
echo $ampforwp_the_content; // amphtml content, no kses
|
43 |
-
do_action('ampforwp_after_post_content',$this) ; ?>
|
44 |
</div>
|
45 |
<!--Post Next-Previous Links-->
|
46 |
<?php
|
3 |
|
4 |
<div class="amp-wp-article-content">
|
5 |
<div class="amp-wp-content the_content">
|
6 |
+
<?php amp_content(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
</div>
|
8 |
<!--Post Next-Previous Links-->
|
9 |
<?php
|
@@ -12,11 +12,18 @@
|
|
12 |
<div class="amp-wp-meta amp-wp-tax-category">
|
13 |
<span><?php global $redux_builder_amp; printf(esc_attr( ampforwp_translation($redux_builder_amp['amp-translator-categories-text'], 'Categories:' ) .' ' )); ?></span>
|
14 |
<?php foreach ($ampforwp_categories as $cat ) {
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
} ?>
|
21 |
</div>
|
22 |
<?php endif; } ?>
|
12 |
<div class="amp-wp-meta amp-wp-tax-category">
|
13 |
<span><?php global $redux_builder_amp; printf(esc_attr( ampforwp_translation($redux_builder_amp['amp-translator-categories-text'], 'Categories:' ) .' ' )); ?></span>
|
14 |
<?php foreach ($ampforwp_categories as $cat ) {
|
15 |
+
$term_id = $cat->term_id;
|
16 |
+
$term_name = $cat->name;
|
17 |
+
$term_url = get_category_link( $cat->term_id );
|
18 |
+
if(false == ampforwp_get_setting('ampforwp-cats-tags-links-single')){
|
19 |
+
$term_url = false;
|
20 |
+
}
|
21 |
+
elseif( true == ampforwp_get_setting('ampforwp-archive-support') && true == ampforwp_get_setting('ampforwp-cats-tags-links-single')) {
|
22 |
+
// #934
|
23 |
+
$term_url = ampforwp_url_controller( $term_url );
|
24 |
+
}
|
25 |
+
echo ('<span class="amp-cat amp-cat-'. esc_attr($term_id) . '" >
|
26 |
+
'. (!empty($term_url)? ' <a href="'. esc_url( $term_url) . '" > ':''). esc_html($term_name). (!empty($term_url)? '</a> ':'').' </span>');
|
27 |
} ?>
|
28 |
</div>
|
29 |
<?php endif; } ?>
|
@@ -85,7 +85,7 @@ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_
|
|
85 |
while( $my_query->have_posts() ) {
|
86 |
$my_query->the_post();
|
87 |
$related_post_permalink = ampforwp_url_controller( get_permalink() );
|
88 |
-
if (
|
89 |
$related_post_permalink = get_permalink();
|
90 |
}
|
91 |
?>
|
85 |
while( $my_query->have_posts() ) {
|
86 |
$my_query->the_post();
|
87 |
$related_post_permalink = ampforwp_url_controller( get_permalink() );
|
88 |
+
if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
|
89 |
$related_post_permalink = get_permalink();
|
90 |
}
|
91 |
?>
|
@@ -67,7 +67,7 @@ if ( is_single() || (is_page() && isset($redux_builder_amp['ampforwp-page-social
|
|
67 |
</a>
|
68 |
<?php } ?>
|
69 |
<?php if($redux_builder_amp['enable-single-vk-share'] == true) { ?>
|
70 |
-
<a title="vkontakte share" href="http://vk.com/share.php?url=<?php echo esc_url($amp_permalink); ?>">
|
71 |
<div class="amp-social-icon custom-amp-socialsharing-vk">
|
72 |
<amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvb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uMjU4ICAgYzguMTI3LDEuMzg1LDEwLjM1NCw0Ljg4MSw3Ljg0NCwxMi44MTdjLTMuOTU1LDEyLjQ1MS0xMS42NSwyMi44MjctMTkuMTc0LDMzLjI1MWMtOC4wNDMsMTEuMTI5LTE2LjY0NSwyMS44NzctMjQuNjIxLDMzLjA3MiAgIEMyNTIuMjYsMTYxLjU0NCwyNTIuODQyLDE2Ni42OTcsMjYxLjk0NSwxNzUuNTc2TDI2MS45NDUsMTc1LjU3NnogTTI2MS45NDUsMTc1LjU3NiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
|
73 |
</div>
|
@@ -143,6 +143,13 @@ if ( is_single() || (is_page() && isset($redux_builder_amp['ampforwp-page-social
|
|
143 |
</div>
|
144 |
</a>
|
145 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
</div>
|
147 |
<?php } ?>
|
148 |
|
67 |
</a>
|
68 |
<?php } ?>
|
69 |
<?php if($redux_builder_amp['enable-single-vk-share'] == true) { ?>
|
70 |
+
<a title="vkontakte share" href="http://vk.com/share.php?url=<?php echo esc_url($amp_permalink); ?>" target="_blank">
|
71 |
<div class="amp-social-icon custom-amp-socialsharing-vk">
|
72 |
<amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWls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I3LDEuMzg1LDEwLjM1NCw0Ljg4MSw3Ljg0NCwxMi44MTdjLTMuOTU1LDEyLjQ1MS0xMS42NSwyMi44MjctMTkuMTc0LDMzLjI1MWMtOC4wNDMsMTEuMTI5LTE2LjY0NSwyMS44NzctMjQuNjIxLDMzLjA3MiAgIEMyNTIuMjYsMTYxLjU0NCwyNTIuODQyLDE2Ni42OTcsMjYxLjk0NSwxNzUuNTc2TDI2MS45NDUsMTc1LjU3NnogTTI2MS45NDUsMTc1LjU3NiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
|
73 |
</div>
|
143 |
</div>
|
144 |
</a>
|
145 |
<?php } ?>
|
146 |
+
<?php if ( true == ampforwp_get_setting('enable-single-mewe-share') ) { ?>
|
147 |
+
<a title="mewe share" href="https://mewe.com/share?link=<?php echo esc_url($amp_permalink); ?>" target="_blank">
|
148 |
+
<div class="amp-social-icon amp-social-mewe">
|
149 |
+
<amp-img src="<?php echo esc_url(AMPFORWP_IMAGE_DIR . '/favicon-mewe.svg') ?>" width="50" height="20" />
|
150 |
+
</div>
|
151 |
+
</a>
|
152 |
+
<?php } ?>
|
153 |
</div>
|
154 |
<?php } ?>
|
155 |
|
@@ -57,6 +57,7 @@ use AMPforWP\AMPVendor\AMP_Post_Template;
|
|
57 |
.amp-wp-unknown-size img{ object-fit: contain; }
|
58 |
amp-iframe{ max-width: 100%; margin-bottom : 20px; }
|
59 |
amp-wistia-player {margin:5px 0px;}
|
|
|
60 |
.amp-wp-content,.amp-wp-title-bar div {<?php if ( $content_max_width > 0 ) : ?> margin: 0 auto;max-width: <?php echo esc_attr(sprintf( '%dpx', $content_max_width )); ?>; <?php endif; ?> }
|
61 |
html{background: <?php echo sanitize_hex_color( $header_background_color ); ?>;} body{background: <?php echo sanitize_hex_color( $theme_color ); ?>;color: <?php echo sanitize_hex_color( $text_color ); ?>;font-family: 'Merriweather', 'Times New Roman', Times, Serif;font-weight: 300;line-height: 1.75em;}
|
62 |
p,ol,ul,figure {margin: 0 0 1em;padding: 0;} a,a:visited {color:<?php echo ampforwp_sanitize_color($redux_builder_amp['amp-opt-color-rgba-link-design1']['color']); ?>;}a:hover,a:active,a:focus {color: <?php echo sanitize_hex_color( $text_color ); ?>;} .wp-caption amp-img{max-width: 100%}
|
@@ -84,7 +85,7 @@ blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background:
|
|
84 |
.custom-amp-socialsharing-line{background:#00b900}
|
85 |
<?php } ?>
|
86 |
<?php if ( true == ampforwp_get_setting('enable-single-vk-share') ) { ?>
|
87 |
-
.custom-amp-socialsharing-vk{background:#45668e}
|
88 |
<?php } ?>
|
89 |
<?php if ( true == ampforwp_get_setting('enable-single-odnoklassniki-share') ) { ?>
|
90 |
.amp-social-odnoklassniki{background:#ed812b}
|
@@ -116,6 +117,10 @@ blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background:
|
|
116 |
<?php if ( true == ampforwp_get_setting('enable-single-pocket-share') ) { ?>
|
117 |
.amp-social-pocket{background:#e8e8e8}
|
118 |
<?php } ?>
|
|
|
|
|
|
|
|
|
119 |
.comment-button-wrapper a{border-style:solid;border-color:#c2c2c2;border-width:1px 1px 2px;border-radius:4px;background-color:transparent;color:#0a89c0;cursor:pointer;display:block;font-size:14px;font-weight:600;text-align:center;line-height:18px;margin:0 auto;max-width:200px;padding:11px 16px;text-decoration:none;width:50%;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.close-nav,.comments_list div,.related_posts ol li,.toggle-navigation ul,.toggle-navigationv2 ul li a{display:inline-block}main .amp-wp-content.comments_list{background:0 0;box-shadow:none;max-width:1030px}.comments_list h3{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}.comments_list{margin:2.5em 16px}.comments_list ul{margin:0;padding:0}.comments_list ul.children{padding-bottom:10px;margin-left:4%;width:96%}
|
120 |
|
121 |
|
@@ -129,7 +134,7 @@ amp-sidebar{width:250px}.amp-sidebar-image{line-height:100px;vertical-align:midd
|
|
129 |
.ampforwp-ad-above-related-post{padding-top:15px;}
|
130 |
.single-post .amp_author_area amp-img{ margin: 0; float: left; margin-right: 12px; border-radius: 60px; }
|
131 |
.single-post .amp_author_area .amp_author_area_wrapper{ display: inline-block; width: 100%; line-height: 1.4; margin-top: 22px; font-size: 13px; color:#333; font-family: sans-serif; }
|
132 |
-
.
|
133 |
margin: 0 auto;
|
134 |
}
|
135 |
/* Footer */
|
@@ -246,7 +251,8 @@ amp-carousel{direction: ltr;} .tt-lb{float:right;margin-left:5px;}
|
|
246 |
if ( class_exists('TablePress') ) { ?>
|
247 |
.tablepress-table-description{clear:both;display:block}.tablepress{border-collapse:collapse;border-spacing:0;width:100%;margin-bottom:1em;border:none}.tablepress td,.tablepress th{padding:8px;border:none;background:0 0;text-align:left}.tablepress tbody td{vertical-align:top}.tablepress tbody td,.tablepress tfoot th{border-top:1px solid #ddd}.tablepress tbody tr:first-child td{border-top:0}.tablepress thead th{border-bottom:1px solid #ddd}.tablepress tfoot th,.tablepress thead th{background-color:#d9edf7;font-weight:700;vertical-align:middle}.tablepress .odd td{background-color:#f9f9f9}.tablepress .even td{background-color:#fff}.tablepress .row-hover tr:hover td{background-color:#f3f3f3}@media (min-width:768px) and (max-width:1600px){.tablepress{overflow-x:none}}@media (min-width:320px) and (max-width:767px){.tablepress{display:inline-block;overflow-x:scroll}}
|
248 |
<?php }
|
249 |
-
if( !is_home() && true == ampforwp_get_setting('ampforwp-bread-crumb') && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ) { ?>
|
|
|
250 |
.breadcrumb{line-height: 1; margin: 0.1em 16px 1.5em;}
|
251 |
.breadcrumb ul{padding:0; margin:0;}
|
252 |
.breadcrumb ul li, .breadcrumbs span{display:inline;font-size:12px;}
|
@@ -448,4 +454,13 @@ if(is_singular() || ampforwp_is_front_page()){?>
|
|
448 |
margin:0 auto;
|
449 |
}
|
450 |
}
|
451 |
-
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
.amp-wp-unknown-size img{ object-fit: contain; }
|
58 |
amp-iframe{ max-width: 100%; margin-bottom : 20px; }
|
59 |
amp-wistia-player {margin:5px 0px;}
|
60 |
+
.amp-wp-article amp-addthis{bottom: -38px;}
|
61 |
.amp-wp-content,.amp-wp-title-bar div {<?php if ( $content_max_width > 0 ) : ?> margin: 0 auto;max-width: <?php echo esc_attr(sprintf( '%dpx', $content_max_width )); ?>; <?php endif; ?> }
|
62 |
html{background: <?php echo sanitize_hex_color( $header_background_color ); ?>;} body{background: <?php echo sanitize_hex_color( $theme_color ); ?>;color: <?php echo sanitize_hex_color( $text_color ); ?>;font-family: 'Merriweather', 'Times New Roman', Times, Serif;font-weight: 300;line-height: 1.75em;}
|
63 |
p,ol,ul,figure {margin: 0 0 1em;padding: 0;} a,a:visited {color:<?php echo ampforwp_sanitize_color($redux_builder_amp['amp-opt-color-rgba-link-design1']['color']); ?>;}a:hover,a:active,a:focus {color: <?php echo sanitize_hex_color( $text_color ); ?>;} .wp-caption amp-img{max-width: 100%}
|
85 |
.custom-amp-socialsharing-line{background:#00b900}
|
86 |
<?php } ?>
|
87 |
<?php if ( true == ampforwp_get_setting('enable-single-vk-share') ) { ?>
|
88 |
+
.custom-amp-socialsharing-vk, .amp-social-vk{background:#45668e}
|
89 |
<?php } ?>
|
90 |
<?php if ( true == ampforwp_get_setting('enable-single-odnoklassniki-share') ) { ?>
|
91 |
.amp-social-odnoklassniki{background:#ed812b}
|
117 |
<?php if ( true == ampforwp_get_setting('enable-single-pocket-share') ) { ?>
|
118 |
.amp-social-pocket{background:#e8e8e8}
|
119 |
<?php } ?>
|
120 |
+
<?php if ( true == ampforwp_get_setting('enable-single-mewe-share') ) { ?>
|
121 |
+
.custom-amp-socialsharing-mewe{background:#b8d6e6}
|
122 |
+
.amp-social-mewe{background:#b8d6e6}
|
123 |
+
<?php } ?>
|
124 |
.comment-button-wrapper a{border-style:solid;border-color:#c2c2c2;border-width:1px 1px 2px;border-radius:4px;background-color:transparent;color:#0a89c0;cursor:pointer;display:block;font-size:14px;font-weight:600;text-align:center;line-height:18px;margin:0 auto;max-width:200px;padding:11px 16px;text-decoration:none;width:50%;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.close-nav,.comments_list div,.related_posts ol li,.toggle-navigation ul,.toggle-navigationv2 ul li a{display:inline-block}main .amp-wp-content.comments_list{background:0 0;box-shadow:none;max-width:1030px}.comments_list h3{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}.comments_list{margin:2.5em 16px}.comments_list ul{margin:0;padding:0}.comments_list ul.children{padding-bottom:10px;margin-left:4%;width:96%}
|
125 |
|
126 |
|
134 |
.ampforwp-ad-above-related-post{padding-top:15px;}
|
135 |
.single-post .amp_author_area amp-img{ margin: 0; float: left; margin-right: 12px; border-radius: 60px; }
|
136 |
.single-post .amp_author_area .amp_author_area_wrapper{ display: inline-block; width: 100%; line-height: 1.4; margin-top: 22px; font-size: 13px; color:#333; font-family: sans-serif; }
|
137 |
+
figure.aligncenter amp-img {
|
138 |
margin: 0 auto;
|
139 |
}
|
140 |
/* Footer */
|
251 |
if ( class_exists('TablePress') ) { ?>
|
252 |
.tablepress-table-description{clear:both;display:block}.tablepress{border-collapse:collapse;border-spacing:0;width:100%;margin-bottom:1em;border:none}.tablepress td,.tablepress th{padding:8px;border:none;background:0 0;text-align:left}.tablepress tbody td{vertical-align:top}.tablepress tbody td,.tablepress tfoot th{border-top:1px solid #ddd}.tablepress tbody tr:first-child td{border-top:0}.tablepress thead th{border-bottom:1px solid #ddd}.tablepress tfoot th,.tablepress thead th{background-color:#d9edf7;font-weight:700;vertical-align:middle}.tablepress .odd td{background-color:#f9f9f9}.tablepress .even td{background-color:#fff}.tablepress .row-hover tr:hover td{background-color:#f3f3f3}@media (min-width:768px) and (max-width:1600px){.tablepress{overflow-x:none}}@media (min-width:320px) and (max-width:767px){.tablepress{display:inline-block;overflow-x:scroll}}
|
253 |
<?php }
|
254 |
+
if( !is_home() && ( (is_single() && true == ampforwp_get_setting('ampforwp-bread-crumb')) || (is_page() && ampforwp_get_setting('ampforwp_pages_breadcrumbs') ) ) && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ) { ?>
|
255 |
+
.breadcrumb{line-height: 1; margin: 0.1em 16px 1.5em;}
|
256 |
.breadcrumb{line-height: 1; margin: 0.1em 16px 1.5em;}
|
257 |
.breadcrumb ul{padding:0; margin:0;}
|
258 |
.breadcrumb ul li, .breadcrumbs span{display:inline;font-size:12px;}
|
454 |
margin:0 auto;
|
455 |
}
|
456 |
}
|
457 |
+
<?php } ?>
|
458 |
+
@media (min-width: 768px){
|
459 |
+
.wp-block-columns {
|
460 |
+
display:flex;
|
461 |
+
}
|
462 |
+
.wp-block-column {
|
463 |
+
max-width:50%;
|
464 |
+
margin: 0px 10px;
|
465 |
+
}
|
466 |
+
}
|
@@ -1,5 +1,5 @@
|
|
1 |
<?php global $redux_builder_amp;
|
2 |
-
if (
|
3 |
$home_non_amp = $archive_non_amp = '';
|
4 |
if ( false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
|
5 |
$home_non_amp = 'nonamp';
|
1 |
<?php global $redux_builder_amp;
|
2 |
+
if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is_page() && ampforwp_get_setting('ampforwp_pages_breadcrumbs')) ) && !checkAMPforPageBuilderStatus(get_the_ID()) ) {
|
3 |
$home_non_amp = $archive_non_amp = '';
|
4 |
if ( false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
|
5 |
$home_non_amp = 'nonamp';
|
@@ -1,48 +1,7 @@
|
|
1 |
<div class="amp-wp-article-content">
|
2 |
<!--Post Content here-->
|
3 |
<div class="amp-wp-content the_content">
|
4 |
-
<?php
|
5 |
-
do_action('ampforwp_before_post_content',$this) //Post before Content here ?>
|
6 |
-
|
7 |
-
<?php
|
8 |
-
$amp_custom_content_enable = get_post_meta( $this->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
|
9 |
-
|
10 |
-
// Normal Front Page Content
|
11 |
-
if ( ! $amp_custom_content_enable ) {
|
12 |
-
$ampforwp_the_content = $this->get( 'post_amp_content' ); // amphtml content; no kses
|
13 |
-
} else {
|
14 |
-
// Custom/Alternative AMP content added through post meta
|
15 |
-
$ampforwp_the_content = $this->get( 'ampforwp_amp_content' );
|
16 |
-
}
|
17 |
-
// Muffin Builder Compatibility #1455 #1893
|
18 |
-
if ( function_exists('mfn_builder_print') && ! $amp_custom_content_enable ) {
|
19 |
-
ob_start();
|
20 |
-
mfn_builder_print( get_the_ID() );
|
21 |
-
$content = ob_get_contents();
|
22 |
-
ob_end_clean();
|
23 |
-
$sanitizer_obj = new AMPFORWP_Content( $content,
|
24 |
-
array(),
|
25 |
-
apply_filters( 'ampforwp_content_sanitizers',
|
26 |
-
array( 'AMP_Img_Sanitizer' => array(),
|
27 |
-
'AMP_Blacklist_Sanitizer' => array(),
|
28 |
-
'AMP_Style_Sanitizer' => array(),
|
29 |
-
'AMP_Video_Sanitizer' => array(),
|
30 |
-
'AMP_Audio_Sanitizer' => array(),
|
31 |
-
'AMP_Iframe_Sanitizer' => array(
|
32 |
-
'add_placeholder' => true,
|
33 |
-
),
|
34 |
-
)
|
35 |
-
)
|
36 |
-
);
|
37 |
-
$ampforwp_the_content = $sanitizer_obj->get_amp_content();
|
38 |
-
}
|
39 |
-
|
40 |
-
//Filter to modify the Content
|
41 |
-
$ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
|
42 |
-
echo $ampforwp_the_content;// amphtml content, no kses
|
43 |
-
do_action('ampforwp_after_post_content',$this) ; //Post After Content here
|
44 |
-
?>
|
45 |
-
|
46 |
</div>
|
47 |
<!--Post Content Ends here-->
|
48 |
|
1 |
<div class="amp-wp-article-content">
|
2 |
<!--Post Content here-->
|
3 |
<div class="amp-wp-content the_content">
|
4 |
+
<?php amp_content(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
</div>
|
6 |
<!--Post Content Ends here-->
|
7 |
|
@@ -31,11 +31,18 @@ if( isset($redux_builder_amp['ampforwp-cats-single']) && $redux_builder_amp['amp
|
|
31 |
<?php printf( esc_attr(ampforwp_translation($redux_builder_amp['amp-translator-categories-text'], 'Categories:' )). ' ');?>
|
32 |
</span>
|
33 |
<?php foreach ($ampforwp_categories as $cat ) {
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
|
31 |
<?php printf( esc_attr(ampforwp_translation($redux_builder_amp['amp-translator-categories-text'], 'Categories:' )). ' ');?>
|
32 |
</span>
|
33 |
<?php foreach ($ampforwp_categories as $cat ) {
|
34 |
+
$term_id = $cat->term_id;
|
35 |
+
$term_name = $cat->name;
|
36 |
+
$term_url = get_category_link( $cat->term_id );
|
37 |
+
if(false == ampforwp_get_setting('ampforwp-cats-tags-links-single')){
|
38 |
+
$term_url = false;
|
39 |
+
}
|
40 |
+
elseif( true == ampforwp_get_setting('ampforwp-archive-support') && true == ampforwp_get_setting('ampforwp-cats-tags-links-single')) {
|
41 |
+
// #934
|
42 |
+
$term_url = ampforwp_url_controller( $term_url );
|
43 |
+
}
|
44 |
+
echo ('<span class="amp-cat amp-cat-'. esc_attr($term_id) . '" >
|
45 |
+
'. (!empty($term_url)? ' <a href="'. esc_url( $term_url) . '" > ':''). esc_html($term_name). (!empty($term_url)? '</a> ':'').' </span>');
|
46 |
}
|
47 |
|
48 |
|
@@ -85,9 +85,9 @@ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_
|
|
85 |
while( $my_query->have_posts() ) {
|
86 |
$my_query->the_post();
|
87 |
$related_post_permalink = ampforwp_url_controller( get_permalink() );
|
88 |
-
if (
|
89 |
$related_post_permalink = get_permalink();
|
90 |
-
}?>
|
91 |
<li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
92 |
<?php if ( ampforwp_has_post_thumbnail() ) {
|
93 |
if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) {
|
85 |
while( $my_query->have_posts() ) {
|
86 |
$my_query->the_post();
|
87 |
$related_post_permalink = ampforwp_url_controller( get_permalink() );
|
88 |
+
if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
|
89 |
$related_post_permalink = get_permalink();
|
90 |
+
} ?>
|
91 |
<li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
92 |
<?php if ( ampforwp_has_post_thumbnail() ) {
|
93 |
if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) {
|
@@ -67,7 +67,7 @@ if ( is_single() || (is_page() && isset($redux_builder_amp['ampforwp-page-social
|
|
67 |
</a>
|
68 |
<?php } ?>
|
69 |
<?php if($redux_builder_amp['enable-single-vk-share'] == true) { ?>
|
70 |
-
<a title="vkontakte share" href="http://vk.com/share.php?url=<?php echo esc_url($amp_permalink); ?>">
|
71 |
<div class="amp-social-icon custom-amp-socialsharing-vk">
|
72 |
<amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRv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TcuODcyLDExLjMyOC03Ljc1N2w0OC4yMjksMC4wNDNjMS40MywwLDIuODc3LDAuMDIxLDQuMjYyLDAuMjU4ICAgYzguMTI3LDEuMzg1LDEwLjM1NCw0Ljg4MSw3Ljg0NCwxMi44MTdjLTMuOTU1LDEyLjQ1MS0xMS42NSwyMi44MjctMTkuMTc0LDMzLjI1MWMtOC4wNDMsMTEuMTI5LTE2LjY0NSwyMS44NzctMjQuNjIxLDMzLjA3MiAgIEMyNTIuMjYsMTYxLjU0NCwyNTIuODQyLDE2Ni42OTcsMjYxLjk0NSwxNzUuNTc2TDI2MS45NDUsMTc1LjU3NnogTTI2MS45NDUsMTc1LjU3NiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
|
73 |
</div>
|
@@ -143,6 +143,14 @@ if ( is_single() || (is_page() && isset($redux_builder_amp['ampforwp-page-social
|
|
143 |
</div>
|
144 |
</a>
|
145 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
</div>
|
147 |
<?php } ?>
|
148 |
<?php do_action('ampforwp_after_social_icons_hook',$this);
|
67 |
</a>
|
68 |
<?php } ?>
|
69 |
<?php if($redux_builder_amp['enable-single-vk-share'] == true) { ?>
|
70 |
+
<a title="vkontakte share" href="http://vk.com/share.php?url=<?php echo esc_url($amp_permalink); ?>" target="_blank">
|
71 |
<div class="amp-social-icon custom-amp-socialsharing-vk">
|
72 |
<amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIE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LTUuMjc2LDUuMzg1LTcuODcyLDExLjMyOC03Ljc1N2w0OC4yMjksMC4wNDNjMS40MywwLDIuODc3LDAuMDIxLDQuMjYyLDAuMjU4ICAgYzguMTI3LDEuMzg1LDEwLjM1NCw0Ljg4MSw3Ljg0NCwxMi44MTdjLTMuOTU1LDEyLjQ1MS0xMS42NSwyMi44MjctMTkuMTc0LDMzLjI1MWMtOC4wNDMsMTEuMTI5LTE2LjY0NSwyMS44NzctMjQuNjIxLDMzLjA3MiAgIEMyNTIuMjYsMTYxLjU0NCwyNTIuODQyLDE2Ni42OTcsMjYxLjk0NSwxNzUuNTc2TDI2MS45NDUsMTc1LjU3NnogTTI2MS45NDUsMTc1LjU3NiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
|
73 |
</div>
|
143 |
</div>
|
144 |
</a>
|
145 |
<?php } ?>
|
146 |
+
<?php if ( true == ampforwp_get_setting('enable-single-mewe-share') ) { ?>
|
147 |
+
<a title="mewe share" href="https://mewe.com/share?link=<?php echo esc_url($amp_permalink); ?>" target="_blank">
|
148 |
+
<div class="amp-social-icon amp-social-mewe">
|
149 |
+
<amp-img src="<?php echo esc_url(AMPFORWP_IMAGE_DIR . '/favicon-mewe.svg') ?>" width="50" height="20" />
|
150 |
+
|
151 |
+
</div>
|
152 |
+
</a>
|
153 |
+
<?php } ?>
|
154 |
</div>
|
155 |
<?php } ?>
|
156 |
<?php do_action('ampforwp_after_social_icons_hook',$this);
|
@@ -44,7 +44,7 @@ amp-wistia-player {margin:5px 0px;}
|
|
44 |
margin: 0 auto;
|
45 |
<?php endif; ?>
|
46 |
}
|
47 |
-
.
|
48 |
margin: 0 auto;
|
49 |
}
|
50 |
/* Slide Navigation code */
|
@@ -111,8 +111,12 @@ if(ampforwp_get_setting('enable-single-social-icons') == true && is_single() ||
|
|
111 |
<?php if ( true == ampforwp_get_setting('enable-single-line-share') ) { ?>
|
112 |
.custom-amp-socialsharing-line{background:#00b900}
|
113 |
<?php } ?>
|
|
|
|
|
|
|
|
|
114 |
<?php if ( true == ampforwp_get_setting('enable-single-vk-share') ) { ?>
|
115 |
-
.ampforwp-social-icons custom-amp-socialsharing-vk{background:#45668e}
|
116 |
<?php } ?>
|
117 |
<?php if ( true == ampforwp_get_setting('enable-single-odnoklassniki-share') ) { ?>
|
118 |
.amp-social-odnoklassniki{background:#ed812b}
|
@@ -373,7 +377,7 @@ amp-user-notification button { background-color: <?php echo sanitize_hex_color(
|
|
373 |
@media (min-width: 320px) and (max-width: 767px) {.tablepress { display: inline-block; overflow-x: scroll; } }
|
374 |
<?php } ?>
|
375 |
.design_2_wrapper .amp-loop-list .amp-wp-meta {display: none;}
|
376 |
-
<?php if(!is_home() && true == ampforwp_get_setting('ampforwp-bread-crumb') && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ) { ?>
|
377 |
.breadcrumb{line-height: 1;margin-bottom:6px;}
|
378 |
.breadcrumb ul, .category-single ul{padding:0; margin:0;}
|
379 |
.breadcrumb ul li{display:inline;}
|
@@ -583,4 +587,13 @@ if(is_singular() || ampforwp_is_front_page()){?>
|
|
583 |
margin:0 auto;
|
584 |
}
|
585 |
}
|
586 |
-
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
margin: 0 auto;
|
45 |
<?php endif; ?>
|
46 |
}
|
47 |
+
figure.aligncenter amp-img {
|
48 |
margin: 0 auto;
|
49 |
}
|
50 |
/* Slide Navigation code */
|
111 |
<?php if ( true == ampforwp_get_setting('enable-single-line-share') ) { ?>
|
112 |
.custom-amp-socialsharing-line{background:#00b900}
|
113 |
<?php } ?>
|
114 |
+
<?php if ( true == ampforwp_get_setting('enable-single-mewe-share') ) { ?>
|
115 |
+
.custom-amp-socialsharing-mewe{background:#b8d6e6}
|
116 |
+
.amp-social-mewe{background:#b8d6e6}
|
117 |
+
<?php } ?>
|
118 |
<?php if ( true == ampforwp_get_setting('enable-single-vk-share') ) { ?>
|
119 |
+
.ampforwp-social-icons .custom-amp-socialsharing-vk, .amp-social-vk{background:#45668e}
|
120 |
<?php } ?>
|
121 |
<?php if ( true == ampforwp_get_setting('enable-single-odnoklassniki-share') ) { ?>
|
122 |
.amp-social-odnoklassniki{background:#ed812b}
|
377 |
@media (min-width: 320px) and (max-width: 767px) {.tablepress { display: inline-block; overflow-x: scroll; } }
|
378 |
<?php } ?>
|
379 |
.design_2_wrapper .amp-loop-list .amp-wp-meta {display: none;}
|
380 |
+
<?php if(!is_home() && ((is_single() && true == ampforwp_get_setting('ampforwp-bread-crumb') ) || (is_page() && ampforwp_get_setting('ampforwp_pages_breadcrumbs')) ) && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ) { ?>
|
381 |
.breadcrumb{line-height: 1;margin-bottom:6px;}
|
382 |
.breadcrumb ul, .category-single ul{padding:0; margin:0;}
|
383 |
.breadcrumb ul li{display:inline;}
|
587 |
margin:0 auto;
|
588 |
}
|
589 |
}
|
590 |
+
<?php } ?>
|
591 |
+
@media (min-width: 768px){
|
592 |
+
.wp-block-columns {
|
593 |
+
display:flex;
|
594 |
+
}
|
595 |
+
.wp-block-column {
|
596 |
+
max-width:50%;
|
597 |
+
margin: 0px 10px;
|
598 |
+
}
|
599 |
+
}
|
@@ -1,5 +1,5 @@
|
|
1 |
<?php global $redux_builder_amp;
|
2 |
-
if (
|
3 |
$home_non_amp = $archive_non_amp = '';
|
4 |
if ( false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
|
5 |
$home_non_amp = 'nonamp';
|
1 |
<?php global $redux_builder_amp;
|
2 |
+
if ( ( (is_single() && 1 == ampforwp_get_setting('ampforwp-bread-crumb')) || (is_page() && ampforwp_get_setting('ampforwp_pages_breadcrumbs')) ) && !checkAMPforPageBuilderStatus(get_the_ID()) ) {
|
3 |
$home_non_amp = $archive_non_amp = '';
|
4 |
if ( false == $redux_builder_amp['ampforwp-homepage-on-off-support'] ) {
|
5 |
$home_non_amp = 'nonamp';
|
@@ -2,46 +2,7 @@
|
|
2 |
|
3 |
<!--Post Content here-->
|
4 |
<div class="amp-wp-content the_content">
|
5 |
-
<?php
|
6 |
-
|
7 |
-
do_action('ampforwp_before_post_content',$this); //Post before Content here
|
8 |
-
|
9 |
-
$amp_custom_content_enable = get_post_meta( $this->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
|
10 |
-
|
11 |
-
// Normal Front Page Content
|
12 |
-
if ( ! $amp_custom_content_enable ) {
|
13 |
-
$ampforwp_the_content = $this->get( 'post_amp_content' ); // amphtml content; no kses
|
14 |
-
} else {
|
15 |
-
// Custom/Alternative AMP content added through post meta
|
16 |
-
$ampforwp_the_content = $this->get( 'ampforwp_amp_content' );
|
17 |
-
}
|
18 |
-
// Muffin Builder Compatibility #1455 #1893
|
19 |
-
if ( function_exists('mfn_builder_print') && ! $amp_custom_content_enable ) {
|
20 |
-
ob_start();
|
21 |
-
mfn_builder_print( get_the_ID() );
|
22 |
-
$content = ob_get_contents();
|
23 |
-
ob_end_clean();
|
24 |
-
$sanitizer_obj = new AMPFORWP_Content( $content,
|
25 |
-
array(),
|
26 |
-
apply_filters( 'ampforwp_content_sanitizers',
|
27 |
-
array( 'AMP_Img_Sanitizer' => array(),
|
28 |
-
'AMP_Blacklist_Sanitizer' => array(),
|
29 |
-
'AMP_Style_Sanitizer' => array(),
|
30 |
-
'AMP_Video_Sanitizer' => array(),
|
31 |
-
'AMP_Audio_Sanitizer' => array(),
|
32 |
-
'AMP_Iframe_Sanitizer' => array(
|
33 |
-
'add_placeholder' => true,
|
34 |
-
),
|
35 |
-
)
|
36 |
-
)
|
37 |
-
);
|
38 |
-
$ampforwp_the_content = $sanitizer_obj->get_amp_content();
|
39 |
-
}
|
40 |
-
|
41 |
-
//Filter to modify the Content
|
42 |
-
$ampforwp_the_content = apply_filters('ampforwp_modify_the_content', $ampforwp_the_content);
|
43 |
-
echo $ampforwp_the_content; // amphtml content, no kses
|
44 |
-
do_action('ampforwp_after_post_content',$this) ; //Post After Content here ?>
|
45 |
</div>
|
46 |
<!--Post Content Ends here-->
|
47 |
|
2 |
|
3 |
<!--Post Content here-->
|
4 |
<div class="amp-wp-content the_content">
|
5 |
+
<?php amp_content(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
</div>
|
7 |
<!--Post Content Ends here-->
|
8 |
|
@@ -24,12 +24,18 @@ if( isset($redux_builder_amp['ampforwp-cats-single']) && $redux_builder_amp['amp
|
|
24 |
global $redux_builder_amp; printf( esc_attr(ampforwp_translation($redux_builder_amp['amp-translator-in-designthree'] , 'in' ) .' '));
|
25 |
|
26 |
foreach ($ampforwp_categories as $cat ) {
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
?>
|
35 |
</span>
|
24 |
global $redux_builder_amp; printf( esc_attr(ampforwp_translation($redux_builder_amp['amp-translator-in-designthree'] , 'in' ) .' '));
|
25 |
|
26 |
foreach ($ampforwp_categories as $cat ) {
|
27 |
+
$term_id = $cat->term_id;
|
28 |
+
$term_name = $cat->name;
|
29 |
+
$term_url = get_category_link( $cat->term_id );
|
30 |
+
if(false == ampforwp_get_setting('ampforwp-cats-tags-links-single')){
|
31 |
+
$term_url = false;
|
32 |
+
}
|
33 |
+
elseif( true == ampforwp_get_setting('ampforwp-archive-support') && true == ampforwp_get_setting('ampforwp-cats-tags-links-single')) {
|
34 |
+
// #934
|
35 |
+
$term_url = ampforwp_url_controller( $term_url );
|
36 |
+
}
|
37 |
+
echo ('<span class="amp-cat amp-cat-'. esc_attr($term_id) . '" >
|
38 |
+
'. (!empty($term_url)? ' <a href="'. esc_url( $term_url) . '" > ':''). esc_html($term_name). (!empty($term_url)? '</a> ':'').' </span>');
|
39 |
}
|
40 |
?>
|
41 |
</span>
|
@@ -87,9 +87,9 @@ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_
|
|
87 |
$my_query->the_post();
|
88 |
$related_post_permalink = "";
|
89 |
$related_post_permalink = ampforwp_url_controller( get_permalink() );
|
90 |
-
if (
|
91 |
$related_post_permalink = get_permalink();
|
92 |
-
}?>
|
93 |
<li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
94 |
<div class="related-post_image">
|
95 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
87 |
$my_query->the_post();
|
88 |
$related_post_permalink = "";
|
89 |
$related_post_permalink = ampforwp_url_controller( get_permalink() );
|
90 |
+
if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
|
91 |
$related_post_permalink = get_permalink();
|
92 |
+
} ?>
|
93 |
<li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
94 |
<div class="related-post_image">
|
95 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
@@ -94,7 +94,7 @@ if ( is_single() || (is_page() && isset($redux_builder_amp['ampforwp-page-social
|
|
94 |
<?php } ?>
|
95 |
<?php if ( true == $redux_builder_amp['enable-single-vk-share'] ) { ?>
|
96 |
<div class="ampforwp-custom-social">
|
97 |
-
<a title="vkontakte share" href="http://vk.com/share.php?url=<?php echo esc_url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EwLjAwOC00LjkwNWMxMS45OTgtMTIuNzM0LDIwLjU2MS0yNy43ODMsMjguMjExLTQzLjM2NiAgIGMzLjM5NS02Ljg1Miw2LjMxNC0xMy45NjgsOS4xNDMtMjEuMDc4YzIuMDk2LTUuMjc2LDUuMzg1LTcuODcyLDExLjMyOC03Ljc1N2w0OC4yMjksMC4wNDNjMS40MywwLDIuODc3LDAuMDIxLDQuMjYyLDAuMjU4ICAgYzguMTI3LDEuMzg1LDEwLjM1NCw0Ljg4MSw3Ljg0NCwxMi44MTdjLTMuOTU1LDEyLjQ1MS0xMS42NSwyMi44MjctMTkuMTc0LDMzLjI1MWMtOC4wNDMsMTEuMTI5LTE2LjY0NSwyMS44NzctMjQuNjIxLDMzLjA3MiAgIEMyNTIuMjYsMTYxLjU0NCwyNTIuODQyLDE2Ni42OTcsMjYxLjk0NSwxNzUuNTc2TDI2MS45NDUsMTc1LjU3NnogTTI2MS45NDUsMTc1LjU3NiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="16" height="16" />
|
99 |
</a>
|
100 |
</div>
|
@@ -170,6 +170,13 @@ if ( is_single() || (is_page() && isset($redux_builder_amp['ampforwp-page-social
|
|
170 |
</div>
|
171 |
</a>
|
172 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
</div>
|
174 |
<?php } ?>
|
175 |
<?php do_action('ampforwp_after_social_icons_hook',$this);
|
94 |
<?php } ?>
|
95 |
<?php if ( true == $redux_builder_amp['enable-single-vk-share'] ) { ?>
|
96 |
<div class="ampforwp-custom-social">
|
97 |
+
<a title="vkontakte share" href="http://vk.com/share.php?url=<?php echo esc_url($amp_permalink); ?>" class="amp-social-icon-rounded amp-social-vk" target="_blank">
|
98 |
<amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCAzMDQuMzYgMzA0LjM2IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAzMDQuMzYgMzA0LjM2OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4Ij4KPGcgaWQ9IlhNTElEXzFfIj4KCTxwYXRoIGlkPSJYTUxJRF84MDdfIiBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7IiBkPSJNMjYxLjk0NSwxNzUuNTc2YzEwLjA5Niw5Ljg1NywyMC43NTIsMTkuMTMxLDI5LjgwNywyOS45ODIgICBjNCw0LjgyMiw3Ljc4Nyw5Ljc5OCwxMC42ODQsMTUuMzk0YzQuMTA1LDcuOTU1LDAuMzg3LDE2LjcwOS02Ljc0NiwxNy4xODRsLTQ0LjM0LTAuMDJjLTExLjQzNiwwLjk0OS0yMC41NTktMy42NTUtMjguMjMtMTEuNDc0ICAgYy02LjEzOS02LjI1My0xMS44MjQtMTIuOTA4LTE3LjcyNy0xOS4zNzJjLTI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MywxLjQ0OCw3LjM1LTIuMDk2LDEwLjAwOC00LjkwNWMxMS45OTgtMTIuNzM0LDIwLjU2MS0yNy43ODMsMjguMjExLTQzLjM2NiAgIGMzLjM5NS02Ljg1Miw2LjMxNC0xMy45NjgsOS4xNDMtMjEuMDc4YzIuMDk2LTUuMjc2LDUuMzg1LTcuODcyLDExLjMyOC03Ljc1N2w0OC4yMjksMC4wNDNjMS40MywwLDIuODc3LDAuMDIxLDQuMjYyLDAuMjU4ICAgYzguMTI3LDEuMzg1LDEwLjM1NCw0Ljg4MSw3Ljg0NCwxMi44MTdjLTMuOTU1LDEyLjQ1MS0xMS42NSwyMi44MjctMTkuMTc0LDMzLjI1MWMtOC4wNDMsMTEuMTI5LTE2LjY0NSwyMS44NzctMjQuNjIxLDMzLjA3MiAgIEMyNTIuMjYsMTYxLjU0NCwyNTIuODQyLDE2Ni42OTcsMjYxLjk0NSwxNzUuNTc2TDI2MS45NDUsMTc1LjU3NnogTTI2MS45NDUsMTc1LjU3NiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="16" height="16" />
|
99 |
</a>
|
100 |
</div>
|
170 |
</div>
|
171 |
</a>
|
172 |
<?php } ?>
|
173 |
+
<?php if ( true == ampforwp_get_setting('enable-single-mewe-share') ) { ?>
|
174 |
+
<div class="ampforwp-custom-social">
|
175 |
+
<a title="mewe share" href="https://mewe.com/share?link=<?php echo esc_url($amp_permalink); ?>" target="_blank" class="amp-social-icon-rounded amp-social-mewe">
|
176 |
+
<amp-img src="<?php echo esc_url(AMPFORWP_IMAGE_DIR . '/favicon-mewe.svg') ?>" width="16" height="16" />
|
177 |
+
</a>
|
178 |
+
</div>
|
179 |
+
<?php } ?>
|
180 |
</div>
|
181 |
<?php } ?>
|
182 |
<?php do_action('ampforwp_after_social_icons_hook',$this);
|
@@ -74,7 +74,7 @@ amp-wistia-player {margin:5px 0px;}
|
|
74 |
margin: 0 auto;
|
75 |
<?php endif; ?>
|
76 |
}
|
77 |
-
.
|
78 |
margin: 0 auto;
|
79 |
}
|
80 |
/* Slide Navigation code */
|
@@ -141,6 +141,7 @@ if ( ampforwp_get_setting('enable-single-social-icons') == true && is_single() |
|
|
141 |
.amp-social-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; }
|
142 |
.amp-social-icon amp-img{ top: 4px; }
|
143 |
.custom-amp-socialsharing-line{background:#00b900}
|
|
|
144 |
.sticky_social .whatsapp-share-icon{ padding: 4px 0px 14px 0px; height: 28px; top: -4px; position: relative; }
|
145 |
.sticky_social .line-share-icon{ padding: 4px 0px 14px 0px; height: 28px; top: -4px; position: relative; }
|
146 |
<?php }?>
|
@@ -217,8 +218,11 @@ h1.amp-wp-title{ margin: 0; color: #333333; font-size: 48px; line-height: 58px;
|
|
217 |
.amp-social-icon-rounded{padding: 11px 12px 9px 12px; top: -13px; position: relative; line-height: 1; display: inline-block; height: inherit; border-radius: 60px; }
|
218 |
<?php if ( true == ampforwp_get_setting('enable-single-line-share') ) { ?>
|
219 |
.amp-social-line{background:#00b900}
|
220 |
-
<?php }
|
221 |
-
|
|
|
|
|
|
|
222 |
.amp-social-vk{background:#45668e}
|
223 |
<?php } ?>
|
224 |
<?php if ( true == ampforwp_get_setting('enable-single-odnoklassniki-share') ) { ?>
|
@@ -566,7 +570,7 @@ if ( class_exists('TablePress') ) { ?>
|
|
566 |
@media (min-width: 768px) and (max-width: 1600px){ .tablepress{ overflow-x: none; } }
|
567 |
@media (min-width: 320px) and (max-width: 767px){ .tablepress{ display: inline-block; overflow-x: scroll; } }
|
568 |
<?php }
|
569 |
-
if
|
570 |
.breadcrumb{width: 100%;}
|
571 |
.breadcrumb ul, .category-single ul{ padding:0; margin:0;}
|
572 |
.breadcrumb ul li{display:inline;}
|
@@ -763,4 +767,22 @@ if(is_singular() || ampforwp_is_front_page()){?>
|
|
763 |
.amp_widget_below_the_header.f-w amp-img {
|
764 |
margin: 0 auto;
|
765 |
margin-top: 8px;
|
766 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
margin: 0 auto;
|
75 |
<?php endif; ?>
|
76 |
}
|
77 |
+
figure.aligncenter amp-img {
|
78 |
margin: 0 auto;
|
79 |
}
|
80 |
/* Slide Navigation code */
|
141 |
.amp-social-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; }
|
142 |
.amp-social-icon amp-img{ top: 4px; }
|
143 |
.custom-amp-socialsharing-line{background:#00b900}
|
144 |
+
.custom-amp-socialsharing-mewe{background:#b8d6e6}
|
145 |
.sticky_social .whatsapp-share-icon{ padding: 4px 0px 14px 0px; height: 28px; top: -4px; position: relative; }
|
146 |
.sticky_social .line-share-icon{ padding: 4px 0px 14px 0px; height: 28px; top: -4px; position: relative; }
|
147 |
<?php }?>
|
218 |
.amp-social-icon-rounded{padding: 11px 12px 9px 12px; top: -13px; position: relative; line-height: 1; display: inline-block; height: inherit; border-radius: 60px; }
|
219 |
<?php if ( true == ampforwp_get_setting('enable-single-line-share') ) { ?>
|
220 |
.amp-social-line{background:#00b900}
|
221 |
+
<?php }
|
222 |
+
if(ampforwp_get_setting('enable-single-mewe-share') == true) { ?>
|
223 |
+
.amp-social-mewe{background:#b8d6e6;}
|
224 |
+
<?php }
|
225 |
+
if ( true == ampforwp_get_setting('enable-single-vk-share') ) { ?>
|
226 |
.amp-social-vk{background:#45668e}
|
227 |
<?php } ?>
|
228 |
<?php if ( true == ampforwp_get_setting('enable-single-odnoklassniki-share') ) { ?>
|
570 |
@media (min-width: 768px) and (max-width: 1600px){ .tablepress{ overflow-x: none; } }
|
571 |
@media (min-width: 320px) and (max-width: 767px){ .tablepress{ display: inline-block; overflow-x: scroll; } }
|
572 |
<?php }
|
573 |
+
if(!is_home() && ((is_single() && true == ampforwp_get_setting('ampforwp-bread-crumb') ) || (is_page() && ampforwp_get_setting('ampforwp_pages_breadcrumbs')) ) && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ) { ?>
|
574 |
.breadcrumb{width: 100%;}
|
575 |
.breadcrumb ul, .category-single ul{ padding:0; margin:0;}
|
576 |
.breadcrumb ul li{display:inline;}
|
767 |
.amp_widget_below_the_header.f-w amp-img {
|
768 |
margin: 0 auto;
|
769 |
margin-top: 8px;
|
770 |
+
}
|
771 |
+
@media (min-width: 768px){
|
772 |
+
.wp-block-columns {
|
773 |
+
display:flex;
|
774 |
+
}
|
775 |
+
.wp-block-column {
|
776 |
+
max-width:50%;
|
777 |
+
margin: 0px 10px;
|
778 |
+
}
|
779 |
+
}
|
780 |
+
<?php
|
781 |
+
if ( is_singular() && false == ampforwp_get_setting('amp-opt-sticky-head') ){?>
|
782 |
+
.amp-wp-content *[id]:before {
|
783 |
+
display: block;
|
784 |
+
content: " ";
|
785 |
+
margin-top: -75px;
|
786 |
+
height: 75px;
|
787 |
+
visibility: hidden;}
|
788 |
+
<?php } ?>
|
@@ -192,6 +192,12 @@ if( (is_single() && $redux_builder_amp['enable-single-social-icons']) || (is_pag
|
|
192 |
<a title="pocket share" class="s_pk" target="_blank" href="https://getpocket.com/save?url=<?php echo esc_url($amp_permalink); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
193 |
</li>
|
194 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
</ul>
|
196 |
</div>
|
197 |
<?php }
|
192 |
<a title="pocket share" class="s_pk" target="_blank" href="https://getpocket.com/save?url=<?php echo esc_url($amp_permalink); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
193 |
</li>
|
194 |
<?php } ?>
|
195 |
+
<?php if ( true == ampforwp_get_setting('enable-single-mewe-share')){?>
|
196 |
+
<li>
|
197 |
+
<a title="mewe share" class="s_mewe" target="_blank" href="https://mewe.com/share?link=<?php echo esc_url($amp_permalink); ?>">
|
198 |
+
<amp-img src="<?php echo esc_url(AMPFORWP_IMAGE_DIR . '/favicon-mewe.svg') ?>" width="15" height="15" /></a>
|
199 |
+
</li>
|
200 |
+
<?php } ?>
|
201 |
</ul>
|
202 |
</div>
|
203 |
<?php }
|
@@ -162,6 +162,12 @@ function ampforwp_swift_social_icons(){
|
|
162 |
<a class="s_pk" target="_blank" href="https://getpocket.com/save?url=<?php echo esc_url($amp_permalink); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
163 |
</li>
|
164 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
<?php if($redux_builder_amp['ampforwp-facebook-like-button']){?>
|
166 |
<li>
|
167 |
<?php if( ampforwp_is_non_amp() && isset($redux_builder_amp['ampforwp-amp-convert-to-wp']) && $redux_builder_amp['ampforwp-amp-convert-to-wp']) { ?>
|
162 |
<a class="s_pk" target="_blank" href="https://getpocket.com/save?url=<?php echo esc_url($amp_permalink); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
163 |
</li>
|
164 |
<?php } ?>
|
165 |
+
<?php if ( true == ampforwp_get_setting('enable-single-mewe-share')){?>
|
166 |
+
<li>
|
167 |
+
<a title="mewe share" class="s_mewe" target="_blank" href="https://mewe.com/share?link=<?php echo esc_url($amp_permalink); ?>">
|
168 |
+
<amp-img src="<?php echo esc_url(AMPFORWP_IMAGE_DIR . '/favicon-mewe.svg') ?>" width="15" height="15" /></a>
|
169 |
+
</li>
|
170 |
+
<?php } ?>
|
171 |
<?php if($redux_builder_amp['ampforwp-facebook-like-button']){?>
|
172 |
<li>
|
173 |
<?php if( ampforwp_is_non_amp() && isset($redux_builder_amp['ampforwp-amp-convert-to-wp']) && $redux_builder_amp['ampforwp-amp-convert-to-wp']) { ?>
|
@@ -29,7 +29,9 @@
|
|
29 |
<?php amp_loop_title(); ?>
|
30 |
<div class="at-dt">
|
31 |
<?php amp_loop_date(); ?>
|
32 |
-
|
|
|
|
|
33 |
</div>
|
34 |
<?php if( ampforwp_check_excerpt() ) { amp_loop_excerpt(50); } ?>
|
35 |
</div>
|
29 |
<?php amp_loop_title(); ?>
|
30 |
<div class="at-dt">
|
31 |
<?php amp_loop_date(); ?>
|
32 |
+
<?php amp_author_box(
|
33 |
+
array('author_pub_name'=>true,)
|
34 |
+
); ?>
|
35 |
</div>
|
36 |
<?php if( ampforwp_check_excerpt() ) { amp_loop_excerpt(50); } ?>
|
37 |
</div>
|
@@ -1,20 +1,22 @@
|
|
1 |
<?php global $redux_builder_amp;
|
2 |
amp_header(); ?>
|
3 |
-
<div class="sp"
|
4 |
-
<div <?php if(!checkAMPforPageBuilderStatus(
|
5 |
<?php if( !ampforwp_levelup_compatibility('levelup_elementor') ){ // Level up Condition starts ?>
|
6 |
-
<?php if(!checkAMPforPageBuilderStatus(
|
7 |
-
<?php if ( true ==
|
8 |
amp_breadcrumb();
|
9 |
}?>
|
10 |
<?php amp_title(); ?>
|
11 |
<?php } ?>
|
12 |
<?php } // Level up Condition ends here?>
|
13 |
-
<?php if
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
18 |
<div class="pg">
|
19 |
<?php if ( is_page() && true == ampforwp_get_setting('ampforwp-page-social') && 'above-content' == ampforwp_get_setting('swift-social-position') ){
|
20 |
ampforwp_swift_social_icons();
|
@@ -24,7 +26,7 @@ amp_header(); ?>
|
|
24 |
} ?>
|
25 |
<div class="cntn-wrp">
|
26 |
<?php if( ampforwp_get_setting('gbl-sidebar') == '1' && ampforwp_is_front_page() ){ ?>
|
27 |
-
<div class="cntr pgb">
|
28 |
<div class="pg-lft">
|
29 |
<?php amp_content(); ?>
|
30 |
</div>
|
@@ -40,7 +42,7 @@ amp_header(); ?>
|
|
40 |
<?php } ?>
|
41 |
</div><!-- /.cntr -->
|
42 |
<?php } else { ?>
|
43 |
-
<?php if( true == ampforwp_get_setting('gnrl-sidebar') &&forwp_get_setting('page_sidebar') == '1' && !checkAMPforPageBuilderStatus(
|
44 |
<?php if ( is_active_sidebar( 'swift-sidebar' ) ) : ?>
|
45 |
<div class="sdbr-right" style="float: right;" >
|
46 |
<?php
|
@@ -57,7 +59,7 @@ amp_header(); ?>
|
|
57 |
<?php amp_content(); ?>
|
58 |
<?php } ?>
|
59 |
</div>
|
60 |
-
<?php if(!checkAMPforPageBuilderStatus(
|
61 |
if( is_page() && true == ampforwp_get_setting('ampforwp-page-social') && 'above-content' != ampforwp_get_setting('swift-social-position') ) { ?>
|
62 |
<div class="ss-ic"><?php
|
63 |
if( ampforwp_get_setting('enable-add-this-option') && 'above-content' != ampforwp_get_setting('swift-add-this-position')) {
|
1 |
<?php global $redux_builder_amp;
|
2 |
amp_header(); ?>
|
3 |
+
<div <?php if(!checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){ ?>class="sp"<?php } ?>>
|
4 |
+
<div <?php if(!checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){ ?>class="cntr"<?php } ?>>
|
5 |
<?php if( !ampforwp_levelup_compatibility('levelup_elementor') ){ // Level up Condition starts ?>
|
6 |
+
<?php if(!checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){ ?>
|
7 |
+
<?php if ( is_page() && true == ampforwp_get_setting('ampforwp_pages_breadcrumbs') ) {
|
8 |
amp_breadcrumb();
|
9 |
}?>
|
10 |
<?php amp_title(); ?>
|
11 |
<?php } ?>
|
12 |
<?php } // Level up Condition ends here?>
|
13 |
+
<?php if(!checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){ ?>
|
14 |
+
<?php if ( isset($redux_builder_amp['featured_image_swift_page']) && $redux_builder_amp['featured_image_swift_page'] && ampforwp_has_post_thumbnail() ) { ?>
|
15 |
+
<div class="sf-img">
|
16 |
+
<?php amp_featured_image();?>
|
17 |
+
</div>
|
18 |
+
<?php } ?>
|
19 |
+
<?php } ?>
|
20 |
<div class="pg">
|
21 |
<?php if ( is_page() && true == ampforwp_get_setting('ampforwp-page-social') && 'above-content' == ampforwp_get_setting('swift-social-position') ){
|
22 |
ampforwp_swift_social_icons();
|
26 |
} ?>
|
27 |
<div class="cntn-wrp">
|
28 |
<?php if( ampforwp_get_setting('gbl-sidebar') == '1' && ampforwp_is_front_page() ){ ?>
|
29 |
+
<div class="<?php if(!checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){ ?>cntr <?php } ?>pgb">
|
30 |
<div class="pg-lft">
|
31 |
<?php amp_content(); ?>
|
32 |
</div>
|
42 |
<?php } ?>
|
43 |
</div><!-- /.cntr -->
|
44 |
<?php } else { ?>
|
45 |
+
<?php if( true == ampforwp_get_setting('gnrl-sidebar') && ampforwp_get_setting('page_sidebar') == '1' && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ){ ?>
|
46 |
<?php if ( is_active_sidebar( 'swift-sidebar' ) ) : ?>
|
47 |
<div class="sdbr-right" style="float: right;" >
|
48 |
<?php
|
59 |
<?php amp_content(); ?>
|
60 |
<?php } ?>
|
61 |
</div>
|
62 |
+
<?php if(!checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){
|
63 |
if( is_page() && true == ampforwp_get_setting('ampforwp-page-social') && 'above-content' != ampforwp_get_setting('swift-social-position') ) { ?>
|
64 |
<div class="ss-ic"><?php
|
65 |
if( ampforwp_get_setting('enable-add-this-option') && 'above-content' != ampforwp_get_setting('swift-add-this-position')) {
|
@@ -41,13 +41,18 @@
|
|
41 |
echo ampforwp_addThis_support();
|
42 |
} ?>
|
43 |
<?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>
|
44 |
-
<?php
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
'
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
51 |
<?php } ?>
|
52 |
<?php amp_post_navigation();?>
|
53 |
<div class="cmts">
|
@@ -64,12 +69,14 @@
|
|
64 |
if ( 'default' == ampforwp_get_setting('swift-add-this-position') ){
|
65 |
echo ampforwp_addThis_support();
|
66 |
} ?>
|
67 |
-
|
68 |
<div class="sp-athr">
|
69 |
-
<span class="athr-tx"><?php echo
|
70 |
-
<?php amp_author_box(
|
|
|
|
|
71 |
</div>
|
72 |
-
<?php } ?>
|
73 |
<?php if( true == $redux_builder_amp['ampforwp-tags-single'] && amp_tags_list()){ ?>
|
74 |
<div class="tags">
|
75 |
<?php amp_tags_list();?>
|
@@ -188,7 +195,7 @@ do_action("ampforwp_single_design_type_handle");
|
|
188 |
</div>
|
189 |
</div>
|
190 |
<?php } ?>
|
191 |
-
<?php if($redux_builder_amp['single-design-type'] == '4'){?>
|
192 |
<div class="sp sgl">
|
193 |
<div class="cntr">
|
194 |
<div class="sp-wrap">
|
@@ -215,7 +222,14 @@ do_action("ampforwp_single_design_type_handle");
|
|
215 |
<div class="sp-rl">
|
216 |
<div class="sp-rt">
|
217 |
<div class="cntn-wrp artl-cnt">
|
218 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
</div>
|
220 |
<?php if( !checkAMPforPageBuilderStatus(get_the_ID()) ) { ?>
|
221 |
<div class="ss-ic">
|
@@ -356,13 +370,17 @@ do_action("ampforwp_single_design_type_handle");
|
|
356 |
<?php amp_date(); ?><?php edit_post_link(); ?>
|
357 |
</div>
|
358 |
<?php }
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
|
|
|
|
|
|
|
|
366 |
<?php } ?>
|
367 |
<?php amp_post_navigation();?>
|
368 |
<div class="cmts">
|
41 |
echo ampforwp_addThis_support();
|
42 |
} ?>
|
43 |
<?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>
|
44 |
+
<?php
|
45 |
+
$author_box = array();
|
46 |
+
if( true == ampforwp_get_setting('amp-author-description') ) { ?>
|
47 |
+
<?php
|
48 |
+
$author_box = array( 'avatar'=>true,
|
49 |
+
'avatar_size'=>60,
|
50 |
+
'author_description'=>true,
|
51 |
+
'ads_below_the_author'=>true);
|
52 |
+
if( true == ampforwp_get_setting('amp-author-bio-name')){
|
53 |
+
$author_box['author_pub_name'] = true ;
|
54 |
+
}
|
55 |
+
amp_author_box( $author_box ); ?>
|
56 |
<?php } ?>
|
57 |
<?php amp_post_navigation();?>
|
58 |
<div class="cmts">
|
69 |
if ( 'default' == ampforwp_get_setting('swift-add-this-position') ){
|
70 |
echo ampforwp_addThis_support();
|
71 |
} ?>
|
72 |
+
<?php if( true == ampforwp_get_setting('amp-author-name') ) { ?>
|
73 |
<div class="sp-athr">
|
74 |
+
<span class="athr-tx"><?php echo ampforwp_translation($redux_builder_amp['amp-translator-published-by'], 'Published by' ); ?></span>
|
75 |
+
<?php amp_author_box(
|
76 |
+
array('author_pub_name'=>true,)
|
77 |
+
); ?>
|
78 |
</div>
|
79 |
+
<?php } ?>
|
80 |
<?php if( true == $redux_builder_amp['ampforwp-tags-single'] && amp_tags_list()){ ?>
|
81 |
<div class="tags">
|
82 |
<?php amp_tags_list();?>
|
195 |
</div>
|
196 |
</div>
|
197 |
<?php } ?>
|
198 |
+
<?php if($redux_builder_amp['single-design-type'] == '4'){ ?>
|
199 |
<div class="sp sgl">
|
200 |
<div class="cntr">
|
201 |
<div class="sp-wrap">
|
222 |
<div class="sp-rl">
|
223 |
<div class="sp-rt">
|
224 |
<div class="cntn-wrp artl-cnt">
|
225 |
+
<?php
|
226 |
+
if ( 'above-content' == ampforwp_get_setting('swift-layout-addthis-pos') ){
|
227 |
+
echo ampforwp_addThis_support();
|
228 |
+
} ?>
|
229 |
+
<?php amp_content();
|
230 |
+
if ( 'below-content' == ampforwp_get_setting('swift-layout-addthis-pos') ){
|
231 |
+
echo ampforwp_addThis_support();
|
232 |
+
} ?>
|
233 |
</div>
|
234 |
<?php if( !checkAMPforPageBuilderStatus(get_the_ID()) ) { ?>
|
235 |
<div class="ss-ic">
|
370 |
<?php amp_date(); ?><?php edit_post_link(); ?>
|
371 |
</div>
|
372 |
<?php }
|
373 |
+
$author_box = array();
|
374 |
+
if( true == ampforwp_get_setting('amp-author-description') ) { ?>
|
375 |
+
<?php
|
376 |
+
$author_box = array( 'avatar'=>true,
|
377 |
+
'avatar_size'=>60,
|
378 |
+
'author_description'=>true,
|
379 |
+
'ads_below_the_author'=>true);
|
380 |
+
if( true == ampforwp_get_setting('amp-author-bio-name')){
|
381 |
+
$author_box['author_pub_name'] = true;
|
382 |
+
}
|
383 |
+
amp_author_box( $author_box );?>
|
384 |
<?php } ?>
|
385 |
<?php amp_post_navigation();?>
|
386 |
<div class="cmts">
|
@@ -58,7 +58,7 @@ amp-carousel > amp-img > img {object-fit: contain;}
|
|
58 |
.amp-carousel-container {position: relative;width: 100%;height: 100%;}
|
59 |
.amp-carousel-img img {object-fit: contain;}
|
60 |
amp-instagram{box-sizing: initial;}
|
61 |
-
.
|
62 |
<?php global $post;
|
63 |
if( class_exists('\Elementor\Plugin') && \Elementor\Plugin::$instance->db->is_built_with_elementor($post->ID) && (is_page() || ampforwp_is_front_page() ) && ( function_exists( 'amp_pagebuilder_compatibility_init' ) || class_exists('Elementor_For_Amp') ) ) { }
|
64 |
else{ ?>.cntr {max-width: 1100px;margin: 0 auto;width:100%;padding:0px 20px} <?php } ?>
|
@@ -707,7 +707,7 @@ letter-spacing: 0.10px;margin-top: 5px;font-weight: 400;}
|
|
707 |
padding-bottom:40px;
|
708 |
}
|
709 |
<?php } ?>
|
710 |
-
<?php if(
|
711 |
.sp-rt .amp-author {padding: 20px 20px;border-radius: 0;background: #f9f9f9;border: 1px solid #ececec;display: inline-block;width: 100%;}
|
712 |
.sp-rt .amp-author-image{float:left;}
|
713 |
.sp-rt .author-details a{color: #222;font-size: 14px;font-weight: 500;}
|
@@ -715,25 +715,6 @@ letter-spacing: 0.10px;margin-top: 5px;font-weight: 400;}
|
|
715 |
.amp-author-image amp-img{border-radius: 50%;margin: 0px 12px 5px 0px;display: block; width:50px;}
|
716 |
.author-details p{margin: 0;font-size: 13px;line-height: 20px;color: #666;padding-top: 4px;}
|
717 |
<?php } ?>
|
718 |
-
<?php //Breadcrumbs
|
719 |
-
if( !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) && is_singular() && true == ampforwp_get_setting('ampforwp-bread-crumb') ) {?>
|
720 |
-
.breadcrumbs{padding-bottom: 8px;margin-bottom: 20px;
|
721 |
-
<?php if( 1 == $redux_builder_amp['breadcrumb-border'] ) {?>
|
722 |
-
border-bottom: 1px solid #eee;
|
723 |
-
<?php }?>}
|
724 |
-
.breadcrumb ul li,.breadcrumbs span{display: inline-block;list-style-type: none;font-size: 10px;text-transform: uppercase;margin-right: 5px;}
|
725 |
-
.breadcrumb ul li a, .breadcrumbs span a{color: #999;letter-spacing: 1px;}
|
726 |
-
.breadcrumb ul li a:hover, .breadcrumbs span a:hover{color: <?php echo ampforwp_sanitize_color($hovercolor); ?>;}
|
727 |
-
.breadcrumbs li a:after, .breadcrumbs span a:after{
|
728 |
-
<?php if ( ampforwp_get_setting('ampforwp_font_icon') == 'swift-icons' ){ ?>
|
729 |
-
content: "\e315";font-family: 'icomoon';font-size: 12px;
|
730 |
-
<?php }
|
731 |
-
if ( ampforwp_get_setting('ampforwp_font_icon') == 'fontawesome-icons' ){ ?>
|
732 |
-
content:"\f105";font-family: "Font Awesome 5 Free";font-weight:600;font-size:11px;
|
733 |
-
<?php } ?>
|
734 |
-
display: inline-block;color: #bdbdbd;padding-left: 5px;position: relative;top: 1px;}
|
735 |
-
.breadcrumbs li:last-child a:after {display: none;}
|
736 |
-
<?php } //Breadcrumbs Ends?>
|
737 |
#pagination{margin-top: 30px;border-top: 1px dotted #ccc;padding: 20px 5px 0px 5px;;font-size: 16px;line-height: 24px;font-weight:400;}
|
738 |
.next{float: right;width: 45%;text-align:right;position:relative;margin-top:10px;}
|
739 |
.next a, .prev a{color:#333;}
|
@@ -795,8 +776,10 @@ if( isset($redux_builder_amp['wordpress-comments-support']) && 1 == $redux_build
|
|
795 |
.cmts-wrap a:hover{color:<?php echo ampforwp_sanitize_color($swift_cs_color) ?>;}
|
796 |
.cmts-wrap .current{color:<?php echo ampforwp_sanitize_color($swift_cs_color) ?>;}
|
797 |
<?php } // Comments Pagination CSS Ends
|
798 |
-
if (
|
799 |
-
.amp-disqus-comments { text-align:center }
|
|
|
|
|
800 |
} ?>
|
801 |
|
802 |
@media(max-width:1110px){
|
@@ -874,12 +857,19 @@ if ( isset($redux_builder_amp['ampforwp-disqus-comments-support']) && $redux_bui
|
|
874 |
.cntn-wrp p {font-size: 16px;}
|
875 |
}
|
876 |
<?php } } ?>
|
877 |
-
<?php if (
|
878 |
.cntn-wrp > p:first-of-type::first-letter{
|
879 |
float: left;
|
880 |
-
font
|
|
|
|
|
|
|
881 |
line-height: 1;
|
882 |
padding-right: 8px;
|
|
|
|
|
|
|
|
|
883 |
}
|
884 |
<?php } //Drop Cap CSS ends
|
885 |
// Menu Search CSS
|
@@ -1946,6 +1936,18 @@ if (ampforwp_get_setting('enable-amp-ads-resp-6')){?>
|
|
1946 |
<?php if (checkAMPforPageBuilderStatus(get_the_ID())){ ?>
|
1947 |
.sp-cnt .cntr {max-width: 100%;margin:0;width:100%;padding:0}
|
1948 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1949 |
<?php if(true == ampforwp_get_setting('ampforwp-smooth-scrolling-for-links')){?>
|
1950 |
html {
|
1951 |
scroll-behavior: smooth;
|
@@ -2001,4 +2003,22 @@ if(is_singular() || ampforwp_is_front_page()){?>
|
|
2001 |
}
|
2002 |
}
|
2003 |
<?php } ?>
|
2004 |
-
<?php } // levelup condition ends here?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
.amp-carousel-container {position: relative;width: 100%;height: 100%;}
|
59 |
.amp-carousel-img img {object-fit: contain;}
|
60 |
amp-instagram{box-sizing: initial;}
|
61 |
+
figure.aligncenter amp-img {margin: 0 auto;}
|
62 |
<?php global $post;
|
63 |
if( class_exists('\Elementor\Plugin') && \Elementor\Plugin::$instance->db->is_built_with_elementor($post->ID) && (is_page() || ampforwp_is_front_page() ) && ( function_exists( 'amp_pagebuilder_compatibility_init' ) || class_exists('Elementor_For_Amp') ) ) { }
|
64 |
else{ ?>.cntr {max-width: 1100px;margin: 0 auto;width:100%;padding:0px 20px} <?php } ?>
|
707 |
padding-bottom:40px;
|
708 |
}
|
709 |
<?php } ?>
|
710 |
+
<?php if( true == ampforwp_get_setting('amp-author-description') ) { ?>
|
711 |
.sp-rt .amp-author {padding: 20px 20px;border-radius: 0;background: #f9f9f9;border: 1px solid #ececec;display: inline-block;width: 100%;}
|
712 |
.sp-rt .amp-author-image{float:left;}
|
713 |
.sp-rt .author-details a{color: #222;font-size: 14px;font-weight: 500;}
|
715 |
.amp-author-image amp-img{border-radius: 50%;margin: 0px 12px 5px 0px;display: block; width:50px;}
|
716 |
.author-details p{margin: 0;font-size: 13px;line-height: 20px;color: #666;padding-top: 4px;}
|
717 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
718 |
#pagination{margin-top: 30px;border-top: 1px dotted #ccc;padding: 20px 5px 0px 5px;;font-size: 16px;line-height: 24px;font-weight:400;}
|
719 |
.next{float: right;width: 45%;text-align:right;position:relative;margin-top:10px;}
|
720 |
.next a, .prev a{color:#333;}
|
776 |
.cmts-wrap a:hover{color:<?php echo ampforwp_sanitize_color($swift_cs_color) ?>;}
|
777 |
.cmts-wrap .current{color:<?php echo ampforwp_sanitize_color($swift_cs_color) ?>;}
|
778 |
<?php } // Comments Pagination CSS Ends
|
779 |
+
if ( true == ampforwp_get_setting('ampforwp-disqus-comments-support') ) {?>
|
780 |
+
.amp-disqus-comments { text-align:center }
|
781 |
+
.amp-disqus-comments amp-iframe, .amp-disqus-comments iframe{overflow: auto; overflow-y:scroll;-webkit-overflow-scrolling: touch;}
|
782 |
+
.amp-disqus-comments iframe{width:100%;height:300px;}<?php
|
783 |
} ?>
|
784 |
|
785 |
@media(max-width:1110px){
|
857 |
.cntn-wrp p {font-size: 16px;}
|
858 |
}
|
859 |
<?php } } ?>
|
860 |
+
<?php if ( true == ampforwp_get_setting('ampforwp-dropcap')) { ?>
|
861 |
.cntn-wrp > p:first-of-type::first-letter{
|
862 |
float: left;
|
863 |
+
<?php $fontsize = ampforwp_get_setting('ampforwp-dropcap-font');
|
864 |
+
if (empty($fontsize)){?>font-size: 75px;<?php } else {?>
|
865 |
+
font-size: <?php echo esc_html($fontsize) ?>px;
|
866 |
+
<?php } ?>
|
867 |
line-height: 1;
|
868 |
padding-right: 8px;
|
869 |
+
<?php $color = ampforwp_get_setting('ampforwp-dropcap-color','color','ampforwp_sanitize_hex_color');
|
870 |
+
if (empty($color)){?>color: #000;<?php } else {?>
|
871 |
+
color: <?php echo $color ?>;
|
872 |
+
<?php } ?>
|
873 |
}
|
874 |
<?php } //Drop Cap CSS ends
|
875 |
// Menu Search CSS
|
1936 |
<?php if (checkAMPforPageBuilderStatus(get_the_ID())){ ?>
|
1937 |
.sp-cnt .cntr {max-width: 100%;margin:0;width:100%;padding:0}
|
1938 |
<?php } ?>
|
1939 |
+
<?php //Breadcrumbs
|
1940 |
+
if( !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) && ( (is_single() && true == ampforwp_get_setting('ampforwp-bread-crumb')) || (is_page() && ampforwp_get_setting('ampforwp_pages_breadcrumbs')) )) {?>
|
1941 |
+
.breadcrumbs{padding-bottom: 8px;margin-bottom: 20px;
|
1942 |
+
<?php if( true == ampforwp_get_setting('breadcrumb-border') ) {?>
|
1943 |
+
border-bottom: 1px solid #eee;
|
1944 |
+
<?php }?>}
|
1945 |
+
.breadcrumb ul li,.breadcrumbs span{display: inline-block;list-style-type: none;font-size: 10px;text-transform: uppercase;margin-right: 5px;}
|
1946 |
+
.breadcrumb ul li a, .breadcrumbs span a{color: #999;letter-spacing: 1px;}
|
1947 |
+
.breadcrumb ul li a:hover, .breadcrumbs span a:hover{color: <?php echo $hovercolor; ?>;}
|
1948 |
+
.breadcrumbs li a:after, .breadcrumbs span a:after{content: "\e315";display: inline-block;color: #bdbdbd;font-family: 'icomoon';padding-left: 5px;font-size: 12px;position: relative;top: 1px;}
|
1949 |
+
.breadcrumbs li:last-child a:after {display: none;}
|
1950 |
+
<?php } //Breadcrumbs Ends?>
|
1951 |
<?php if(true == ampforwp_get_setting('ampforwp-smooth-scrolling-for-links')){?>
|
1952 |
html {
|
1953 |
scroll-behavior: smooth;
|
2003 |
}
|
2004 |
}
|
2005 |
<?php } ?>
|
2006 |
+
<?php } // levelup condition ends here?>
|
2007 |
+
@media (min-width: 768px){
|
2008 |
+
.wp-block-columns {
|
2009 |
+
display:flex;
|
2010 |
+
}
|
2011 |
+
.wp-block-column {
|
2012 |
+
max-width:50%;
|
2013 |
+
margin: 0px 10px;
|
2014 |
+
}
|
2015 |
+
}
|
2016 |
+
<?php
|
2017 |
+
if(is_singular() && true == ampforwp_get_setting('amp-sticky-header')){?>
|
2018 |
+
.cntn-wrp *[id]:before {
|
2019 |
+
display: block;
|
2020 |
+
content: " ";
|
2021 |
+
margin-top: -75px;
|
2022 |
+
height: 75px;
|
2023 |
+
visibility: hidden;}
|
2024 |
+
<?php } ?>
|
@@ -1316,7 +1316,7 @@ function ampforwp_sticky_social_icons(){
|
|
1316 |
</a>
|
1317 |
<?php } ?>
|
1318 |
<?php if($redux_builder_amp['enable-single-vk-share'] == true) { ?>
|
1319 |
-
<a title="vkontakte share" href="http://vk.com/share.php?url=<?php echo esc_url($amp_permalink); ?>">
|
1320 |
<div class="amp-social-icon amp-social-vk">
|
1321 |
<amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iM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1Miw2LjMxNC0xMy45NjgsOS4xNDMtMjEuMDc4YzIuMDk2LTUuMjc2LDUuMzg1LTcuODcyLDExLjMyOC03Ljc1N2w0OC4yMjksMC4wNDNjMS40MywwLDIuODc3LDAuMDIxLDQuMjYyLDAuMjU4ICAgYzguMTI3LDEuMzg1LDEwLjM1NCw0Ljg4MSw3Ljg0NCwxMi44MTdjLTMuOTU1LDEyLjQ1MS0xMS42NSwyMi44MjctMTkuMTc0LDMzLjI1MWMtOC4wNDMsMTEuMTI5LTE2LjY0NSwyMS44NzctMjQuNjIxLDMzLjA3MiAgIEMyNTIuMjYsMTYxLjU0NCwyNTIuODQyLDE2Ni42OTcsMjYxLjk0NSwxNzUuNTc2TDI2MS45NDUsMTc1LjU3NnogTTI2MS45NDUsMTc1LjU3NiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
|
1322 |
</div>
|
@@ -1393,6 +1393,13 @@ function ampforwp_sticky_social_icons(){
|
|
1393 |
</div>
|
1394 |
</a>
|
1395 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1396 |
</div>
|
1397 |
<?php }
|
1398 |
}
|
@@ -3181,21 +3188,17 @@ if( ! function_exists(' ampforwp_youtube_modified_params ') ){
|
|
3181 |
function ampforwp_comment_button_url(){
|
3182 |
global $redux_builder_amp;
|
3183 |
$button_url = "";
|
3184 |
-
|
3185 |
-
|
3186 |
-
|
3187 |
-
|
3188 |
-
|
3189 |
-
|
3190 |
-
if ( isset($redux_builder_amp['ampforwp-amp-takeover']) && $redux_builder_amp['ampforwp-amp-takeover'] ) {
|
3191 |
$button_url = user_trailingslashit(get_the_permalink()).'#comments';
|
3192 |
}
|
3193 |
else{
|
3194 |
-
$button_url =
|
3195 |
-
|
3196 |
-
$button_url = $button_url. '#commentform';
|
3197 |
}
|
3198 |
-
|
3199 |
}
|
3200 |
|
3201 |
// 60. Remove Category Layout modification code added by TagDiv #842 and #796
|
@@ -4827,9 +4830,16 @@ if( ! function_exists( 'ampforwp_additional_style_carousel_caption' ) ){
|
|
4827 |
// amp-bind for carousel with captions
|
4828 |
if( !function_exists('ampforwp_carousel_bind_script')){
|
4829 |
function ampforwp_carousel_bind_script($data){
|
|
|
4830 |
if ( empty( $data['amp_component_scripts']['amp-bind'] ) ) {
|
4831 |
$data['amp_component_scripts']['amp-bind'] = 'https://cdn.ampproject.org/v0/amp-bind-0.1.js';
|
4832 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
4833 |
return $data;
|
4834 |
}
|
4835 |
}
|
@@ -6471,6 +6481,9 @@ if ( ! function_exists('ampforwp_gutenberg_css') ) {
|
|
6471 |
function ampforwp_gutenberg_css(){ ?>
|
6472 |
.wp-block-button { color: #fff}
|
6473 |
.wp-block-button a {background-color: #32373c;border-radius: 28px;color: inherit;display: inline-block;padding: 12px 24px;}
|
|
|
|
|
|
|
6474 |
<?php }
|
6475 |
}
|
6476 |
// Subtitles Plugin Support #2853
|
@@ -6564,6 +6577,12 @@ function ampforwp_add_global_scripts($data){
|
|
6564 |
}
|
6565 |
}
|
6566 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
6567 |
return $data;
|
6568 |
}
|
6569 |
if ( ! function_exists('ampforwp_get_weglot_url') ) {
|
@@ -6738,17 +6757,6 @@ function ampforwp_ivory_search_css(){
|
|
6738 |
display: none;
|
6739 |
}
|
6740 |
<?php } }
|
6741 |
-
// AddThis Support
|
6742 |
-
add_filter('amp_post_template_data','ampforwp_register_addthis_script', 20);
|
6743 |
-
function ampforwp_register_addthis_script( $data ){
|
6744 |
-
global $redux_builder_amp;
|
6745 |
-
if ( ampforwp_get_setting('enable-add-this-option') && ( is_single() || (is_page() && ampforwp_get_setting('ampforwp-page-social') ) ) ) {
|
6746 |
-
if ( empty( $data['amp_component_scripts']['amp-addthis'] ) ) {
|
6747 |
-
$data['amp_component_scripts']['amp-addthis'] = 'https://cdn.ampproject.org/v0/amp-addthis-0.1.js';
|
6748 |
-
}
|
6749 |
-
}
|
6750 |
-
return $data;
|
6751 |
-
}
|
6752 |
// Font Awesome Icons added for Swift
|
6753 |
add_action('amp_post_template_head', 'ampforwp_fontawesome_canonical_link');
|
6754 |
function ampforwp_fontawesome_canonical_link(){
|
@@ -6807,4 +6815,37 @@ function ampforwp_slide_anything_embed($data) {
|
|
6807 |
$data['AMPFORWP_Slide_Anything_Embed_Handler'] = array();
|
6808 |
}
|
6809 |
return $data;
|
6810 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1316 |
</a>
|
1317 |
<?php } ?>
|
1318 |
<?php if($redux_builder_amp['enable-single-vk-share'] == true) { ?>
|
1319 |
+
<a title="vkontakte share" href="http://vk.com/share.php?url=<?php echo esc_url($amp_permalink); ?>" target="_blank">
|
1320 |
<div class="amp-social-icon amp-social-vk">
|
1321 |
<amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdm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LTE2LjY0NSwyMS44NzctMjQuNjIxLDMzLjA3MiAgIEMyNTIuMjYsMTYxLjU0NCwyNTIuODQyLDE2Ni42OTcsMjYxLjk0NSwxNzUuNTc2TDI2MS45NDUsMTc1LjU3NnogTTI2MS45NDUsMTc1LjU3NiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
|
1322 |
</div>
|
1393 |
</div>
|
1394 |
</a>
|
1395 |
<?php } ?>
|
1396 |
+
<?php if(true == ampforwp_get_setting('enable-single-mewe-share')) {?>
|
1397 |
+
<a title="mewe share" href="https://mewe.com/share?link=<?php echo esc_url($amp_permalink); ?>">
|
1398 |
+
<div class="amp-social-icon custom-amp-socialsharing-mewe">
|
1399 |
+
<amp-img src="<?php echo esc_url(AMPFORWP_IMAGE_DIR . '/favicon-mewe.svg') ?>" width="50" height="20" />
|
1400 |
+
</div>
|
1401 |
+
</a>
|
1402 |
+
<?php } ?>
|
1403 |
</div>
|
1404 |
<?php }
|
1405 |
}
|
3188 |
function ampforwp_comment_button_url(){
|
3189 |
global $redux_builder_amp;
|
3190 |
$button_url = "";
|
3191 |
+
if(ampforwp_get_setting('amp-mobile-redirection')==1){
|
3192 |
+
$button_url = add_query_arg( array( 'nonamp' => '1' ), get_permalink() );
|
3193 |
+
$button_url = $button_url. '#commentform';
|
3194 |
+
}
|
3195 |
+
elseif ( ampforwp_get_setting('ampforwp-amp-takeover') ) {
|
|
|
|
|
3196 |
$button_url = user_trailingslashit(get_the_permalink()).'#comments';
|
3197 |
}
|
3198 |
else{
|
3199 |
+
$button_url = get_permalink(). '#commentform';
|
|
|
|
|
3200 |
}
|
3201 |
+
return $button_url;
|
3202 |
}
|
3203 |
|
3204 |
// 60. Remove Category Layout modification code added by TagDiv #842 and #796
|
4830 |
// amp-bind for carousel with captions
|
4831 |
if( !function_exists('ampforwp_carousel_bind_script')){
|
4832 |
function ampforwp_carousel_bind_script($data){
|
4833 |
+
if( 1 == ampforwp_get_setting('ampforwp-gallery-design-type') || 2 == ampforwp_get_setting('ampforwp-gallery-design-type') ){
|
4834 |
if ( empty( $data['amp_component_scripts']['amp-bind'] ) ) {
|
4835 |
$data['amp_component_scripts']['amp-bind'] = 'https://cdn.ampproject.org/v0/amp-bind-0.1.js';
|
4836 |
}
|
4837 |
+
}
|
4838 |
+
if( 3 == ampforwp_get_setting('ampforwp-gallery-design-type') || true == ampforwp_get_setting('ampforwp-gallery-lightbox') ){
|
4839 |
+
if ( empty( $data['amp_component_scripts']['amp-image-lightbox'] ) ) {
|
4840 |
+
$data['amp_component_scripts']['amp-image-lightbox'] = 'https://cdn.ampproject.org/v0/amp-image-lightbox-0.1.js';
|
4841 |
+
}
|
4842 |
+
}
|
4843 |
return $data;
|
4844 |
}
|
4845 |
}
|
6481 |
function ampforwp_gutenberg_css(){ ?>
|
6482 |
.wp-block-button { color: #fff}
|
6483 |
.wp-block-button a {background-color: #32373c;border-radius: 28px;color: inherit;display: inline-block;padding: 12px 24px;}
|
6484 |
+
.wp-block-cover{position:relative;background-color: #000;background-size: cover;background-position: center center;min-height: 430px;width: 100%;margin: 1.5em 0 1.5em 0;display: flex;justify-content: center;align-items: center;overflow: hidden;}
|
6485 |
+
.wp-block-cover-text{color: #fff;font-size: 2em;line-height: 1.25;z-index: 1;}
|
6486 |
+
.wp-block-cover-image.has-background-dim::before, .wp-block-cover.has-background-dim::before {content: "";position: absolute;top: 0;left: 0;bottom: 0;right: 0;background-color: inherit;opacity: .5;z-index: 1;}
|
6487 |
<?php }
|
6488 |
}
|
6489 |
// Subtitles Plugin Support #2853
|
6577 |
}
|
6578 |
}
|
6579 |
}
|
6580 |
+
// AddThis Support #3068
|
6581 |
+
if ( ampforwp_get_setting('enable-add-this-option') && ( is_single() || (is_page() && ampforwp_get_setting('ampforwp-page-social') ) ) ) {
|
6582 |
+
if ( empty( $data['amp_component_scripts']['amp-addthis'] ) ) {
|
6583 |
+
$data['amp_component_scripts']['amp-addthis'] = 'https://cdn.ampproject.org/v0/amp-addthis-0.1.js';
|
6584 |
+
}
|
6585 |
+
}
|
6586 |
return $data;
|
6587 |
}
|
6588 |
if ( ! function_exists('ampforwp_get_weglot_url') ) {
|
6757 |
display: none;
|
6758 |
}
|
6759 |
<?php } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6760 |
// Font Awesome Icons added for Swift
|
6761 |
add_action('amp_post_template_head', 'ampforwp_fontawesome_canonical_link');
|
6762 |
function ampforwp_fontawesome_canonical_link(){
|
6815 |
$data['AMPFORWP_Slide_Anything_Embed_Handler'] = array();
|
6816 |
}
|
6817 |
return $data;
|
6818 |
+
}
|
6819 |
+
|
6820 |
+
// Revolution Slider compatibility #1464
|
6821 |
+
add_action('pre_amp_render_post', 'ampforwp_initialise_rev_slider');
|
6822 |
+
if ( ! function_exists('ampforwp_initialise_rev_slider') ) {
|
6823 |
+
function ampforwp_initialise_rev_slider(){
|
6824 |
+
if ( class_exists('RevSliderOutput') ){
|
6825 |
+
require AMPFORWP_PLUGIN_DIR .'/classes/class-ampforwp-rev-slider.php';
|
6826 |
+
}
|
6827 |
+
}
|
6828 |
+
}
|
6829 |
+
add_filter('amp_content_embed_handlers','ampforwp_rev_slider_embed');
|
6830 |
+
function ampforwp_rev_slider_embed($data) {
|
6831 |
+
if ( class_exists('RevSliderOutput') ){
|
6832 |
+
$data['AMP_Rev_Slider_Embed_Handler'] = array();
|
6833 |
+
}
|
6834 |
+
return $data;
|
6835 |
+
}
|
6836 |
+
// Photo Gallery by 10Web Compatibility #1811
|
6837 |
+
add_action('pre_amp_render_post', 'ampforwp_initialise_photo_gallery');
|
6838 |
+
if ( ! function_exists('ampforwp_initialise_photo_gallery') ) {
|
6839 |
+
function ampforwp_initialise_photo_gallery(){
|
6840 |
+
if ( class_exists('BWG') ) {
|
6841 |
+
require AMPFORWP_PLUGIN_DIR .'/classes/class-ampforwp-photo-gallery-embed.php';
|
6842 |
+
}
|
6843 |
+
}
|
6844 |
+
}
|
6845 |
+
add_filter('amp_content_embed_handlers','ampforwp_photo_gallery_embed');
|
6846 |
+
function ampforwp_photo_gallery_embed($data) {
|
6847 |
+
if ( class_exists('BWG') ) {
|
6848 |
+
$data['AMPforWP_Photo_Gallery_Embed_Handler'] = array();
|
6849 |
+
}
|
6850 |
+
return $data;
|
6851 |
+
}
|