Version Description
(14th June 2019) = * Improvements: Option for H1-H6 Heading Font Sizes for all the designs #3035 * Improvements: New filter to add the classes which have to be excluded in infinity scroll #3297 * Improvements: Additional options for the Rank Math SEO plugin #3314 * Improvements: Purge AMP CDN Cache added in Extension List #3324 * Fixed: After v0.9.97.57 error can't disable featured image #3272 * Fixed: Amp options panel's section code improved #3205 * Fixed: Matemo Switch UI issue #3041 * Fixed: Redux options for translating the field #2460 * Fixed: Problem with pagination links in AMP #3313 * Fixed: AMP Page Builder options not working due to Groovy Menu Plugin #3226 * Fixed: Analytics not working due to Glue for Yoast SEO & AMP plugin #3153 * Fixed: Yoast Meta Description not being picked up #3290 * Fixed: ampforwp_new_gallery_images called multiple times resulting Fatal Error #3296 * Fixed: Error message comes after search in post or page in Swift theme #3309 * Fixed: Pages redirect to /amp/amp after last update #3270 * Fixed: Archive and Categoy not working properly with Swift design #3265 * Fixed: Fatal error when remove author meta name and date on AMP posts/articles in design-2 #3260 * Fixed: Lightbox for image does not work when link [anchor tag] attached to images #2695 * Fixed: Webp as featured image is not working in the single posts #2996 * Fixed: Redirection issue when visiting AMP version after clicking Non-AMP link in Header #2940 * Fixed: code imporved in the amp_loop_image #3084 * Fixed: Sidebar breaks the blog page design #3056 * Fixed: In content related posts in Design-3 images are not showing #3109 * Fixed: Close Button is not coming in iphone in swift theme #3107 * Fixed: AMP strings are not translatable #3169 * Fixed: Option Panel's tooltips code updated #3172 * Fixed: Table style is not loading in AMP Page #3204 * Fixed: H1 tag on Logo in design-swift #3231 * Fixed: Color of button not working properly in design-swift #3216 * Fixed: PHP Debug warning fixed #3128
Full changelog available at changelog.txt
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 0.9.97.58 |
Comparing to | |
See all releases |
Code changes from version 0.9.97.57 to 0.9.97.58
- README.md +34 -1
- accelerated-moblie-pages.php +3 -2
- changelog.txt +32 -0
- classes/class-ampforwp-infinite-scroll.php +1 -1
- classes/class-ampforwp-photo-gallery-embed.php +2 -32
- classes/class-ampforwp-rev-slider.php +3 -32
- classes/class-ampforwp-slide-anything-embed.php +2 -32
- components/components-core.php +1 -0
- components/featured-image/featured-image.php +8 -2
- components/logo/logo.php +6 -1
- components/loop/loop.php +7 -2
- components/menu/menu.php +8 -6
- includes/admin-style.css +5 -2
- includes/features/analytics/analytics-options.php +2 -2
- includes/features/functions.php +91 -8
- includes/features/structure-data/structured-data-functions.php +7 -7
- includes/options/admin-config.php +70 -10
- includes/options/redux-core/assets/css/redux-admin.css +10 -0
- includes/redirect.php +30 -19
- includes/vendor/amp/includes/admin/class-amp-customizer.php +1 -1
- includes/vendor/amp/includes/amp-post-template-actions.php +1 -1
- includes/vendor/amp/includes/class-amp-post-template.php +3 -1
- includes/vendor/amp/includes/embeds/class-amp-gallery-embed.php +2 -32
- pagebuilder/inc/admin-amp-page-builder.css +2 -0
- readme.txt +32 -67
- templates/design-manager.php +5 -3
- templates/design-manager/design-1/elements/featured-image.php +32 -20
- templates/design-manager/design-1/footer.php +1 -1
- templates/design-manager/design-1/style.php +13 -13
- templates/design-manager/design-2/elements/featured-image.php +45 -33
- templates/design-manager/design-2/footer.php +1 -1
- templates/design-manager/design-2/style.php +13 -13
- templates/design-manager/design-3/elements/featured-image.php +32 -20
- templates/design-manager/design-3/footer.php +1 -1
- templates/design-manager/design-3/style.php +3 -1
- templates/design-manager/swift/header.php +2 -2
- templates/design-manager/swift/index.php +1 -1
- templates/design-manager/swift/loop.php +3 -2
- templates/design-manager/swift/search.php +3 -3
- templates/design-manager/swift/style.php +30 -14
- templates/features.php +108 -100
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.2.1
|
7 |
-
Stable tag: 0.9.97.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -188,6 +188,39 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
|
|
188 |
|
189 |
== Changelog ==
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
= 0.9.97.57 (31st May 2019) =
|
192 |
* Improvements: Need to add description field in VideoObject Schema type #2846
|
193 |
* Improvements: Create an option for H1-H6 Heading Font Sizes for all the designs. #3035
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.2.1
|
7 |
+
Stable tag: 0.9.97.58
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
188 |
|
189 |
== Changelog ==
|
190 |
|
191 |
+
= 0.9.97.58 (14th June 2019) =
|
192 |
+
* Improvements: Option for H1-H6 Heading Font Sizes for all the designs #3035
|
193 |
+
* Improvements: New filter to add the classes which have to be excluded in infinity scroll #3297
|
194 |
+
* Improvements: Additional options for the Rank Math SEO plugin #3314
|
195 |
+
* Improvements: Purge AMP CDN Cache added in Extension List #3324
|
196 |
+
* Fixed: After v0.9.97.57 error can't disable featured image #3272
|
197 |
+
* Fixed: Amp options panel's section code improved #3205
|
198 |
+
* Fixed: Matemo Switch UI issue #3041
|
199 |
+
* Fixed: Redux options for translating the field #2460
|
200 |
+
* Fixed: Problem with pagination links in AMP #3313
|
201 |
+
* Fixed: AMP Page Builder options not working due to Groovy Menu Plugin #3226
|
202 |
+
* Fixed: Analytics not working due to Glue for Yoast SEO & AMP plugin #3153
|
203 |
+
* Fixed: Yoast Meta Description not being picked up #3290
|
204 |
+
* Fixed: ampforwp_new_gallery_images called multiple times resulting Fatal Error #3296
|
205 |
+
* Fixed: Error message comes after search in post or page in Swift theme #3309
|
206 |
+
* Fixed: Pages redirect to /amp/amp after last update #3270
|
207 |
+
* Fixed: Archive and Categoy not working properly with Swift design #3265
|
208 |
+
* Fixed: Fatal error when remove author meta name and date on AMP posts/articles in design-2 #3260
|
209 |
+
* Fixed: Lightbox for image does not work when link [anchor tag] attached to images #2695
|
210 |
+
* Fixed: Webp as featured image is not working in the single posts #2996
|
211 |
+
* Fixed: Redirection issue when visiting AMP version after clicking Non-AMP link in Header #2940
|
212 |
+
* Fixed: code imporved in the amp_loop_image #3084
|
213 |
+
* Fixed: Sidebar breaks the blog page design #3056
|
214 |
+
* Fixed: In content related posts in Design-3 images are not showing #3109
|
215 |
+
* Fixed: Close Button is not coming in iphone in swift theme #3107
|
216 |
+
* Fixed: AMP strings are not translatable #3169
|
217 |
+
* Fixed: Option Panel's tooltips code updated #3172
|
218 |
+
* Fixed: Table style is not loading in AMP Page #3204
|
219 |
+
* Fixed: H1 tag on Logo in design-swift #3231
|
220 |
+
* Fixed: Color of button not working properly in design-swift #3216
|
221 |
+
* Fixed: PHP Debug warning fixed #3128
|
222 |
+
|
223 |
+
|
224 |
= 0.9.97.57 (31st May 2019) =
|
225 |
* Improvements: Need to add description field in VideoObject Schema type #2846
|
226 |
* Improvements: Create an option for H1-H6 Heading Font Sizes for all the designs. #3035
|
@@ -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(){
|
@@ -1102,6 +1102,7 @@ if ( ! function_exists('ampforwp_exclude_posts') ) {
|
|
1102 |
$ampforwp_exclude_post = get_option('ampforwp_exclude_post');
|
1103 |
if ( false != $ampforwp_exclude_post ) {
|
1104 |
$exclude_post_values = $ampforwp_exclude_post;
|
|
|
1105 |
}
|
1106 |
}
|
1107 |
return $exclude_post_values;
|
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.58
|
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.58');
|
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(){
|
1102 |
$ampforwp_exclude_post = get_option('ampforwp_exclude_post');
|
1103 |
if ( false != $ampforwp_exclude_post ) {
|
1104 |
$exclude_post_values = $ampforwp_exclude_post;
|
1105 |
+
set_transient('ampforwp_exclude_post_transient', $exclude_post_values);
|
1106 |
}
|
1107 |
}
|
1108 |
return $exclude_post_values;
|
@@ -1,5 +1,37 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 0.9.97.57 (31st May 2019) =
|
4 |
* Improvements: Need to add description field in VideoObject Schema type #2846
|
5 |
* Improvements: Create an option for H1-H6 Heading Font Sizes for all the designs. #3035
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 0.9.97.58 (14th June 2019) =
|
4 |
+
* Improvements: Option for H1-H6 Heading Font Sizes for all the designs #3035
|
5 |
+
* Improvements: New filter to add the classes which have to be excluded in infinity scroll #3297
|
6 |
+
* Improvements: Additional options for the Rank Math SEO plugin #3314
|
7 |
+
* Improvements: Purge AMP CDN Cache added in Extension List #3324
|
8 |
+
* Fixed: After v0.9.97.57 error can't disable featured image #3272
|
9 |
+
* Fixed: Amp options panel's section code improved #3205
|
10 |
+
* Fixed: Matemo Switch UI issue #3041
|
11 |
+
* Fixed: Redux options for translating the field #2460
|
12 |
+
* Fixed: Problem with pagination links in AMP #3313
|
13 |
+
* Fixed: AMP Page Builder options not working due to Groovy Menu Plugin #3226
|
14 |
+
* Fixed: Analytics not working due to Glue for Yoast SEO & AMP plugin #3153
|
15 |
+
* Fixed: Yoast Meta Description not being picked up #3290
|
16 |
+
* Fixed: ampforwp_new_gallery_images called multiple times resulting Fatal Error #3296
|
17 |
+
* Fixed: Error message comes after search in post or page in Swift theme #3309
|
18 |
+
* Fixed: Pages redirect to /amp/amp after last update #3270
|
19 |
+
* Fixed: Archive and Categoy not working properly with Swift design #3265
|
20 |
+
* Fixed: Fatal error when remove author meta name and date on AMP posts/articles in design-2 #3260
|
21 |
+
* Fixed: Lightbox for image does not work when link [anchor tag] attached to images #2695
|
22 |
+
* Fixed: Webp as featured image is not working in the single posts #2996
|
23 |
+
* Fixed: Redirection issue when visiting AMP version after clicking Non-AMP link in Header #2940
|
24 |
+
* Fixed: code imporved in the amp_loop_image #3084
|
25 |
+
* Fixed: Sidebar breaks the blog page design #3056
|
26 |
+
* Fixed: In content related posts in Design-3 images are not showing #3109
|
27 |
+
* Fixed: Close Button is not coming in iphone in swift theme #3107
|
28 |
+
* Fixed: AMP strings are not translatable #3169
|
29 |
+
* Fixed: Option Panel's tooltips code updated #3172
|
30 |
+
* Fixed: Table style is not loading in AMP Page #3204
|
31 |
+
* Fixed: H1 tag on Logo in design-swift #3231
|
32 |
+
* Fixed: Color of button not working properly in design-swift #3216
|
33 |
+
* Fixed: PHP Debug warning fixed #3128
|
34 |
+
|
35 |
= 0.9.97.57 (31st May 2019) =
|
36 |
* Improvements: Need to add description field in VideoObject Schema type #2846
|
37 |
* Improvements: Create an option for H1-H6 Heading Font Sizes for all the designs. #3035
|
@@ -148,7 +148,7 @@ if( ! class_exists('AMPforWP_Infinite_Scroll') ) {
|
|
148 |
if ( 4 == $design ) {
|
149 |
$classes = array(".p-m-fl",".loop-pagination",".footer",".r-pf",".srp ul",".srp h3","#pagination",".h_m_w", ".f-w");
|
150 |
}
|
151 |
-
|
152 |
return json_encode($classes);
|
153 |
}
|
154 |
public function next_posts_link( $next_link , $paged ) {
|
148 |
if ( 4 == $design ) {
|
149 |
$classes = array(".p-m-fl",".loop-pagination",".footer",".r-pf",".srp ul",".srp h3","#pagination",".h_m_w", ".f-w");
|
150 |
}
|
151 |
+
$classes = (array) apply_filters('ampforwp_infinite_scroll_exclude_items', $classes);
|
152 |
return json_encode($classes);
|
153 |
}
|
154 |
public function next_posts_link( $next_link , $paged ) {
|
@@ -287,36 +287,6 @@ public function front_end($params) {
|
|
287 |
}// Class closed
|
288 |
|
289 |
// Add Caption in the Gallery Image
|
290 |
-
add_filter('amp_gallery_images','
|
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 |
-
|
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 |
-
}
|
287 |
}// Class closed
|
288 |
|
289 |
// Add Caption in the Gallery Image
|
290 |
+
add_filter('amp_gallery_images','ampforwp_new_gallery_images', 10, 3);
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
|
292 |
+
add_filter('amp_thumbnail_images','ampforwp_new_thumbnail_images',10,3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -26,6 +26,7 @@ class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Han
|
|
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'));
|
@@ -306,36 +307,6 @@ class AMP_Rev_Slider_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_Embed_Han
|
|
306 |
}// Class closed
|
307 |
|
308 |
// Add Caption in the Gallery Image
|
309 |
-
add_filter('amp_gallery_images','
|
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 |
-
|
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 |
-
}
|
26 |
}
|
27 |
|
28 |
public function shortcode( $args, $mid_content = null ) {
|
29 |
+
global $post;
|
30 |
extract(shortcode_atts(array('alias' => ''), $args, 'rev_slider'));
|
31 |
extract(shortcode_atts(array('settings' => ''), $args, 'rev_slider'));
|
32 |
extract(shortcode_atts(array('order' => ''), $args, 'rev_slider'));
|
307 |
}// Class closed
|
308 |
|
309 |
// Add Caption in the Gallery Image
|
310 |
+
add_filter('amp_gallery_images','ampforwp_new_gallery_images', 10, 3);
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
|
312 |
+
add_filter('amp_thumbnail_images','ampforwp_new_thumbnail_images',10,3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -288,36 +288,6 @@ class AMPFORWP_Slide_Anything_Embed_Handler extends AMPforWP\AMPVendor\AMP_Base_
|
|
288 |
}// Class closed
|
289 |
|
290 |
// Add Caption in the Gallery Image
|
291 |
-
add_filter('amp_gallery_images','
|
292 |
-
function ampforwp_new_gallery_images($images_markup, $image, $markup_arr){
|
293 |
-
add_action('amp_post_template_css', 'AMPforWP\\AMPVendor\\ampforwp_additional_gallery_style');
|
294 |
-
add_filter('amp_post_template_data','ampforwp_carousel_bind_script');
|
295 |
-
add_action('amp_post_template_css', 'ampforwp_additional_style_carousel_caption');
|
296 |
-
return $images_markup;
|
297 |
-
}
|
298 |
|
299 |
-
|
300 |
-
function ampforwp_additional_gallery_style(){
|
301 |
-
global $redux_builder_amp,$carousel_markup_all;
|
302 |
-
$design_type = '';
|
303 |
-
$design_type = $redux_builder_amp['ampforwp-gallery-design-type'];
|
304 |
-
|
305 |
-
if(isset($design_type) && $design_type!==''){
|
306 |
-
echo $carousel_markup_all[$design_type]['gallery_css'];
|
307 |
-
}
|
308 |
-
}
|
309 |
-
}
|
310 |
-
|
311 |
-
add_filter('amp_thumbnail_images','AMPforWP\\AMPVendor\\ampforwp_new_thumbnail_images',10,3);
|
312 |
-
function ampforwp_new_thumbnail_images($amp_images, $uniqueid, $markup_arr){
|
313 |
-
if(!isset($markup_arr['carousel_with_thumbnail_html'])){return '';}
|
314 |
-
$amp_thumb_image_buttons = '';
|
315 |
-
foreach ($amp_images as $key => $value) {
|
316 |
-
$returnHtml = $markup_arr['carousel_with_thumbnail_html'];
|
317 |
-
$returnHtml = str_replace('{{thumbnail}}', $value , $returnHtml);
|
318 |
-
$returnHtml = str_replace('{{unique_id}}', $uniqueid , $returnHtml);
|
319 |
-
$returnHtml = str_replace('{{unique_index}}', $key , $returnHtml);
|
320 |
-
$amp_thumb_image_buttons[$key] = $returnHtml;
|
321 |
-
}
|
322 |
-
return $amp_thumb_image_buttons;
|
323 |
-
}
|
288 |
}// Class closed
|
289 |
|
290 |
// Add Caption in the Gallery Image
|
291 |
+
add_filter('amp_gallery_images','ampforwp_new_gallery_images', 10, 3);
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
|
293 |
+
add_filter('amp_thumbnail_images','ampforwp_new_thumbnail_images',10,3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -5,6 +5,7 @@ global $redux_builder_amp;
|
|
5 |
$ampforwpTemplate = '';
|
6 |
$loadComponent = array();
|
7 |
$scriptComponent = array();
|
|
|
8 |
$supportComponent = array('AMP-search','AMP-menu','AMP-alter-menu','AMP-logo','AMP-social-icons','AMP-sidebar','AMP-featured-image','AMP-author-box','AMP-loop','AMP-categories-tags','AMP-comments','AMP-post-navigation','AMP-related-posts','AMP-post-pagination','AMP-call-now', 'AMP-breadcrumb','AMP-gdpr');
|
9 |
|
10 |
add_filter( 'amp_post_template_data', 'ampforwp_framework_add_and_form_scripts',20);
|
5 |
$ampforwpTemplate = '';
|
6 |
$loadComponent = array();
|
7 |
$scriptComponent = array();
|
8 |
+
$search_found = false;
|
9 |
$supportComponent = array('AMP-search','AMP-menu','AMP-alter-menu','AMP-logo','AMP-social-icons','AMP-sidebar','AMP-featured-image','AMP-author-box','AMP-loop','AMP-categories-tags','AMP-comments','AMP-post-navigation','AMP-related-posts','AMP-post-pagination','AMP-call-now', 'AMP-breadcrumb','AMP-gdpr');
|
10 |
|
11 |
add_filter( 'amp_post_template_data', 'ampforwp_framework_add_and_form_scripts',20);
|
@@ -21,7 +21,7 @@ function ampforwp_framework_get_featured_image(){
|
|
21 |
}elseif (has_post_thumbnail( $post_id ) ){
|
22 |
$thumb_id = get_post_thumbnail_id($post_id);
|
23 |
$post_content = $post->post_content;
|
24 |
-
if ( true !== apply_filters('ampforwp_allow_featured_image', false) && ( false !== strpos( $post_content, 'wp-image-' . $thumb_id ) || false !== strpos( $post_content, 'attachment_' . $thumb_id ) ) ) {
|
25 |
return;
|
26 |
}
|
27 |
$image_size = apply_filters( 'ampforwp_featured_image_size', 'full' );
|
@@ -35,7 +35,13 @@ function ampforwp_framework_get_featured_image(){
|
|
35 |
$alt = get_the_title( $post_id );
|
36 |
}
|
37 |
$alt = esc_attr($alt);
|
38 |
-
if( $image ){
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
$amp_html = "<amp-img src='$image[0]' width='$image[1]' height='$image[2]' layout=responsive alt='$alt'></amp-img>";
|
40 |
}
|
41 |
}
|
21 |
}elseif (has_post_thumbnail( $post_id ) ){
|
22 |
$thumb_id = get_post_thumbnail_id($post_id);
|
23 |
$post_content = $post->post_content;
|
24 |
+
if ( ampforwp_webp_featured_image() && true !== apply_filters('ampforwp_allow_featured_image', false) && ( false !== strpos( $post_content, 'wp-image-' . $thumb_id ) || false !== strpos( $post_content, 'attachment_' . $thumb_id ) ) ) {
|
25 |
return;
|
26 |
}
|
27 |
$image_size = apply_filters( 'ampforwp_featured_image_size', 'full' );
|
35 |
$alt = get_the_title( $post_id );
|
36 |
}
|
37 |
$alt = esc_attr($alt);
|
38 |
+
if( $image ){
|
39 |
+
if(empty($image[1])){
|
40 |
+
$image[1] = 1000;
|
41 |
+
}
|
42 |
+
if(empty($image[2])){
|
43 |
+
$image[2] = 600;
|
44 |
+
}
|
45 |
$amp_html = "<amp-img src='$image[0]' width='$image[1]' height='$image[2]' layout=responsive alt='$alt'></amp-img>";
|
46 |
}
|
47 |
}
|
@@ -10,7 +10,7 @@ function ampforwp_framework_get_logo(){
|
|
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') ).'?
|
14 |
$set_rel_to_noamp = true;
|
15 |
}
|
16 |
$ampforwp_home_url = apply_filters('ampforwp_header_url', $ampforwp_home_url); ?>
|
@@ -19,6 +19,11 @@ function ampforwp_framework_get_logo(){
|
|
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 }
|
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') ).'?nonamphead=1';
|
14 |
$set_rel_to_noamp = true;
|
15 |
}
|
16 |
$ampforwp_home_url = apply_filters('ampforwp_header_url', $ampforwp_home_url); ?>
|
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 if( ampforwp_is_home() || ampforwp_is_blog() ){ ?>
|
23 |
+
<h1 class="hide">
|
24 |
+
<?php bloginfo('name'); ?>
|
25 |
+
</h1>
|
26 |
+
<?php } ?>
|
27 |
<?php } else { if(is_single()){ ?>
|
28 |
<h2> <?php } else{?><h1><?php }?>
|
29 |
<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 }
|
@@ -210,6 +210,9 @@ function amp_loop($selection,$data=array()){
|
|
210 |
call_loops_standard($data);
|
211 |
echo "<div class='loop-wrapper'>";
|
212 |
}
|
|
|
|
|
|
|
213 |
if ( !isset($ampLoopData['no_data']) ) :
|
214 |
switch($selection){
|
215 |
case 'start':
|
@@ -379,9 +382,11 @@ function amp_loop_image( $data=array() ) {
|
|
379 |
$tag = $data['tag'];
|
380 |
}
|
381 |
|
382 |
-
if ( isset($data['responsive']) && $data['responsive']
|
383 |
$layout_responsive = 'layout=responsive';
|
384 |
-
|
|
|
|
|
385 |
|
386 |
if ( isset($data['tag_class']) && $data['tag_class'] != "" ) {
|
387 |
$tag_class = $data['tag_class'];
|
210 |
call_loops_standard($data);
|
211 |
echo "<div class='loop-wrapper'>";
|
212 |
}
|
213 |
+
if ( false == $amp_q->have_posts() ) {
|
214 |
+
return;
|
215 |
+
}
|
216 |
if ( !isset($ampLoopData['no_data']) ) :
|
217 |
switch($selection){
|
218 |
case 'start':
|
382 |
$tag = $data['tag'];
|
383 |
}
|
384 |
|
385 |
+
if ( isset($data['responsive']) && ( $data['responsive'] == "responsive" || $data['responsive'] == 'true' ) ) {
|
386 |
$layout_responsive = 'layout=responsive';
|
387 |
+
}elseif (isset($data['responsive']) && $data['responsive'] == "fill" ) {
|
388 |
+
$layout_responsive = 'layout=fill';
|
389 |
+
}
|
390 |
|
391 |
if ( isset($data['tag_class']) && $data['tag_class'] != "" ) {
|
392 |
$tag_class = $data['tag_class'];
|
@@ -24,12 +24,14 @@ function amp_menu_html($echo, $menu_args, $type){
|
|
24 |
$menu_html_content = apply_filters('ampforwp_menu_content', $menu_html_content);
|
25 |
$sanitizer_obj = new AMPFORWP_Content( $menu_html_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(), 'AMP_Style_Sanitizer' => array(), ) ) );
|
26 |
$sanitized_menu = $sanitizer_obj->get_amp_content();
|
27 |
-
if ( '
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
33 |
return $sanitized_menu;
|
34 |
}
|
35 |
}
|
24 |
$menu_html_content = apply_filters('ampforwp_menu_content', $menu_html_content);
|
25 |
$sanitizer_obj = new AMPFORWP_Content( $menu_html_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(), 'AMP_Style_Sanitizer' => array(), ) ) );
|
26 |
$sanitized_menu = $sanitizer_obj->get_amp_content();
|
27 |
+
if ( !class_exists('Sitepress') ) {
|
28 |
+
if ( 'header' == $type ) {
|
29 |
+
set_transient('ampforwp_header_menu', $sanitized_menu, 24*HOUR_IN_SECONDS );
|
30 |
+
}
|
31 |
+
elseif ('footer' == $type) {
|
32 |
+
set_transient('ampforwp_footer_menu', $sanitized_menu, 24*HOUR_IN_SECONDS );
|
33 |
+
}
|
34 |
+
}
|
35 |
return $sanitized_menu;
|
36 |
}
|
37 |
}
|
@@ -571,8 +571,11 @@ visibility: hidden;
|
|
571 |
right: -26px;
|
572 |
margin-bottom: 6px !important;
|
573 |
opacity: 0;
|
574 |
-
transition: opacity 0.3s;
|
575 |
-
|
|
|
|
|
|
|
576 |
.afw-tooltip .afw-help-subtitle::after {
|
577 |
content: "";
|
578 |
position: absolute;
|
571 |
right: -26px;
|
572 |
margin-bottom: 6px !important;
|
573 |
opacity: 0;
|
574 |
+
transition: opacity 0.3s;
|
575 |
+
}
|
576 |
+
.afw-help-subtitle a{
|
577 |
+
color:#fff;
|
578 |
+
}
|
579 |
.afw-tooltip .afw-help-subtitle::after {
|
580 |
content: "";
|
581 |
position: absolute;
|
@@ -254,13 +254,13 @@ function ampforwp_analytics_options($opt_name){
|
|
254 |
),
|
255 |
array(
|
256 |
'id' => 'pa-feild',
|
|
|
257 |
'type' => 'text',
|
258 |
'title' => esc_html__( ' Matomo (Piwik) Analytics', 'accelerated-mobile-pages' ),
|
259 |
'required' => array(
|
260 |
array('ampforwp-Piwik-switch', '=' , '1')
|
261 |
),
|
262 |
-
'
|
263 |
-
'tooltip-subtitle' => esc_html__('Enter your Matomo (Piwik) Analytics URL.', 'accelerated-mobile-pages' ),
|
264 |
'default' => '#',
|
265 |
),
|
266 |
// Quantcast
|
254 |
),
|
255 |
array(
|
256 |
'id' => 'pa-feild',
|
257 |
+
'class' => 'child_opt',
|
258 |
'type' => 'text',
|
259 |
'title' => esc_html__( ' Matomo (Piwik) Analytics', 'accelerated-mobile-pages' ),
|
260 |
'required' => array(
|
261 |
array('ampforwp-Piwik-switch', '=' , '1')
|
262 |
),
|
263 |
+
'tooltip-subtitle' => sprintf('%s<a href="%s" target="_blank">%s</a>', esc_html__( 'Tutorial: ','accelerated-mobile-pages' ), esc_url('https://ampforwp.com/tutorials/article/how-to-add-matomo-piwik-analytics-in-amp/'), esc_html__( 'How to add Matomo Piwik Analytics in AMP?','accelerated-mobile-pages') ),
|
|
|
264 |
'default' => '#',
|
265 |
),
|
266 |
// Quantcast
|
@@ -307,11 +307,8 @@ function ampforwp_generate_meta_desc($json=""){
|
|
307 |
}
|
308 |
// Rank Math SEO #2701
|
309 |
if ( defined( 'RANK_MATH_FILE' ) && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
|
310 |
-
$rank_math_desc = '';
|
311 |
$rank_math_desc = RankMath\Post::get_meta( 'description', $post_id );
|
312 |
-
|
313 |
-
$desc = $rank_math_desc;
|
314 |
-
}
|
315 |
}
|
316 |
//Bridge Qode SEO Compatibility #2538
|
317 |
if ( function_exists('qode_header_meta') && 'bridge' == ampforwp_get_setting('ampforwp-seo-selection')){
|
@@ -373,12 +370,14 @@ if( !function_exists('ampforwp_get_blog_details') ) {
|
|
373 |
|
374 |
// 56. Multi Translation Feature #540
|
375 |
function ampforwp_translation( $redux_style_translation , $pot_style_translation ) {
|
376 |
-
|
377 |
-
$single_translation_enabled = $redux_builder_amp['amp-use-pot'];
|
378 |
if ( !$single_translation_enabled ) {
|
379 |
return $redux_style_translation;
|
380 |
} else {
|
381 |
-
|
|
|
|
|
|
|
382 |
}
|
383 |
}
|
384 |
|
@@ -811,4 +810,88 @@ function checkAMPforPageBuilderStatus($postId){
|
|
811 |
$response = apply_filters( 'ampforwp_pagebuilder_status_modify', $response, $postId );
|
812 |
}
|
813 |
return $response;
|
814 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
}
|
308 |
// Rank Math SEO #2701
|
309 |
if ( defined( 'RANK_MATH_FILE' ) && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
|
|
|
310 |
$rank_math_desc = RankMath\Post::get_meta( 'description', $post_id );
|
311 |
+
$desc = $rank_math_desc ? $rank_math_desc : $desc;
|
|
|
|
|
312 |
}
|
313 |
//Bridge Qode SEO Compatibility #2538
|
314 |
if ( function_exists('qode_header_meta') && 'bridge' == ampforwp_get_setting('ampforwp-seo-selection')){
|
370 |
|
371 |
// 56. Multi Translation Feature #540
|
372 |
function ampforwp_translation( $redux_style_translation , $pot_style_translation ) {
|
373 |
+
$single_translation_enabled = ampforwp_get_setting('amp-use-pot');
|
|
|
374 |
if ( !$single_translation_enabled ) {
|
375 |
return $redux_style_translation;
|
376 |
} else {
|
377 |
+
if(!empty($redux_style_translation)){
|
378 |
+
$pot_style_translation = $redux_style_translation;
|
379 |
+
}
|
380 |
+
return __($pot_style_translation,'accelerated-mobile-pages');
|
381 |
}
|
382 |
}
|
383 |
|
810 |
$response = apply_filters( 'ampforwp_pagebuilder_status_modify', $response, $postId );
|
811 |
}
|
812 |
return $response;
|
813 |
+
}
|
814 |
+
|
815 |
+
// Gallery Code #3296
|
816 |
+
function ampforwp_new_gallery_images($images_markup, $image, $markup_arr){
|
817 |
+
add_action('amp_post_template_css', 'ampforwp_additional_gallery_style');
|
818 |
+
add_filter('amp_post_template_data','ampforwp_carousel_bind_script');
|
819 |
+
add_action('amp_post_template_css', 'ampforwp_additional_style_carousel_caption');
|
820 |
+
return $images_markup;
|
821 |
+
}
|
822 |
+
if( ! function_exists( 'ampforwp_additional_gallery_style' ) ){
|
823 |
+
function ampforwp_additional_gallery_style(){
|
824 |
+
global $redux_builder_amp,$carousel_markup_all;
|
825 |
+
$design_type = '';
|
826 |
+
$design_type = $redux_builder_amp['ampforwp-gallery-design-type'];
|
827 |
+
|
828 |
+
if(isset($design_type) && $design_type!==''){
|
829 |
+
echo $carousel_markup_all[$design_type]['gallery_css'];
|
830 |
+
}
|
831 |
+
}
|
832 |
+
}
|
833 |
+
// amp-bind for carousel with captions
|
834 |
+
function ampforwp_carousel_bind_script($data){
|
835 |
+
if( 1 == ampforwp_get_setting('ampforwp-gallery-design-type') || 2 == ampforwp_get_setting('ampforwp-gallery-design-type') ){
|
836 |
+
if ( empty( $data['amp_component_scripts']['amp-bind'] ) ) {
|
837 |
+
$data['amp_component_scripts']['amp-bind'] = 'https://cdn.ampproject.org/v0/amp-bind-0.1.js';
|
838 |
+
}
|
839 |
+
}
|
840 |
+
if( 3 == ampforwp_get_setting('ampforwp-gallery-design-type') || true == ampforwp_get_setting('ampforwp-gallery-lightbox') ){
|
841 |
+
if ( empty( $data['amp_component_scripts']['amp-image-lightbox'] ) ) {
|
842 |
+
$data['amp_component_scripts']['amp-image-lightbox'] = 'https://cdn.ampproject.org/v0/amp-image-lightbox-0.1.js';
|
843 |
+
}
|
844 |
+
}
|
845 |
+
return $data;
|
846 |
+
}
|
847 |
+
function ampforwp_new_thumbnail_images($amp_images, $uniqueid, $markup_arr){
|
848 |
+
if(!isset($markup_arr['carousel_with_thumbnail_html'])){return '';}
|
849 |
+
$amp_thumb_image_buttons = '';
|
850 |
+
foreach ($amp_images as $key => $value) {
|
851 |
+
$returnHtml = $markup_arr['carousel_with_thumbnail_html'];
|
852 |
+
$returnHtml = str_replace('{{thumbnail}}', $value , $returnHtml);
|
853 |
+
$returnHtml = str_replace('{{unique_id}}', $uniqueid , $returnHtml);
|
854 |
+
$returnHtml = str_replace('{{unique_index}}', $key , $returnHtml);
|
855 |
+
$amp_thumb_image_buttons[$key] = $returnHtml;
|
856 |
+
}
|
857 |
+
return $amp_thumb_image_buttons;
|
858 |
+
}
|
859 |
+
// Gallery Styling
|
860 |
+
if( ! function_exists( 'ampforwp_additional_style_carousel_caption' ) ){
|
861 |
+
function ampforwp_additional_style_carousel_caption(){ ?>
|
862 |
+
.collapsible-captions {--caption-height: 32px; --image-height: 100%; --caption-padding:1rem; --button-size: 28px; --caption-color: #f5f5f5;; --caption-bg-color: #111;}
|
863 |
+
.collapsible-captions * {
|
864 |
+
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
|
865 |
+
box-sizing: border-box;
|
866 |
+
}
|
867 |
+
.collapsible-captions .amp-carousel-container {position: relative; width: 100%;}
|
868 |
+
.collapsible-captions amp-img img {object-fit: contain; }
|
869 |
+
.collapsible-captions figure { margin: 0; padding: 0; }
|
870 |
+
.collapsible-captions figcaption { position: absolute; bottom: 0;width: 100%;
|
871 |
+
max-height: var(--caption-height);margin-bottom:0;
|
872 |
+
line-height: var(--caption-height);
|
873 |
+
padding: 0 var(--button-size) 0 5px;
|
874 |
+
white-space: nowrap;
|
875 |
+
overflow: hidden;
|
876 |
+
text-overflow: ellipsis;
|
877 |
+
transition: max-height 200ms cubic-bezier(0.4, 0, 0.2, 1);
|
878 |
+
z-index: 1000;
|
879 |
+
color: var(--caption-color);
|
880 |
+
background: rgba(0, 0, 0, 0.6);
|
881 |
+
}
|
882 |
+
.collapsible-captions figcaption.expanded {
|
883 |
+
line-height: inherit;
|
884 |
+
white-space: normal;
|
885 |
+
text-overflow: auto;
|
886 |
+
max-height: 100px;
|
887 |
+
overflow: auto;
|
888 |
+
}
|
889 |
+
.collapsible-captions figcaption:focus { outline: none; border: none; }
|
890 |
+
.collapsible-captions figcaption span { display: block; position: absolute;
|
891 |
+
top: calc((var(--caption-height) - var(--button-size)) / 2);
|
892 |
+
right: 2px; width: var(--button-size); height: var(--button-size);
|
893 |
+
line-height: var(--button-size); text-align: center; font-size: 12px; color: inherit;
|
894 |
+
cursor: pointer; }
|
895 |
+
figcaption{ margin-bottom: 20px; }
|
896 |
+
<?php }
|
897 |
+
}
|
@@ -13,8 +13,8 @@
|
|
13 |
if (! empty( $redux_builder_amp['opt-media']['url'] ) ) {
|
14 |
$structured_data_main_logo = $redux_builder_amp['opt-media']['url'];
|
15 |
}
|
16 |
-
if (! empty(
|
17 |
-
$structured_data_logo = __(
|
18 |
}
|
19 |
if ( $structured_data_logo ) {
|
20 |
$structured_data_logo = $structured_data_logo;
|
@@ -72,7 +72,7 @@
|
|
72 |
if ( $post_image_check == false) {
|
73 |
|
74 |
if (! empty( ampforwp_get_setting('amp-structured-data-placeholder-image','url') ) ) {
|
75 |
-
$structured_data_image_url = esc_url(ampforwp_get_setting('amp-structured-data-placeholder-image','url'));
|
76 |
}
|
77 |
$structured_data_image = $structured_data_image_url;
|
78 |
$structured_data_height = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-height'));
|
@@ -87,7 +87,7 @@
|
|
87 |
}
|
88 |
// Custom Structured Data information for Archive, Categories and tag pages.
|
89 |
if ( is_archive() ) {
|
90 |
-
$structured_data_image = esc_url( ampforwp_get_setting('amp-structured-data-placeholder-image','url') );
|
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());
|
@@ -164,7 +164,7 @@ function ampforwp_search_or_homepage_or_staticpage_metadata( $metadata, $post )
|
|
164 |
$page = '';
|
165 |
// placeholder Image area
|
166 |
if (! empty( ampforwp_get_setting('amp-structured-data-placeholder-image','url') ) ) {
|
167 |
-
$structured_data_image_url = esc_url(ampforwp_get_setting('amp-structured-data-placeholder-image','url'));
|
168 |
}
|
169 |
$structured_data_image = $structured_data_image_url; // Placeholder Image URL
|
170 |
$structured_data_height = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-height')); // Placeholder Image width
|
@@ -319,8 +319,8 @@ if ( ! function_exists('ampforwp_structured_data_video_thumb') ) {
|
|
319 |
$structured_data_video_thumb_url = '';
|
320 |
// If there's no featured image, take default from settings
|
321 |
if ( false == $post_image ) {
|
322 |
-
if ( ! empty(
|
323 |
-
$structured_data_video_thumb_url = __(
|
324 |
}
|
325 |
}
|
326 |
// If featured image is present, take it as thumbnail
|
13 |
if (! empty( $redux_builder_amp['opt-media']['url'] ) ) {
|
14 |
$structured_data_main_logo = $redux_builder_amp['opt-media']['url'];
|
15 |
}
|
16 |
+
if (! empty( ampforwp_get_setting('amp-structured-data-logo','url') ) ) {
|
17 |
+
$structured_data_logo = esc_url( __(ampforwp_get_setting('amp-structured-data-logo','url'), 'accelerated-mobile-pages') );
|
18 |
}
|
19 |
if ( $structured_data_logo ) {
|
20 |
$structured_data_logo = $structured_data_logo;
|
72 |
if ( $post_image_check == false) {
|
73 |
|
74 |
if (! empty( ampforwp_get_setting('amp-structured-data-placeholder-image','url') ) ) {
|
75 |
+
$structured_data_image_url = esc_url(__(ampforwp_get_setting('amp-structured-data-placeholder-image','url'), 'accelerated-mobile-pages') );
|
76 |
}
|
77 |
$structured_data_image = $structured_data_image_url;
|
78 |
$structured_data_height = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-height'));
|
87 |
}
|
88 |
// Custom Structured Data information for Archive, Categories and tag pages.
|
89 |
if ( is_archive() ) {
|
90 |
+
$structured_data_image = esc_url( __(ampforwp_get_setting('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());
|
164 |
$page = '';
|
165 |
// placeholder Image area
|
166 |
if (! empty( ampforwp_get_setting('amp-structured-data-placeholder-image','url') ) ) {
|
167 |
+
$structured_data_image_url = esc_url(__(ampforwp_get_setting('amp-structured-data-placeholder-image','url'), 'accelerated-mobile-pages'));
|
168 |
}
|
169 |
$structured_data_image = $structured_data_image_url; // Placeholder Image URL
|
170 |
$structured_data_height = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-height')); // Placeholder Image width
|
319 |
$structured_data_video_thumb_url = '';
|
320 |
// If there's no featured image, take default from settings
|
321 |
if ( false == $post_image ) {
|
322 |
+
if ( ! empty( ampforwp_get_setting('amporwp-structured-data-video-thumb-url','url') ) ) {
|
323 |
+
$structured_data_video_thumb_url = esc_url( __(ampforwp_get_setting('amporwp-structured-data-video-thumb-url','url'), 'accelerated-mobile-pages') );
|
324 |
}
|
325 |
}
|
326 |
// If featured image is present, take it as thumbnail
|
@@ -427,6 +427,20 @@ $extension_listing_array = array(
|
|
427 |
'is_activated'=>(is_plugin_active('structured-data-for-wp/structured-data-for-wp.php')? 1: 2),
|
428 |
//'settingUrl'=>'',
|
429 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
array(
|
431 |
'name'=>'Polylang For AMP',
|
432 |
'desc'=>'Polylang compatibility with AMP',
|
@@ -589,12 +603,15 @@ foreach ($extension_listing_array as $key => $extension) {
|
|
589 |
$ampforwp_extension_list_html .= "</ul><h3 style='display:block;'>All Extensions</h3><ul>";
|
590 |
$secondPageClickClass = 'goToSecondPage';
|
591 |
}
|
592 |
-
|
|
|
|
|
|
|
593 |
'.$onclickUrl.'
|
594 |
-
<div class="align_left"><img src="'
|
595 |
<div class="extension_desc">
|
596 |
-
<h2>'
|
597 |
-
<p>'
|
598 |
'.$pluginReview.'
|
599 |
</div>
|
600 |
'.$onclickUrlclose.' '.$settingPageUrl.'</li>';
|
@@ -1587,6 +1604,33 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1587 |
),
|
1588 |
'default' => ampforwp_seo_default(),
|
1589 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1590 |
array(
|
1591 |
'class' => 'child_opt child_opt_arrow',
|
1592 |
'id' => 'ampforwp-seo-yoast-meta',
|
@@ -1651,7 +1695,7 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1651 |
'id' => 'amp-inspection-tool',
|
1652 |
'type' => 'switch',
|
1653 |
'title' => esc_html__('URL Inspection Tool Compatibility', 'accelerated-mobile-pages'),
|
1654 |
-
'tooltip-subtitle' => esc_html__("You can read about it
|
1655 |
'default' => 1,
|
1656 |
),
|
1657 |
array(
|
@@ -2102,7 +2146,8 @@ Redux::setSection( $opt_name, array(
|
|
2102 |
'id' => 'fb-instant-crawler-ingestion',
|
2103 |
'type' => 'switch',
|
2104 |
'title' => esc_html__('Crawler Ingestion', 'accelerated-mobile-pages'),
|
2105 |
-
'tooltip-subtitle' =>
|
|
|
2106 |
'required' => array('fb-instant-article-switch', '=', 1)
|
2107 |
),
|
2108 |
array(
|
@@ -3019,6 +3064,18 @@ Redux::setSection( $opt_name, array(
|
|
3019 |
'required' => array(
|
3020 |
array('amp-design-selector', '=' , '4')
|
3021 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3022 |
),
|
3023 |
array(
|
3024 |
'id' => 'amp-opt-color-rgba-colorscheme',
|
@@ -3642,7 +3699,7 @@ Redux::setSection( $opt_name, array(
|
|
3642 |
'id' => 'signin-button-text-color',
|
3643 |
'class' => 'child_opt child_opt_arrow',
|
3644 |
'title' => esc_html__('CTA Text Color', 'accelerated-mobile-pages'),
|
3645 |
-
'tooltip-subtitle' => esc_html__('Choose the color for Button
|
3646 |
'type' => 'color_rgba',
|
3647 |
'default' => array(
|
3648 |
'color' => '#000',
|
@@ -3692,7 +3749,7 @@ Redux::setSection( $opt_name, array(
|
|
3692 |
'id' => 'ampforwp-amp-menu',
|
3693 |
'type' => 'switch',
|
3694 |
'title' => esc_html__('Navigation Menu', 'accelerated-mobile-pages'),
|
3695 |
-
'desc' => esc_html__( 'Add Menus to your AMP pages by clicking on this
|
3696 |
'tooltip-subtitle' => esc_html__('Enable/Disable Menu from header', 'accelerated-mobile-pages'),
|
3697 |
'true' => 'true',
|
3698 |
'false' => 'false',
|
@@ -4368,6 +4425,7 @@ $single_page_options = array(
|
|
4368 |
'indent' => true,
|
4369 |
'layout_type' => 'accordion',
|
4370 |
'accordion-open'=> 1,
|
|
|
4371 |
),
|
4372 |
// Swift
|
4373 |
array(
|
@@ -4928,6 +4986,7 @@ $single_page_options = array(
|
|
4928 |
'indent' => true,
|
4929 |
'layout_type' => 'accordion',
|
4930 |
'accordion-open'=> 1,
|
|
|
4931 |
),
|
4932 |
array(
|
4933 |
'id' => 'ampforwp-gallery-design-type',
|
@@ -5057,6 +5116,7 @@ else{
|
|
5057 |
'indent' => true,
|
5058 |
'layout_type' => 'accordion',
|
5059 |
'accordion-open'=> 1,
|
|
|
5060 |
),
|
5061 |
// Swift
|
5062 |
array(
|
@@ -5087,7 +5147,7 @@ else{
|
|
5087 |
'title' => esc_html__('Menu', 'accelerated-mobile-pages'),
|
5088 |
'default' => 1,
|
5089 |
'required' => array( array('amp-design-selector', '=' , '4') ),
|
5090 |
-
'tooltip-subtitle' => esc_html__( 'Add Menus to your AMP pages by clicking on this
|
5091 |
),
|
5092 |
array(
|
5093 |
'id' => 'amp-footer-link-non-amp-page',
|
@@ -5544,7 +5604,7 @@ else{
|
|
5544 |
array(
|
5545 |
'id' => 'amp-facebook-app-id',
|
5546 |
'title' => esc_html__('Facebook App ID', 'accelerated-mobile-pages'),
|
5547 |
-
'tooltip-subtitle' => esc_html__('In order to use Facebook share you need to register an app ID,
|
5548 |
'type' => 'text',
|
5549 |
'required' => array('enable-single-facebook-share', '=' , '1'),
|
5550 |
'placeholder' => esc_html__('Enter your facebook app id','accelerated-mobile-pages'),
|
427 |
'is_activated'=>(is_plugin_active('structured-data-for-wp/structured-data-for-wp.php')? 1: 2),
|
428 |
//'settingUrl'=>'',
|
429 |
),
|
430 |
+
array(
|
431 |
+
'name'=>'Purge AMP CDN Cache',
|
432 |
+
'class'=>'new-ext',
|
433 |
+
'label' => 'Purge AMP CDN Cache',
|
434 |
+
'desc'=>'Purge AMP CDN Cache on one click. Editors can update/purge the google cdn cache of amp post and pages in one click.',
|
435 |
+
'img_src'=>AMPFORWP_IMAGE_DIR . '/cache-icon.png',
|
436 |
+
'price'=>'$19',
|
437 |
+
'url_link'=>'https://ampforwp.com/addons/purge-amp-cdn-cache/#utm_source=options-panel&utm_medium=extension-tab_purge-amp-cdn-cache&utm_campaign=AMP%20Plugin',
|
438 |
+
'plugin_active_path'=> 'purge-amp-cdn-cache/purge-amp-cdn-cache.php',
|
439 |
+
'item_name'=>'Purge AMP CDN Cache',
|
440 |
+
'store_url'=>'https://accounts.ampforwp.com',
|
441 |
+
'is_activated'=>(is_plugin_active('purge-amp-cdn-cache/purge-amp-cdn-cache.php')? 1 : 2),
|
442 |
+
'settingUrl'=>admin_url( 'admin.php?page=update-amp-cache' ),
|
443 |
+
),
|
444 |
array(
|
445 |
'name'=>'Polylang For AMP',
|
446 |
'desc'=>'Polylang compatibility with AMP',
|
603 |
$ampforwp_extension_list_html .= "</ul><h3 style='display:block;'>All Extensions</h3><ul>";
|
604 |
$secondPageClickClass = 'goToSecondPage';
|
605 |
}
|
606 |
+
if ( isset($extension['class']) && $extension['class'] && !$currentStatus ) {
|
607 |
+
$secondPageClickClass = $secondPageClickClass. ' ' . $extension['class'];
|
608 |
+
}
|
609 |
+
$ampforwp_extension_list_html .= '<li class="first '.esc_attr($currentStatus).' '.esc_attr($secondPageClickClass).'" data-ext-details=\''.json_encode($extension).'\' data-ext-secure="'.wp_create_nonce('verify_extension').'">
|
610 |
'.$onclickUrl.'
|
611 |
+
<div class="align_left"><img src="'.esc_url($extension['img_src']).'" /></div>
|
612 |
<div class="extension_desc">
|
613 |
+
<h2>'.esc_html($extension['name']).'</h2>
|
614 |
+
<p>'.esc_html($extension['desc']).'</p>
|
615 |
'.$pluginReview.'
|
616 |
</div>
|
617 |
'.$onclickUrlclose.' '.$settingPageUrl.'</li>';
|
1604 |
),
|
1605 |
'default' => ampforwp_seo_default(),
|
1606 |
),
|
1607 |
+
array(
|
1608 |
+
'class' => 'child_opt child_opt_arrow',
|
1609 |
+
'id' => 'ampforwp-seo-rank_math-meta',
|
1610 |
+
'type' => 'switch',
|
1611 |
+
'tooltip-subtitle' => esc_html__('Adds Social and Open Graph Meta Tags from Rank Math', 'accelerated-mobile-pages'),
|
1612 |
+
'title' => esc_html__( 'Meta Tags from Rank Math', 'accelerated-mobile-pages' ),
|
1613 |
+
'default' => '1',
|
1614 |
+
'required' => array('ampforwp-seo-selection', '=' , 'rank_math'),
|
1615 |
+
),
|
1616 |
+
array(
|
1617 |
+
'class' => 'child_opt',
|
1618 |
+
'id' => 'ampforwp-seo-rank_math-schema',
|
1619 |
+
'type' => 'switch',
|
1620 |
+
'tooltip-subtitle' => esc_html__('Adds Rank Math ld+json for AMP page', 'accelerated-mobile-pages'),
|
1621 |
+
'title' => esc_html__( 'Rank Math ld+json data', 'accelerated-mobile-pages' ),
|
1622 |
+
'default' => '1',
|
1623 |
+
'required' => array('ampforwp-seo-selection', '=' , 'rank_math'),
|
1624 |
+
),
|
1625 |
+
array(
|
1626 |
+
'class' => 'child_opt',
|
1627 |
+
'id' => 'ampforwp-seo-rank_math-canonical',
|
1628 |
+
'type' => 'switch',
|
1629 |
+
'tooltip-subtitle' => esc_html__('Pull Canonical from Rank Math for AMP pages', 'accelerated-mobile-pages'),
|
1630 |
+
'title' => esc_html__( 'Canonical from Rank Math', 'accelerated-mobile-pages' ),
|
1631 |
+
'default' => '1',
|
1632 |
+
'required' => array('ampforwp-seo-selection', '=' , 'rank_math'),
|
1633 |
+
),
|
1634 |
array(
|
1635 |
'class' => 'child_opt child_opt_arrow',
|
1636 |
'id' => 'ampforwp-seo-yoast-meta',
|
1695 |
'id' => 'amp-inspection-tool',
|
1696 |
'type' => 'switch',
|
1697 |
'title' => esc_html__('URL Inspection Tool Compatibility', 'accelerated-mobile-pages'),
|
1698 |
+
'tooltip-subtitle' => sprintf( '%s<a href="%s" target="_blank">%s</a>', esc_html__("You can read about it ",'accelerated-mobile-pages'),esc_url('https://webmasters.googleblog.com/2018/06/new-url-inspection-tool-more-in-search.html'),esc_html__('here','accelerated-mobile-pages')),
|
1699 |
'default' => 1,
|
1700 |
),
|
1701 |
array(
|
2146 |
'id' => 'fb-instant-crawler-ingestion',
|
2147 |
'type' => 'switch',
|
2148 |
'title' => esc_html__('Crawler Ingestion', 'accelerated-mobile-pages'),
|
2149 |
+
'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a>',
|
2150 |
+
esc_html__('Add ia:markup meta tag. Find out more about', 'accelerated-mobile-pages'), esc_url('https://developers.facebook.com/docs/instant-articles/crawler-ingestion'), esc_html__('here','accelerated-mobile-pages')),
|
2151 |
'required' => array('fb-instant-article-switch', '=', 1)
|
2152 |
),
|
2153 |
array(
|
3064 |
'required' => array(
|
3065 |
array('amp-design-selector', '=' , '4')
|
3066 |
)
|
3067 |
+
),
|
3068 |
+
array(
|
3069 |
+
'id' => 'swift-btn-hover-color-scheme',
|
3070 |
+
'title' => esc_html__('Button Hover Color', 'accelerated-mobile-pages'),
|
3071 |
+
'tooltip-subtitle' => esc_html__('Choose the color when hover for Button','accelerated-mobile-pages'),
|
3072 |
+
'type' => 'color_rgba',
|
3073 |
+
'default' => array(
|
3074 |
+
'color' => '#fff',
|
3075 |
+
),
|
3076 |
+
'required' => array(
|
3077 |
+
array('amp-design-selector', '=' , '4')
|
3078 |
+
)
|
3079 |
),
|
3080 |
array(
|
3081 |
'id' => 'amp-opt-color-rgba-colorscheme',
|
3699 |
'id' => 'signin-button-text-color',
|
3700 |
'class' => 'child_opt child_opt_arrow',
|
3701 |
'title' => esc_html__('CTA Text Color', 'accelerated-mobile-pages'),
|
3702 |
+
'tooltip-subtitle' => esc_html__('Choose the color for Button Text','accelerated-mobile-pages'),
|
3703 |
'type' => 'color_rgba',
|
3704 |
'default' => array(
|
3705 |
'color' => '#000',
|
3749 |
'id' => 'ampforwp-amp-menu',
|
3750 |
'type' => 'switch',
|
3751 |
'title' => esc_html__('Navigation Menu', 'accelerated-mobile-pages'),
|
3752 |
+
'desc' => sprintf( '%s <a href="%s" target="_blank">%s</a>',esc_html__( 'Add Menus to your AMP pages by clicking on this','accelerated-mobile-pages'), esc_url(trailingslashit(get_admin_url().'nav-menus.php?action=locations')),esc_html__('link','accelerated-mobile-pages')),
|
3753 |
'tooltip-subtitle' => esc_html__('Enable/Disable Menu from header', 'accelerated-mobile-pages'),
|
3754 |
'true' => 'true',
|
3755 |
'false' => 'false',
|
4425 |
'indent' => true,
|
4426 |
'layout_type' => 'accordion',
|
4427 |
'accordion-open'=> 1,
|
4428 |
+
'required' => array( array('amp-design-selector', '=' , '4') ),
|
4429 |
),
|
4430 |
// Swift
|
4431 |
array(
|
4986 |
'indent' => true,
|
4987 |
'layout_type' => 'accordion',
|
4988 |
'accordion-open'=> 1,
|
4989 |
+
'required' => array('amp-design-selector', '=' , '4'),
|
4990 |
),
|
4991 |
array(
|
4992 |
'id' => 'ampforwp-gallery-design-type',
|
5116 |
'indent' => true,
|
5117 |
'layout_type' => 'accordion',
|
5118 |
'accordion-open'=> 1,
|
5119 |
+
'required' => array( array('amp-design-selector', '=' , '4') ),
|
5120 |
),
|
5121 |
// Swift
|
5122 |
array(
|
5147 |
'title' => esc_html__('Menu', 'accelerated-mobile-pages'),
|
5148 |
'default' => 1,
|
5149 |
'required' => array( array('amp-design-selector', '=' , '4') ),
|
5150 |
+
'tooltip-subtitle' => sprintf( '%s <a href="%s" target="_blank">%s</a>',esc_html__( 'Add Menus to your AMP pages by clicking on this','accelerated-mobile-pages'), esc_url(trailingslashit(get_admin_url().'nav-menus.php?action=locations')),esc_html__('link','accelerated-mobile-pages')),
|
5151 |
),
|
5152 |
array(
|
5153 |
'id' => 'amp-footer-link-non-amp-page',
|
5604 |
array(
|
5605 |
'id' => 'amp-facebook-app-id',
|
5606 |
'title' => esc_html__('Facebook App ID', 'accelerated-mobile-pages'),
|
5607 |
+
'tooltip-subtitle' => sprintf( '%s <a style="color:#93FCFF;" href="%s" target="_blank">%s</a> %s <a style="color:#93FCFF;" href="%s" target="_blank">%s</a>',esc_html__('In order to use Facebook share you need to register an app ID','accelerated-mobile-pages'),esc_url("https://developers.facebook.com/apps"),esc_html__('here','accelerated-mobile-pages'),esc_html__('You can register one','accelerated-mobile-pages'),esc_url('https://developers.facebook.com/apps'),esc_html__('here','accelerated-mobile-pages') ),
|
5608 |
'type' => 'text',
|
5609 |
'required' => array('enable-single-facebook-share', '=' , '1'),
|
5610 |
'placeholder' => esc_html__('Enter your facebook app id','accelerated-mobile-pages'),
|
@@ -432,6 +432,16 @@ img.ampforwp-post-builder-img{
|
|
432 |
width: 370px;
|
433 |
border: 1px solid #eee;
|
434 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
435 |
#redux-intro-text .technical_support_btn_txt{
|
436 |
background: #fdfdfd;
|
437 |
box-shadow: 0px 0px 6px #ddd;
|
432 |
width: 370px;
|
433 |
border: 1px solid #eee;
|
434 |
}
|
435 |
+
.extension_listing li.new-ext:before {
|
436 |
+
content: "New";
|
437 |
+
position: absolute;
|
438 |
+
background: red;
|
439 |
+
padding: 10px 6px;
|
440 |
+
border-radius: 60em;
|
441 |
+
top: 2px;
|
442 |
+
left: -1px;
|
443 |
+
color: #fff;
|
444 |
+
}
|
445 |
#redux-intro-text .technical_support_btn_txt{
|
446 |
background: #fdfdfd;
|
447 |
box-shadow: 0px 0px 6px #ddd;
|
@@ -237,7 +237,10 @@ function ampforwp_redirection() {
|
|
237 |
}
|
238 |
// Check if we are on Mobile phones then start redirection process
|
239 |
if ( $redirectToAMP ) {
|
240 |
-
|
|
|
|
|
|
|
241 |
|
242 |
$_SESSION['ampforwp_amp_mode'] = 'mobile-on';
|
243 |
|
@@ -257,27 +260,34 @@ function ampforwp_redirection() {
|
|
257 |
$url = home_url( $wp->request );
|
258 |
}
|
259 |
$nonamp_checker = get_query_var( 'nonamp');
|
|
|
260 |
if($url){
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
}
|
271 |
-
$go_to_url = array_flip($go_to_url);
|
272 |
-
$go_to_url = implode('/', $go_to_url);
|
273 |
-
|
274 |
-
wp_safe_redirect( $go_to_url, 301 );
|
275 |
-
exit;
|
276 |
-
}
|
277 |
-
else{
|
278 |
-
return;
|
279 |
}
|
280 |
-
}
|
281 |
if ( ampforwp_is_amp_endpoint() && true == ampforwp_get_setting('amp-core-end-point') ){
|
282 |
$current_url = $endpoint = $new_url = '';
|
283 |
$current_url = home_url($wp->request);
|
@@ -302,6 +312,7 @@ function ampforwp_redirection() {
|
|
302 |
add_filter( 'query_vars', 'ampforwp_custom_query_var' );
|
303 |
function ampforwp_custom_query_var($vars) {
|
304 |
$vars[] = 'nonamp';
|
|
|
305 |
return $vars;
|
306 |
}
|
307 |
// #1947 ends here
|
237 |
}
|
238 |
// Check if we are on Mobile phones then start redirection process
|
239 |
if ( $redirectToAMP ) {
|
240 |
+
if(!isset($_GET['nonamphead']) && isset($_SESSION['nonamphead']) && in_array($url_to_redirect, $_SESSION['nonamphead'])){
|
241 |
+
return;
|
242 |
+
}
|
243 |
+
if (( ! isset($_SESSION['ampforwp_amp_mode']) || ! isset($_GET['nonamp'])) && !isset($_GET['nonamphead']) ) {
|
244 |
|
245 |
$_SESSION['ampforwp_amp_mode'] = 'mobile-on';
|
246 |
|
260 |
$url = home_url( $wp->request );
|
261 |
}
|
262 |
$nonamp_checker = get_query_var( 'nonamp');
|
263 |
+
$nonamphead_checker = get_query_var( 'nonamphead');
|
264 |
if($url){
|
265 |
+
if( $nonamp_checker == 1 ){
|
266 |
+
$go_to_url = remove_query_arg('nonamp', $url);
|
267 |
+
$go_to_url = explode('/', $go_to_url);
|
268 |
+
$go_to_url = array_flip($go_to_url);
|
269 |
+
if(true == ampforwp_get_setting('amp-core-end-point') || isset($go_to_url['?amp']) ){
|
270 |
+
unset($go_to_url['?amp']);
|
271 |
+
}
|
272 |
+
if(isset($go_to_url['amp'])){
|
273 |
+
unset($go_to_url['amp']);
|
274 |
+
}
|
275 |
+
$go_to_url = array_flip($go_to_url);
|
276 |
+
$go_to_url = implode('/', $go_to_url);
|
277 |
+
|
278 |
+
wp_safe_redirect( $go_to_url, 301 );
|
279 |
+
exit;
|
280 |
+
}elseif($nonamphead_checker == 1){
|
281 |
+
$go_to_url = home_url( $wp->request );
|
282 |
+
if($go_to_url){
|
283 |
+
$_SESSION['nonamphead'][ampforwp_url_controller($go_to_url)] = ampforwp_url_controller($go_to_url);
|
284 |
+
}
|
285 |
+
wp_safe_redirect( $go_to_url, 301 );
|
286 |
+
exit;
|
287 |
+
}else{
|
288 |
+
return;
|
289 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
}
|
|
|
291 |
if ( ampforwp_is_amp_endpoint() && true == ampforwp_get_setting('amp-core-end-point') ){
|
292 |
$current_url = $endpoint = $new_url = '';
|
293 |
$current_url = home_url($wp->request);
|
312 |
add_filter( 'query_vars', 'ampforwp_custom_query_var' );
|
313 |
function ampforwp_custom_query_var($vars) {
|
314 |
$vars[] = 'nonamp';
|
315 |
+
$vars[] = 'nonamphead';
|
316 |
return $vars;
|
317 |
}
|
318 |
// #1947 ends here
|
@@ -144,7 +144,7 @@ class AMP_Template_Customizer {
|
|
144 |
public function add_preview_scripts() {
|
145 |
wp_enqueue_script(
|
146 |
'amp-customizer',
|
147 |
-
|
148 |
array( 'jquery', 'customize-preview', 'wp-util' ),
|
149 |
$version = false,
|
150 |
$footer = true
|
144 |
public function add_preview_scripts() {
|
145 |
wp_enqueue_script(
|
146 |
'amp-customizer',
|
147 |
+
amp_get_asset_url( 'js/amp-customizer-preview.js' ),
|
148 |
array( 'jquery', 'customize-preview', 'wp-util' ),
|
149 |
$version = false,
|
150 |
$footer = true
|
@@ -47,7 +47,7 @@ function amp_post_template_add_boilerplate_css( $amp_template ) {
|
|
47 |
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
|
48 |
<?php
|
49 |
}
|
50 |
-
if(! is_plugin_active('structured-data-for-wp/structured-data-for-wp.php') && !
|
51 |
add_action( 'amp_post_template_footer', 'AMPforWP\\AMPVendor\\amp_post_template_add_schemaorg_metadata' );
|
52 |
function amp_post_template_add_schemaorg_metadata( $amp_template ) {
|
53 |
$metadata = $amp_template->get( 'metadata' );
|
47 |
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
|
48 |
<?php
|
49 |
}
|
50 |
+
if(! is_plugin_active('structured-data-for-wp/structured-data-for-wp.php') && ! is_plugin_active('schema-and-structured-data-for-wp/structured-data-for-wp.php') && ! ampforwp_get_setting('ampforwp-seo-rank_math-schema') ):
|
51 |
add_action( 'amp_post_template_footer', 'AMPforWP\\AMPVendor\\amp_post_template_add_schemaorg_metadata' );
|
52 |
function amp_post_template_add_schemaorg_metadata( $amp_template ) {
|
53 |
$metadata = $amp_template->get( 'metadata' );
|
@@ -202,13 +202,15 @@ class AMP_Post_Template {
|
|
202 |
'name' => $this->get( 'blog_name' ),
|
203 |
),
|
204 |
'headline' => $post_title,
|
205 |
-
'datePublished' => mysql2date( 'c', $this->post->post_date_gmt, false ),
|
206 |
'author' => array(
|
207 |
'@type' => 'Person',
|
208 |
'name' => $post_author_name,
|
209 |
'image' => $post_author_image,
|
210 |
),
|
211 |
);
|
|
|
|
|
|
|
212 |
if(isset($this->post->post_modified_gmt) && $this->post->post_modified_gmt ){
|
213 |
$metadata['dateModified'] = mysql2date( 'c', $this->post->post_modified_gmt, false );
|
214 |
}
|
202 |
'name' => $this->get( 'blog_name' ),
|
203 |
),
|
204 |
'headline' => $post_title,
|
|
|
205 |
'author' => array(
|
206 |
'@type' => 'Person',
|
207 |
'name' => $post_author_name,
|
208 |
'image' => $post_author_image,
|
209 |
),
|
210 |
);
|
211 |
+
if(isset($this->post->post_date_gmt) && $this->post->post_date_gmt ){
|
212 |
+
$metadata['datePublished'] = mysql2date( 'c', $this->post->post_date_gmt, false );
|
213 |
+
}
|
214 |
if(isset($this->post->post_modified_gmt) && $this->post->post_modified_gmt ){
|
215 |
$metadata['dateModified'] = mysql2date( 'c', $this->post->post_modified_gmt, false );
|
216 |
}
|
@@ -276,36 +276,6 @@ class AMP_Gallery_Embed_Handler extends AMP_Base_Embed_Handler {
|
|
276 |
}// Class closed
|
277 |
|
278 |
// Add Caption in the Gallery Image
|
279 |
-
add_filter('amp_gallery_images','
|
280 |
-
function ampforwp_new_gallery_images($images_markup, $image, $markup_arr){
|
281 |
-
add_action('amp_post_template_css', 'AMPforWP\\AMPVendor\\ampforwp_additional_gallery_style');
|
282 |
-
add_filter('ampforwp_post_template_data','ampforwp_carousel_bind_script');
|
283 |
-
add_action('amp_post_template_css', 'ampforwp_additional_style_carousel_caption');
|
284 |
-
return $images_markup;
|
285 |
-
}
|
286 |
|
287 |
-
|
288 |
-
function ampforwp_additional_gallery_style(){
|
289 |
-
global $redux_builder_amp,$carousel_markup_all;
|
290 |
-
$design_type = '';
|
291 |
-
$design_type = $redux_builder_amp['ampforwp-gallery-design-type'];
|
292 |
-
|
293 |
-
if(isset($design_type) && $design_type!==''){
|
294 |
-
echo $carousel_markup_all[$design_type]['gallery_css'];
|
295 |
-
}
|
296 |
-
}
|
297 |
-
}
|
298 |
-
|
299 |
-
add_filter('amp_thumbnail_images','AMPforWP\\AMPVendor\\ampforwp_new_thumbnail_images',10,3);
|
300 |
-
function ampforwp_new_thumbnail_images($amp_images, $uniqueid, $markup_arr){
|
301 |
-
if(!isset($markup_arr['carousel_with_thumbnail_html'])){return '';}
|
302 |
-
$amp_thumb_image_buttons = '';
|
303 |
-
foreach ($amp_images as $key => $value) {
|
304 |
-
$returnHtml = $markup_arr['carousel_with_thumbnail_html'];
|
305 |
-
$returnHtml = str_replace('{{thumbnail}}', $value , $returnHtml);
|
306 |
-
$returnHtml = str_replace('{{unique_id}}', $uniqueid , $returnHtml);
|
307 |
-
$returnHtml = str_replace('{{unique_index}}', $key , $returnHtml);
|
308 |
-
$amp_thumb_image_buttons[$key] = $returnHtml;
|
309 |
-
}
|
310 |
-
return $amp_thumb_image_buttons;
|
311 |
-
}
|
276 |
}// Class closed
|
277 |
|
278 |
// Add Caption in the Gallery Image
|
279 |
+
add_filter('amp_gallery_images','ampforwp_new_gallery_images', 10, 3);
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
|
281 |
+
add_filter('amp_thumbnail_images','ampforwp_new_thumbnail_images',10,3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -744,6 +744,8 @@ position: fixed;
|
|
744 |
padding: 0px 0px;
|
745 |
margin-top: 50px;
|
746 |
border-top: 1px solid #D8D8D8;
|
|
|
|
|
747 |
}
|
748 |
.modal-content{
|
749 |
height: 100vh;
|
744 |
padding: 0px 0px;
|
745 |
margin-top: 50px;
|
746 |
border-top: 1px solid #D8D8D8;
|
747 |
+
z-index: 99;
|
748 |
+
position: relative;
|
749 |
}
|
750 |
.modal-content{
|
751 |
height: 100vh;
|
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.2.1
|
7 |
-
Stable tag: 0.9.97.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -190,71 +190,36 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
190 |
|
191 |
== Changelog ==
|
192 |
|
193 |
-
= 0.9.97.
|
194 |
-
* Improvements:
|
195 |
-
* Improvements:
|
196 |
-
* Improvements:
|
197 |
-
* Improvements:
|
198 |
-
*
|
199 |
-
*
|
200 |
-
*
|
201 |
-
*
|
202 |
-
*
|
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 |
-
|
221 |
-
|
222 |
-
* Fixed:
|
223 |
-
|
224 |
-
= 0.9.97.55 (28th May 2019) =
|
225 |
-
* Improvement: Rank Math compatibility with V1.0.24 #3177
|
226 |
-
* Improvement: Related posts and Recent posts on custom posts types #2708
|
227 |
-
* Improvement: Appearance Designs for Related Posts #1545
|
228 |
-
* Improvement: Integration with EWWW IO and ExactDN. #2805
|
229 |
-
* Improvement: rel = "nofollow" to the links of social platforms in menu and footer, in all designs #2999
|
230 |
-
* Improvement: Option to display the Post title on Breadcrumb #3019
|
231 |
-
* Improvement: Map module in AMP pagebuilder #1629
|
232 |
-
* Improvement: Pagination support in category module of AMP pagebuilder #1676
|
233 |
-
* Improvement: Time Stamp support in category module of AMP pagebuilder #2648
|
234 |
-
* Improvement: Lightbox feature for Slider module of AMP pagebuilder #2646
|
235 |
-
* Improvement: Privacy page option in Notice Bar (Cookie Consent) #2347
|
236 |
-
* Improvement: SmartMag theme's Featured video Compatibility integrated #2559
|
237 |
-
* Improvement: New filter to modify the links of breadcrumbs, comment button and the non-amp version link in footer #2664
|
238 |
-
* Improvement: New filter to modify the single featured image #2896
|
239 |
-
* Improvement: "AMPforWP PageBuilder" option added in the page builder section #2414
|
240 |
-
* Fixed: PHP debug warning #3128
|
241 |
-
* Fixed: Fatal error after update 0.9.97.51 #3156
|
242 |
-
* Fixed: Unwanted code on username of comment in Design [1, 2 & 3] #3022
|
243 |
-
* Fixed: Issues with Content Sneak Peak Feature #2504
|
244 |
-
* Fixed: In Feature module of AMP pagebuilder, Bullet points are not aligned correctly #2554
|
245 |
-
* Fixed: Image URL replacement on AMP page not correct and aq_resizer not working with cdn images #2659
|
246 |
-
* Fixed: 'Twitter' Option and 'Pretty Permalinks for Twitter Share' Option generate the same URL #2662
|
247 |
-
* Fixed: Need to align the Radio Button (Show/Hide) in the Arabic language #2818
|
248 |
-
* Fixed: In NewsArticle, the ArticleBody and Description are missing from the AMP page #3005
|
249 |
-
* Fixed: WP Subtitle Compatibility code updated #3175
|
250 |
-
* Fixed: For Menu pages where AMP support is OFF, still getting added due to Auto Add AMP in Menu URL option #2897
|
251 |
-
* Fixed: E-commerce section code updated #3012
|
252 |
-
* Fixed: Pagebuilder section code updated #3014
|
253 |
-
* Fixed: 'Fix AMP Errors' section should not be displayed if he's a premium customer #3027
|
254 |
-
* Fixed: Use Ajax to fetch all Categories and tags in Featured Slider in Design-3 #2590
|
255 |
-
* Fixed: Debug error after enabling redirection #3174
|
256 |
-
* Fixed: The tag 'amp-next-page with inline config' appears more than once in the document #3214
|
257 |
-
* Fixed: Correct conditions for PageBuilder and Elementor for Page.php in Swift #3097
|
258 |
-
* Fixed: is_amp_endpoint issue - code updated #3055
|
259 |
|
260 |
Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.2.1
|
7 |
+
Stable tag: 0.9.97.58
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
190 |
|
191 |
== Changelog ==
|
192 |
|
193 |
+
= 0.9.97.58 (14th June 2019) =
|
194 |
+
* Improvements: Option for H1-H6 Heading Font Sizes for all the designs #3035
|
195 |
+
* Improvements: New filter to add the classes which have to be excluded in infinity scroll #3297
|
196 |
+
* Improvements: Additional options for the Rank Math SEO plugin #3314
|
197 |
+
* Improvements: Purge AMP CDN Cache added in Extension List #3324
|
198 |
+
* Fixed: After v0.9.97.57 error can't disable featured image #3272
|
199 |
+
* Fixed: Amp options panel's section code improved #3205
|
200 |
+
* Fixed: Matemo Switch UI issue #3041
|
201 |
+
* Fixed: Redux options for translating the field #2460
|
202 |
+
* Fixed: Problem with pagination links in AMP #3313
|
203 |
+
* Fixed: AMP Page Builder options not working due to Groovy Menu Plugin #3226
|
204 |
+
* Fixed: Analytics not working due to Glue for Yoast SEO & AMP plugin #3153
|
205 |
+
* Fixed: Yoast Meta Description not being picked up #3290
|
206 |
+
* Fixed: ampforwp_new_gallery_images called multiple times resulting Fatal Error #3296
|
207 |
+
* Fixed: Error message comes after search in post or page in Swift theme #3309
|
208 |
+
* Fixed: Pages redirect to /amp/amp after last update #3270
|
209 |
+
* Fixed: Archive and Categoy not working properly with Swift design #3265
|
210 |
+
* Fixed: Fatal error when remove author meta name and date on AMP posts/articles in design-2 #3260
|
211 |
+
* Fixed: Lightbox for image does not work when link [anchor tag] attached to images #2695
|
212 |
+
* Fixed: Webp as featured image is not working in the single posts #2996
|
213 |
+
* Fixed: Redirection issue when visiting AMP version after clicking Non-AMP link in Header #2940
|
214 |
+
* Fixed: code imporved in the amp_loop_image #3084
|
215 |
+
* Fixed: Sidebar breaks the blog page design #3056
|
216 |
+
* Fixed: In content related posts in Design-3 images are not showing #3109
|
217 |
+
* Fixed: Close Button is not coming in iphone in swift theme #3107
|
218 |
+
* Fixed: AMP strings are not translatable #3169
|
219 |
+
* Fixed: Option Panel's tooltips code updated #3172
|
220 |
+
* Fixed: Table style is not loading in AMP Page #3204
|
221 |
+
* Fixed: H1 tag on Logo in design-swift #3231
|
222 |
+
* Fixed: Color of button not working properly in design-swift #3216
|
223 |
+
* Fixed: PHP Debug warning fixed #3128
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
|
225 |
Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
|
@@ -22,9 +22,11 @@ if ( is_customize_preview() ) {
|
|
22 |
// Adding default Value
|
23 |
if ($data['elements'] == '') {
|
24 |
$data['elements'] = "bread_crumbs:1,meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,addthis:1,comments:1,related_posts:1";
|
25 |
-
}
|
26 |
-
|
27 |
-
|
|
|
|
|
28 |
}
|
29 |
|
30 |
if( isset( $data['elements'] ) || ! empty( $data['elements'] ) ){
|
22 |
// Adding default Value
|
23 |
if ($data['elements'] == '') {
|
24 |
$data['elements'] = "bread_crumbs:1,meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,addthis:1,comments:1,related_posts:1";
|
25 |
+
}
|
26 |
+
|
27 |
+
if(strpos($data['elements'], 'addthis:1') === false){
|
28 |
+
$addthis = substr_replace( $data['elements'], 'addthis:1,', 78, 0 );
|
29 |
+
$data['elements'] = $addthis;
|
30 |
}
|
31 |
|
32 |
if( isset( $data['elements'] ) || ! empty( $data['elements'] ) ){
|
@@ -4,28 +4,38 @@ $amp_html = "";
|
|
4 |
$caption = "";
|
5 |
$featured_image = "";
|
6 |
$featured_image = $this->get( 'featured_image' );
|
|
|
7 |
if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) ){
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
$
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
}
|
25 |
-
}
|
26 |
-
elseif ( true == ampforwp_get_setting('ampforwp-featured-image-from-content') && ampforwp_get_featured_image_from_content()) {
|
27 |
-
$amp_html = ampforwp_get_featured_image_from_content();
|
28 |
-
}
|
29 |
if( $amp_html ) {
|
30 |
?>
|
31 |
<figure class="amp-wp-article-featured-image wp-caption">
|
@@ -38,5 +48,7 @@ if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf
|
|
38 |
</figure>
|
39 |
<?php
|
40 |
}
|
|
|
|
|
41 |
}
|
42 |
do_action('ampforwp_after_featured_image_hook',$this);
|
4 |
$caption = "";
|
5 |
$featured_image = "";
|
6 |
$featured_image = $this->get( 'featured_image' );
|
7 |
+
|
8 |
if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) ){
|
9 |
+
|
10 |
+
$get_webp = $get_webp_type = "";
|
11 |
+
$get_webp = get_post_thumbnail_id($post->ID);
|
12 |
+
if ($get_webp ){
|
13 |
+
$get_webp_type = get_post_mime_type( $get_webp );
|
14 |
+
}
|
15 |
+
if(strpos($get_webp_type, "webp") !== false ){
|
16 |
+
ampforwp_webp_featured_image();
|
17 |
+
}
|
18 |
+
// Featured Video SmartMag theme Compatibility #2559
|
19 |
+
if(class_exists('Bunyad') && Bunyad::posts()->meta('featured_video') ){
|
20 |
+
global $wp_embed;
|
21 |
+
$videoContent = Bunyad::posts()->meta('featured_video');
|
22 |
+
$featured_video = $wp_embed->autoembed($videoContent);
|
23 |
+
$amp_html = ampforwp_content_sanitizer($featured_video);
|
24 |
+
}elseif ( $featured_image ) {
|
25 |
+
$amp_html = $featured_image['amp_html'];
|
26 |
+
$caption = $featured_image['caption'];
|
27 |
+
}
|
28 |
+
elseif ( ampforwp_is_custom_field_featured_image() ) {
|
29 |
+
$amp_img_src = ampforwp_cf_featured_image_src();
|
30 |
+
$amp_img_width = ampforwp_cf_featured_image_src('width');
|
31 |
+
$amp_img_height = ampforwp_cf_featured_image_src('height');
|
32 |
+
if( $amp_img_src ){
|
33 |
+
$amp_html = "<amp-img src='$amp_img_src' width=$amp_img_width height=$amp_img_height layout=responsive ></amp-img>";
|
34 |
+
}
|
35 |
+
}
|
36 |
+
elseif ( true == ampforwp_get_setting('ampforwp-featured-image-from-content') && ampforwp_get_featured_image_from_content()) {
|
37 |
+
$amp_html = ampforwp_get_featured_image_from_content();
|
38 |
}
|
|
|
|
|
|
|
|
|
39 |
if( $amp_html ) {
|
40 |
?>
|
41 |
<figure class="amp-wp-article-featured-image wp-caption">
|
48 |
</figure>
|
49 |
<?php
|
50 |
}
|
51 |
+
}else{
|
52 |
+
ampforwp_webp_featured_image();
|
53 |
}
|
54 |
do_action('ampforwp_after_featured_image_hook',$this);
|
@@ -20,7 +20,7 @@ wp_reset_postdata(); ?>
|
|
20 |
<h2><?php echo esc_attr( $this->get( 'blog_name' ) ); ?></h2>
|
21 |
<p class="copyright_txt"><?php
|
22 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
23 |
-
echo strip_tags( ampforwp_translation($redux_builder_amp['amp-translator-footer-text'], '
|
24 |
?></p>
|
25 |
<?php
|
26 |
if ( true == ampforwp_get_setting('ampforwp-footer-top') || true == ampforwp_get_setting('amp-footer-link-non-amp-page') ) { ?><p class="rightslink back-to-top"><?php
|
20 |
<h2><?php echo esc_attr( $this->get( 'blog_name' ) ); ?></h2>
|
21 |
<p class="copyright_txt"><?php
|
22 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
23 |
+
echo strip_tags( ampforwp_translation($redux_builder_amp['amp-translator-footer-text'], 'All Rights Reserved') ,$allowed_tags );
|
24 |
?></p>
|
25 |
<?php
|
26 |
if ( true == ampforwp_get_setting('ampforwp-footer-top') || true == ampforwp_get_setting('amp-footer-link-non-amp-page') ) { ?><p class="rightslink back-to-top"><?php
|
@@ -464,36 +464,36 @@ if(is_singular() || ampforwp_is_front_page()){?>
|
|
464 |
}
|
465 |
}
|
466 |
/*** H-1 to H-6 Font Sizes ***/
|
467 |
-
.amp-wp-content h1, .amp-wp-content h2, .amp-wp-content h3, .amp-wp-content h4, .amp-wp-content h5, .amp-wp-content h6{margin: 15px 0px;line-height: 1.4;}
|
468 |
<?php // H1 - H6 Font Sizes
|
469 |
if( ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h1') ){ ?>
|
470 |
-
.amp-wp-content h1{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h1_sz') )?>;}
|
471 |
<?php } else { ?>
|
472 |
-
.amp-wp-content h1 {font-size: 32px;}
|
473 |
<?php } //H1 ends
|
474 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h2') ){ ?>
|
475 |
-
.amp-wp-content h2{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h2_sz') )?>;}
|
476 |
<?php } else { ?>
|
477 |
-
.amp-wp-content h2 {font-size: 27px;}
|
478 |
<?php } // H2 Ends
|
479 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h3') ){ ?>
|
480 |
-
.amp-wp-content h3{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h3_sz') )?>;}
|
481 |
<?php } else { ?>
|
482 |
-
.amp-wp-content h3 {font-size: 24px;}
|
483 |
<?php } // H3 Ends
|
484 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h4') ){ ?>
|
485 |
-
.amp-wp-content h4{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h4_sz') )?>;}
|
486 |
<?php } else { ?>
|
487 |
-
.amp-wp-content h4 {font-size: 20px;}
|
488 |
<?php } // H4 Ends
|
489 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h5') ){ ?>
|
490 |
-
.amp-wp-content h5{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h5_sz') )?>;}
|
491 |
<?php } else { ?>
|
492 |
-
.amp-wp-content h5 {font-size: 17px;}
|
493 |
<?php } // H5 Ends
|
494 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h6') ){ ?>
|
495 |
-
.amp-wp-content h6{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h6_sz') )?>;}
|
496 |
<?php } else { ?>
|
497 |
-
.amp-wp-content h6 {font-size: 15px;}
|
498 |
<?php } // H6 Ends
|
499 |
// swift Content Heading Sizes Ends?>
|
464 |
}
|
465 |
}
|
466 |
/*** H-1 to H-6 Font Sizes ***/
|
467 |
+
.amp-wp-content.the_content h1, .amp-wp-content.the_content h2, .amp-wp-content.the_content h3, .amp-wp-content.the_content h4, .amp-wp-content.the_content h5, .amp-wp-content.the_content h6{margin: 15px 0px;line-height: 1.4;}
|
468 |
<?php // H1 - H6 Font Sizes
|
469 |
if( ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h1') ){ ?>
|
470 |
+
.amp-wp-content.the_content h1{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h1_sz') )?>;}
|
471 |
<?php } else { ?>
|
472 |
+
.amp-wp-content.the_content h1 {font-size: 32px;}
|
473 |
<?php } //H1 ends
|
474 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h2') ){ ?>
|
475 |
+
.amp-wp-content.the_content h2{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h2_sz') )?>;}
|
476 |
<?php } else { ?>
|
477 |
+
.amp-wp-content.the_content h2 {font-size: 27px;}
|
478 |
<?php } // H2 Ends
|
479 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h3') ){ ?>
|
480 |
+
.amp-wp-content.the_content h3{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h3_sz') )?>;}
|
481 |
<?php } else { ?>
|
482 |
+
.amp-wp-content.the_content h3 {font-size: 24px;}
|
483 |
<?php } // H3 Ends
|
484 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h4') ){ ?>
|
485 |
+
.amp-wp-content.the_content h4{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h4_sz') )?>;}
|
486 |
<?php } else { ?>
|
487 |
+
.amp-wp-content.the_content h4 {font-size: 20px;}
|
488 |
<?php } // H4 Ends
|
489 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h5') ){ ?>
|
490 |
+
.amp-wp-content.the_content h5{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h5_sz') )?>;}
|
491 |
<?php } else { ?>
|
492 |
+
.amp-wp-content.the_content h5 {font-size: 17px;}
|
493 |
<?php } // H5 Ends
|
494 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h6') ){ ?>
|
495 |
+
.amp-wp-content.the_content h6{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h6_sz') )?>;}
|
496 |
<?php } else { ?>
|
497 |
+
.amp-wp-content.the_content h6 {font-size: 15px;}
|
498 |
<?php } // H6 Ends
|
499 |
// swift Content Heading Sizes Ends?>
|
@@ -4,40 +4,52 @@ $amp_html = "";
|
|
4 |
$caption = "";
|
5 |
$featured_image = "";
|
6 |
$featured_image = $this->get( 'featured_image' );
|
|
|
7 |
if( $featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) ) {
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
$
|
12 |
-
|
13 |
-
$amp_html = ampforwp_content_sanitizer($featured_video);
|
14 |
-
}elseif ( $featured_image ) {
|
15 |
-
$amp_html = $featured_image['amp_html'];
|
16 |
-
$caption = $featured_image['caption'];
|
17 |
-
}
|
18 |
-
elseif ( ampforwp_is_custom_field_featured_image() ) {
|
19 |
-
$amp_img_src = ampforwp_cf_featured_image_src();
|
20 |
-
$amp_img_width = ampforwp_cf_featured_image_src('width');
|
21 |
-
$amp_img_height = ampforwp_cf_featured_image_src('height');
|
22 |
-
if( $amp_img_src ){
|
23 |
-
$amp_html = "<amp-img src='$amp_img_src' width=$amp_img_width height=$amp_img_height layout=responsive ></amp-img>";
|
24 |
}
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
if(
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
</p>
|
38 |
-
<?php endif; ?>
|
39 |
-
</figure>
|
40 |
-
</div> <?php
|
41 |
}
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
do_action('ampforwp_after_featured_image_hook',$this); ?>
|
4 |
$caption = "";
|
5 |
$featured_image = "";
|
6 |
$featured_image = $this->get( 'featured_image' );
|
7 |
+
|
8 |
if( $featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) ) {
|
9 |
+
|
10 |
+
$get_webp = $get_webp_type = "";
|
11 |
+
$get_webp = get_post_thumbnail_id($post->ID);
|
12 |
+
if ($get_webp ){
|
13 |
+
$get_webp_type = get_post_mime_type( $get_webp );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
+
if(strpos($get_webp_type, "webp") !== false ){
|
16 |
+
ampforwp_webp_featured_image();
|
17 |
+
}
|
18 |
+
// Featured Video SmartMag theme Compatibility #2559
|
19 |
+
if(class_exists('Bunyad') && Bunyad::posts()->meta('featured_video') ){
|
20 |
+
global $wp_embed;
|
21 |
+
$videoContent = Bunyad::posts()->meta('featured_video');
|
22 |
+
$featured_video = $wp_embed->autoembed($videoContent);
|
23 |
+
$amp_html = ampforwp_content_sanitizer($featured_video);
|
24 |
+
}elseif ( $featured_image ) {
|
25 |
+
$amp_html = $featured_image['amp_html'];
|
26 |
+
$caption = $featured_image['caption'];
|
|
|
|
|
|
|
|
|
27 |
}
|
28 |
+
elseif ( ampforwp_is_custom_field_featured_image() ) {
|
29 |
+
$amp_img_src = ampforwp_cf_featured_image_src();
|
30 |
+
$amp_img_width = ampforwp_cf_featured_image_src('width');
|
31 |
+
$amp_img_height = ampforwp_cf_featured_image_src('height');
|
32 |
+
if( $amp_img_src ){
|
33 |
+
$amp_html = "<amp-img src='$amp_img_src' width=$amp_img_width height=$amp_img_height layout=responsive ></amp-img>";
|
34 |
+
}
|
35 |
+
}
|
36 |
+
elseif ( true == ampforwp_get_setting('ampforwp-featured-image-from-content') && ampforwp_get_featured_image_from_content() ){
|
37 |
+
$amp_html = ampforwp_get_featured_image_from_content();
|
38 |
+
}
|
39 |
+
if( $amp_html ) {
|
40 |
+
?>
|
41 |
+
<div class="amp-wp-article-featured-image amp-wp-content featured-image-content">
|
42 |
+
<figure class="amp-wp-article-featured-image wp-caption">
|
43 |
+
<?php echo $amp_html; // amphtml content; no kses ?>
|
44 |
+
<?php if ( $caption ) : ?>
|
45 |
+
<p class="wp-caption-text">
|
46 |
+
<?php echo wp_kses_data( $caption ); ?>
|
47 |
+
</p>
|
48 |
+
<?php endif; ?>
|
49 |
+
</figure>
|
50 |
+
</div> <?php
|
51 |
+
}
|
52 |
+
}else{
|
53 |
+
ampforwp_webp_featured_image();
|
54 |
+
}
|
55 |
do_action('ampforwp_after_featured_image_hook',$this); ?>
|
@@ -24,7 +24,7 @@
|
|
24 |
}
|
25 |
};
|
26 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
27 |
-
echo strip_tags( ampforwp_translation($redux_builder_amp['amp-translator-footer-text'], '
|
28 |
?></p>
|
29 |
<?php do_action('amp_footer_link'); ?>
|
30 |
</div>
|
24 |
}
|
25 |
};
|
26 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
27 |
+
echo strip_tags( ampforwp_translation($redux_builder_amp['amp-translator-footer-text'], 'All Rights Reserved') ,$allowed_tags );
|
28 |
?></p>
|
29 |
<?php do_action('amp_footer_link'); ?>
|
30 |
</div>
|
@@ -600,36 +600,36 @@ if(is_singular() || ampforwp_is_front_page()){?>
|
|
600 |
}
|
601 |
}
|
602 |
/*** H-1 to H-6 Font Sizes ***/
|
603 |
-
.amp-wp-content h1, .amp-wp-content h2, .amp-wp-content h3, .amp-wp-content h4, .amp-wp-content h5, .amp-wp-content h6{margin: 15px 0px;}
|
604 |
<?php // H1 - H6 Font Sizes
|
605 |
if( ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h1') ){ ?>
|
606 |
-
.amp-wp-content h1{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h1_sz') )?>;}
|
607 |
<?php } else { ?>
|
608 |
-
.amp-wp-content h1 {font-size: 32px;}
|
609 |
<?php } //H1 ends
|
610 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h2') ){ ?>
|
611 |
-
.amp-wp-content h2{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h2_sz') )?>;}
|
612 |
<?php } else { ?>
|
613 |
-
.amp-wp-content h2 {font-size: 27px;}
|
614 |
<?php } // H2 Ends
|
615 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h3') ){ ?>
|
616 |
-
.amp-wp-content h3{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h3_sz') )?>;}
|
617 |
<?php } else { ?>
|
618 |
-
.amp-wp-content h3 {font-size: 24px;}
|
619 |
<?php } // H3 Ends
|
620 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h4') ){ ?>
|
621 |
-
.amp-wp-content h4{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h4_sz') )?>;}
|
622 |
<?php } else { ?>
|
623 |
-
.amp-wp-content h4 {font-size: 20px;}
|
624 |
<?php } // H4 Ends
|
625 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h5') ){ ?>
|
626 |
-
.amp-wp-content h5{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h5_sz') )?>;}
|
627 |
<?php } else { ?>
|
628 |
-
.amp-wp-content h5 {font-size: 17px;}
|
629 |
<?php } // H5 Ends
|
630 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h6') ){ ?>
|
631 |
-
.amp-wp-content h6{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h6_sz') )?>;}
|
632 |
<?php } else { ?>
|
633 |
-
.amp-wp-content h6 {font-size: 15px;}
|
634 |
<?php } // H6 Ends
|
635 |
// swift Content Heading Sizes Ends?>
|
600 |
}
|
601 |
}
|
602 |
/*** H-1 to H-6 Font Sizes ***/
|
603 |
+
.amp-wp-content.the_content h1, .amp-wp-content.the_content h2, .amp-wp-content.the_content h3, .amp-wp-content.the_content h4, .amp-wp-content.the_content h5, .amp-wp-content.the_content h6{margin: 15px 0px;}
|
604 |
<?php // H1 - H6 Font Sizes
|
605 |
if( ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h1') ){ ?>
|
606 |
+
.amp-wp-content.the_content h1{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h1_sz') )?>;}
|
607 |
<?php } else { ?>
|
608 |
+
.amp-wp-content.the_content h1 {font-size: 32px;}
|
609 |
<?php } //H1 ends
|
610 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h2') ){ ?>
|
611 |
+
.amp-wp-content.the_content h2{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h2_sz') )?>;}
|
612 |
<?php } else { ?>
|
613 |
+
.amp-wp-content.the_content h2 {font-size: 27px;}
|
614 |
<?php } // H2 Ends
|
615 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h3') ){ ?>
|
616 |
+
.amp-wp-content.the_content h3{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h3_sz') )?>;}
|
617 |
<?php } else { ?>
|
618 |
+
.amp-wp-content.the_content h3 {font-size: 24px;}
|
619 |
<?php } // H3 Ends
|
620 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h4') ){ ?>
|
621 |
+
.amp-wp-content.the_content h4{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h4_sz') )?>;}
|
622 |
<?php } else { ?>
|
623 |
+
.amp-wp-content.the_content h4 {font-size: 20px;}
|
624 |
<?php } // H4 Ends
|
625 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h5') ){ ?>
|
626 |
+
.amp-wp-content.the_content h5{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h5_sz') )?>;}
|
627 |
<?php } else { ?>
|
628 |
+
.amp-wp-content.the_content h5 {font-size: 17px;}
|
629 |
<?php } // H5 Ends
|
630 |
if(ampforwp_get_setting('swift_cnt') && ampforwp_get_setting('swift_cnt_h6') ){ ?>
|
631 |
+
.amp-wp-content.the_content h6{font-size:<?php echo esc_html( ampforwp_get_setting('swift_h6_sz') )?>;}
|
632 |
<?php } else { ?>
|
633 |
+
.amp-wp-content.the_content h6 {font-size: 15px;}
|
634 |
<?php } // H6 Ends
|
635 |
// swift Content Heading Sizes Ends?>
|
@@ -4,28 +4,38 @@ $featured_image = "";
|
|
4 |
$amp_html = "";
|
5 |
$caption = "";
|
6 |
$featured_image = $this->get( 'featured_image' );
|
|
|
7 |
if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) ){
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
$
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
}
|
25 |
-
}
|
26 |
-
elseif ( true == ampforwp_get_setting('ampforwp-featured-image-from-content') && ampforwp_get_featured_image_from_content() ){
|
27 |
-
$amp_html = ampforwp_get_featured_image_from_content();
|
28 |
-
}
|
29 |
if( $amp_html ) {
|
30 |
?>
|
31 |
<div class="amp-wp-article-featured-image amp-wp-content featured-image-content">
|
@@ -41,6 +51,8 @@ if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf
|
|
41 |
</div>
|
42 |
</div> <?php
|
43 |
}
|
|
|
|
|
44 |
}
|
45 |
|
46 |
do_action('ampforwp_after_featured_image_hook',$this); ?>
|
4 |
$amp_html = "";
|
5 |
$caption = "";
|
6 |
$featured_image = $this->get( 'featured_image' );
|
7 |
+
|
8 |
if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || true == $redux_builder_amp['ampforwp-featured-image-from-content'] || (class_exists('Bunyad') && Bunyad::posts()->meta('featured_video')) ){
|
9 |
+
|
10 |
+
$get_webp = $get_webp_type = "";
|
11 |
+
$get_webp = get_post_thumbnail_id($post->ID);
|
12 |
+
if ($get_webp ){
|
13 |
+
$get_webp_type = get_post_mime_type( $get_webp );
|
14 |
+
}
|
15 |
+
if(strpos($get_webp_type, "webp") !== false ){
|
16 |
+
ampforwp_webp_featured_image();
|
17 |
+
}
|
18 |
+
// Featured Video SmartMag theme Compatibility #2559
|
19 |
+
if(class_exists('Bunyad') && Bunyad::posts()->meta('featured_video') ){
|
20 |
+
global $wp_embed;
|
21 |
+
$videoContent = Bunyad::posts()->meta('featured_video');
|
22 |
+
$featured_video = $wp_embed->autoembed($videoContent);
|
23 |
+
$amp_html = ampforwp_content_sanitizer($featured_video);
|
24 |
+
}elseif ( $featured_image ) {
|
25 |
+
$amp_html = $featured_image['amp_html'];
|
26 |
+
$caption = $featured_image['caption'];
|
27 |
+
}
|
28 |
+
elseif ( ampforwp_is_custom_field_featured_image() ) {
|
29 |
+
$amp_img_src = ampforwp_cf_featured_image_src();
|
30 |
+
$amp_img_width = ampforwp_cf_featured_image_src('width');
|
31 |
+
$amp_img_height = ampforwp_cf_featured_image_src('height');
|
32 |
+
if( $amp_img_src ){
|
33 |
+
$amp_html = "<amp-img src='$amp_img_src' width=$amp_img_width height=$amp_img_height layout=responsive ></amp-img>";
|
34 |
+
}
|
35 |
+
}
|
36 |
+
elseif ( true == ampforwp_get_setting('ampforwp-featured-image-from-content') && ampforwp_get_featured_image_from_content() ){
|
37 |
+
$amp_html = ampforwp_get_featured_image_from_content();
|
38 |
}
|
|
|
|
|
|
|
|
|
39 |
if( $amp_html ) {
|
40 |
?>
|
41 |
<div class="amp-wp-article-featured-image amp-wp-content featured-image-content">
|
51 |
</div>
|
52 |
</div> <?php
|
53 |
}
|
54 |
+
}else{
|
55 |
+
ampforwp_webp_featured_image();
|
56 |
}
|
57 |
|
58 |
do_action('ampforwp_after_featured_image_hook',$this); ?>
|
@@ -72,7 +72,7 @@
|
|
72 |
} ?>
|
73 |
<p class="rightslink"><?php
|
74 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
75 |
-
echo strip_tags( ampforwp_translation($redux_builder_amp['amp-translator-footer-text'], '
|
76 |
if ( '1' == $redux_builder_amp['amp-footer-link-non-amp-page'] ) {
|
77 |
if ( $redux_builder_amp['amp-translator-footer-text'] ) { ?> | <?php ampforwp_view_nonamp(); }
|
78 |
else {
|
72 |
} ?>
|
73 |
<p class="rightslink"><?php
|
74 |
$allowed_tags = '<p><a><b><strong><i><u><ul><ol><li><h1><h2><h3><h4><h5><h6><table><tr><th><td><em><span>';
|
75 |
+
echo strip_tags( ampforwp_translation($redux_builder_amp['amp-translator-footer-text'], 'All Rights Reserved') ,$allowed_tags );
|
76 |
if ( '1' == $redux_builder_amp['amp-footer-link-non-amp-page'] ) {
|
77 |
if ( $redux_builder_amp['amp-translator-footer-text'] ) { ?> | <?php ampforwp_view_nonamp(); }
|
78 |
else {
|
@@ -308,6 +308,8 @@ main .amp-wp-content.relatedpost{ background: none; box-shadow: none; padding:0p
|
|
308 |
.no_related_thumbnail .related_link{ margin: 16px 5px 20px 5px; }
|
309 |
.related-post_image{ float: left; padding-right: 2%; width: 31.6%; overflow: hidden; margin-right: 15px; max-height: 122px; max-width: 110px; }
|
310 |
.related-post_image amp-img{ width: 144%; left: -20%; }
|
|
|
|
|
311 |
<?php }
|
312 |
} ?>
|
313 |
<?php if(!checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){ ?>
|
@@ -452,7 +454,7 @@ amp-user-notification button:hover{ cursor: pointer }
|
|
452 |
@media screen and (max-width: 768px){ .amp-wp-meta{ margin:10px 0px 15px 0px } .home-post_image{ width: 40%; } .amp-loop-list .amp-wp-post-content{ width: 58%; } .amp-loop-list .featured_time{line-height:1} .single-post main .amp-wp-content h1{ line-height:1.4; font-size: 30px;} }
|
453 |
@media screen and (max-width: 600px){ .amp-loop-list .amp-wp-tags{display:none} }
|
454 |
@media screen and (max-width: 530px){ .home-post_image{ width: 35%; } .amp-loop-list .amp-wp-post-content{ width: 63%; } .amp-wp-post-content p { font-size: 12px; } .related_posts ol li p { line-height: 1.6; margin: 7px 0 0 0;} .comments_list ul li .comment-body {width:auto} .amp-category-block li:nth-child(3) {margin:0} }
|
455 |
-
@media screen and (max-width: 425px){ .home-post_image{ /* width: 125px;*/ width: 31.6%; overflow: hidden; /* margin-right: 13px; */ margin-right: 3%; max-height: 122px } .home-post_image amp-img{ width: 144%; left: -20%; } h2.amp-wp-title{ margin-bottom: 7px; line-height: 1.31578947; font-size: 19px; position:relative;top:-3px } h2.amp-wp-title a{ color:#262626} .amp-loop-list{padding:25px 15px 22px 15px} .amp-loop-list .amp-wp-post-content{ width: 63%; } .related_posts .amp-loop-list .amp-wp-post-content .small-screen-excerpt-design-3 { display: block; } .related_posts .related_link a{ font-size: 18px; line-height: 1.7; } .ampforwp-tax-category{ padding-bottom:0 } .amp-wp-byline{ padding:0 } .related_posts .related_link a{ font-size: 17px; line-height: 1.5; } .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 26px;} .icono-share{display:none} .ampforwp-social-icons amp-social-share{ margin-right: 3px;} main .amp-wp-content{ font-size: 16px; line-height: 26px;} .single-post .amp_author_area .amp_author_area_wrapper{font-size:13px;} .amp-category-post{ font-size:12px; color:#666 } .large-screen-excerpt-design-3{ display:none;} }
|
456 |
@media screen and (max-width: 400px){ .amp-wp-title{ font-size: 19px; } }
|
457 |
@media screen and (max-width: 375px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 24px;} .amp-carousel-slide h1{ font-size: 22px; line-height: 32px; } #pagination .next a, #pagination .prev a{ color: #666; font-size: 14px; padding: 15px 0px; margin-top: -5px; }.related-title,.comments_list h3{ margin-top:15px; } #pagination .next{ margin-bottom:15px; } .related_posts .related_link {line-height: 1; } }
|
458 |
@media screen and (max-width: 340px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 22px;} h2.amp-wp-title{ line-height: 1.31578947; font-size: 17px; } .the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; } }
|
308 |
.no_related_thumbnail .related_link{ margin: 16px 5px 20px 5px; }
|
309 |
.related-post_image{ float: left; padding-right: 2%; width: 31.6%; overflow: hidden; margin-right: 15px; max-height: 122px; max-width: 110px; }
|
310 |
.related-post_image amp-img{ width: 144%; left: -20%; }
|
311 |
+
.ampforwp-inline-related-post .related_posts ol li amp-img {width: 100px;float:left;margin-right: 15px;}
|
312 |
+
.ampforwp-inline-related-post .related_posts ol li{box-shadow: 0 2px 3px rgba(0,0,0,.05);}
|
313 |
<?php }
|
314 |
} ?>
|
315 |
<?php if(!checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){ ?>
|
454 |
@media screen and (max-width: 768px){ .amp-wp-meta{ margin:10px 0px 15px 0px } .home-post_image{ width: 40%; } .amp-loop-list .amp-wp-post-content{ width: 58%; } .amp-loop-list .featured_time{line-height:1} .single-post main .amp-wp-content h1{ line-height:1.4; font-size: 30px;} }
|
455 |
@media screen and (max-width: 600px){ .amp-loop-list .amp-wp-tags{display:none} }
|
456 |
@media screen and (max-width: 530px){ .home-post_image{ width: 35%; } .amp-loop-list .amp-wp-post-content{ width: 63%; } .amp-wp-post-content p { font-size: 12px; } .related_posts ol li p { line-height: 1.6; margin: 7px 0 0 0;} .comments_list ul li .comment-body {width:auto} .amp-category-block li:nth-child(3) {margin:0} }
|
457 |
+
@media screen and (max-width: 425px){ .home-post_image{ /* width: 125px;*/ width: 31.6%; overflow: hidden; /* margin-right: 13px; */ margin-right: 3%; max-height: 122px } .home-post_image amp-img{ width: 144%; left: -20%; } h2.amp-wp-title{ margin-bottom: 7px; line-height: 1.31578947; font-size: 19px; position:relative;top:-3px } h2.amp-wp-title a{ color:#262626} .amp-loop-list{padding:25px 15px 22px 15px} .amp-loop-list .amp-wp-post-content{ width: 63%; } .related_posts .amp-loop-list .amp-wp-post-content .small-screen-excerpt-design-3 { display: block; } .related_posts .related_link a{ font-size: 18px; line-height: 1.7; } .ampforwp-tax-category{ padding-bottom:0 } .amp-wp-byline{ padding:0 } .related_posts .related_link a{ font-size: 17px; line-height: 1.5; } .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 26px;} .icono-share{display:none} .ampforwp-social-icons amp-social-share{ margin-right: 3px;} main .amp-wp-content{ font-size: 16px; line-height: 26px;} .single-post .amp_author_area .amp_author_area_wrapper{font-size:13px;} .amp-category-post{ font-size:12px; color:#666 } .large-screen-excerpt-design-3{ display:none;}.ampforwp-inline-related-post .related_posts ol li{padding:0px 0px 10px 0px;} }
|
458 |
@media screen and (max-width: 400px){ .amp-wp-title{ font-size: 19px; } }
|
459 |
@media screen and (max-width: 375px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 24px;} .amp-carousel-slide h1{ font-size: 22px; line-height: 32px; } #pagination .next a, #pagination .prev a{ color: #666; font-size: 14px; padding: 15px 0px; margin-top: -5px; }.related-title,.comments_list h3{ margin-top:15px; } #pagination .next{ margin-bottom:15px; } .related_posts .related_link {line-height: 1; } }
|
460 |
@media screen and (max-width: 340px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 22px;} h2.amp-wp-title{ line-height: 1.31578947; font-size: 17px; } .the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; } }
|
@@ -230,9 +230,9 @@ if( !ampforwp_levelup_compatibility('hf_builder_head') ){
|
|
230 |
<?php amp_logo(); ?>
|
231 |
</div>
|
232 |
<div class="h-2">
|
233 |
-
|
234 |
<div class="h-sing">
|
235 |
-
<a target="_blank" href="<?php echo
|
236 |
</div>
|
237 |
<?php } ?>
|
238 |
<?php if( isset( $redux_builder_amp['amp-swift-cart-btn'] ) && true == $redux_builder_amp['amp-swift-cart-btn'] ) { ?>
|
230 |
<?php amp_logo(); ?>
|
231 |
</div>
|
232 |
<div class="h-2">
|
233 |
+
<?php if( ampforwp_get_setting('signin-button-text') && ampforwp_get_setting('signin-button-link') ){?>
|
234 |
<div class="h-sing">
|
235 |
+
<a target="_blank" href="<?php echo ampforwp_get_setting('signin-button-link')?>"><?php echo __(ampforwp_get_setting('signin-button-text'), 'accelerated-mobile-pages'); ?></a>
|
236 |
</div>
|
237 |
<?php } ?>
|
238 |
<?php if( isset( $redux_builder_amp['amp-swift-cart-btn'] ) && true == $redux_builder_amp['amp-swift-cart-btn'] ) { ?>
|
@@ -73,8 +73,8 @@
|
|
73 |
if ( $sanitized_sidebar) {
|
74 |
$sidebar_output = $sanitized_sidebar->get_amp_content();
|
75 |
$sidebar_output = apply_filters('ampforwp_modify_sidebars_content',$sidebar_output);
|
|
|
76 |
}
|
77 |
-
echo $sidebar_output; // amphtml content, no kses
|
78 |
?>
|
79 |
</div>
|
80 |
<?php } ?>
|
73 |
if ( $sanitized_sidebar) {
|
74 |
$sidebar_output = $sanitized_sidebar->get_amp_content();
|
75 |
$sidebar_output = apply_filters('ampforwp_modify_sidebars_content',$sidebar_output);
|
76 |
+
echo $sidebar_output; // amphtml content, no kses
|
77 |
}
|
|
|
78 |
?>
|
79 |
</div>
|
80 |
<?php } ?>
|
@@ -1,11 +1,12 @@
|
|
1 |
-
<?php global $redux_builder_amp;
|
2 |
$width = 346;
|
3 |
$height = 188;
|
4 |
if( true == $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ){
|
5 |
$width = $redux_builder_amp['ampforwp-swift-homepage-posts-width'];
|
6 |
$height = $redux_builder_amp['ampforwp-swift-homepage-posts-height'];
|
7 |
} ?>
|
8 |
-
<?php while(amp_loop('start')):
|
|
|
9 |
<div class="fsp">
|
10 |
<?php if(ampforwp_has_post_thumbnail()){ $args = array("tag"=>'div',"tag_class"=>'image-container','image_size'=>'full','image_crop'=>'true','image_crop_width'=>$width,'image_crop_height'=>$height, 'responsive'=> true); ?>
|
11 |
<div class="fsp-img">
|
1 |
+
<?php global $redux_builder_amp, $search_found;
|
2 |
$width = 346;
|
3 |
$height = 188;
|
4 |
if( true == $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ){
|
5 |
$width = $redux_builder_amp['ampforwp-swift-homepage-posts-width'];
|
6 |
$height = $redux_builder_amp['ampforwp-swift-homepage-posts-height'];
|
7 |
} ?>
|
8 |
+
<?php while(amp_loop('start')):
|
9 |
+
$search_found = true; ?>
|
10 |
<div class="fsp">
|
11 |
<?php if(ampforwp_has_post_thumbnail()){ $args = array("tag"=>'div',"tag_class"=>'image-container','image_size'=>'full','image_crop'=>'true','image_crop_width'=>$width,'image_crop_height'=>$height, 'responsive'=> true); ?>
|
12 |
<div class="fsp-img">
|
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php global $redux_builder_amp;
|
2 |
amp_header() ?>
|
3 |
<div class="cntr archive">
|
4 |
<div class="arch-tlt">
|
@@ -8,7 +8,7 @@ amp_header() ?>
|
|
8 |
<div class="arch-psts">
|
9 |
<?php amp_loop_template(); ?>
|
10 |
<?php
|
11 |
-
if (
|
12 |
<div class="cntn-wrp srch ">
|
13 |
<p><?php
|
14 |
$message = '';
|
@@ -28,8 +28,8 @@ amp_header() ?>
|
|
28 |
if ( $sanitized_sidebar) {
|
29 |
$sidebar_output = $sanitized_sidebar->get_amp_content();
|
30 |
$sidebar_output = apply_filters('ampforwp_modify_sidebars_content',$sidebar_output);
|
|
|
31 |
}
|
32 |
-
echo $sidebar_output; // amphtml content, no kses
|
33 |
?>
|
34 |
</div>
|
35 |
<?php } ?>
|
1 |
+
<?php global $redux_builder_amp, $search_found;
|
2 |
amp_header() ?>
|
3 |
<div class="cntr archive">
|
4 |
<div class="arch-tlt">
|
8 |
<div class="arch-psts">
|
9 |
<?php amp_loop_template(); ?>
|
10 |
<?php
|
11 |
+
if ( false == $search_found ){ ?>
|
12 |
<div class="cntn-wrp srch ">
|
13 |
<p><?php
|
14 |
$message = '';
|
28 |
if ( $sanitized_sidebar) {
|
29 |
$sidebar_output = $sanitized_sidebar->get_amp_content();
|
30 |
$sidebar_output = apply_filters('ampforwp_modify_sidebars_content',$sidebar_output);
|
31 |
+
echo $sidebar_output; // amphtml content, no kses
|
32 |
}
|
|
|
33 |
?>
|
34 |
</div>
|
35 |
<?php } ?>
|
@@ -11,10 +11,19 @@ if(!ampforwp_levelup_compatibility('levelup_theme_and_elementor')){ // Level up
|
|
11 |
@font-face {font-family: 'Poppins';font-display: swap;font-style: normal;font-weight: 700;src: local('Poppins Bold'), local('Poppins-Bold'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-Bold.ttf'); }
|
12 |
<?php } // Level up Condition ends
|
13 |
} ?>
|
14 |
-
|
15 |
$hovercolor = '';
|
16 |
$hovercolor = ampforwp_get_setting('swift-hover-color-scheme');
|
17 |
$hovercolor = $hovercolor['color'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
$fontFamily = "font-family: 'Arial', 'Helvetica', 'sans-serif';";
|
19 |
if( !ampforwp_levelup_compatibility('levelup_theme') && 1==ampforwp_get_setting('ampforwp-google-font-switch') ){
|
20 |
$fontFamily = "font-family: 'Poppins', sans-serif;";
|
@@ -22,13 +31,7 @@ if( !ampforwp_levelup_compatibility('levelup_theme') && 1==ampforwp_get_setting(
|
|
22 |
$fontFamily = "font-family: '".$redux_builder_amp['amp_font_selector']."';";
|
23 |
}
|
24 |
}
|
25 |
-
echo $fontFamily; ?>
|
26 |
-
<?php $swift_cs_color = '#005be2';
|
27 |
-
$swift_cs = ampforwp_get_setting('swift-color-scheme');
|
28 |
-
if( !empty($swift_cs['color']) ) {
|
29 |
-
$swift_cs_color = $swift_cs['color'];
|
30 |
-
}?>
|
31 |
-
font-size: 16px; line-height:1.25; }
|
32 |
ol, ul{ list-style-position: inside }
|
33 |
p, ol, ul, figure{ margin: 0 0 1em; padding: 0; }
|
34 |
a, a:active, a:visited{ text-decoration: none; color: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;}
|
@@ -38,7 +41,7 @@ body a:hover{
|
|
38 |
pre{ white-space: pre-wrap;}
|
39 |
.left{float:left}
|
40 |
.right{float:right}
|
41 |
-
.hidden, .hide{ display:none }
|
42 |
.clearfix{ clear:both }
|
43 |
blockquote{ background: #f1f1f1; margin: 10px 0 20px 0; padding: 15px;}
|
44 |
blockquote p:last-child {margin-bottom: 0;}
|
@@ -212,14 +215,17 @@ if($redux_builder_amp['menu-type'] == '1'){?>
|
|
212 |
.fsc{width: 100%;height: -webkit-fill-available;position: absolute;cursor: pointer;top:0;left:0;z-index:9;}
|
213 |
<?php if($redux_builder_amp['header-position-type'] == '1'){?>
|
214 |
.tg:checked + .hamb-mnu > .m-ctr {margin-left: 0;border-right: 1px solid <?php if(isset($redux_builder_amp['swift-element-menu-border-color']['rgba'])){echo ampforwp_sanitize_color($redux_builder_amp['swift-element-menu-border-color']['rgba']);}?>;}
|
215 |
-
|
|
|
|
|
|
|
216 |
.m-ctr{margin-left: -100%;float: left;}
|
217 |
<?php } ?>
|
218 |
<?php if($redux_builder_amp['header-position-type'] == '2'){?>
|
219 |
.tg:checked + .hamb-mnu > .m-ctr {margin-left: calc(100% - <?php echo esc_html(ampforwp_get_setting('header-overlay-width'))?>);}
|
220 |
.m-ctr{margin-left: 100%;float: right;}
|
221 |
<?php } ?>
|
222 |
-
.tg:checked + .hamb-mnu > .fsc{display: block;background: rgba(0,0,0,.9);height
|
223 |
.t-btn, .c-btn{cursor: pointer;}
|
224 |
.t-btn:after{
|
225 |
<?php if ( ampforwp_get_setting('ampforwp_font_icon') == 'swift-icons' ){ ?>
|
@@ -238,7 +244,7 @@ if ( ampforwp_get_setting('ampforwp_font_icon') == 'fontawesome-icons' ){ ?>
|
|
238 |
content:"\f00d";font-family: "Font Awesome 5 Free";font-weight:600;font-size:18px;
|
239 |
<?php } ?>
|
240 |
<?php if(isset($redux_builder_amp['swift-element-overlay-color-control'] ['rgba']) && $redux_builder_amp['swift-element-overlay-color-control'] ['rgba']){?>color: <?php echo ampforwp_sanitize_color($redux_builder_amp['swift-element-overlay-color-control']['rgba'])?>;<?php } ?>line-height: 0;display: block;text-indent: 1px;}
|
241 |
-
.c-btn{float: right;padding:
|
242 |
.m-ctr{transition: margin 0.3s ease-in-out;}
|
243 |
.m-ctr{<?php if(ampforwp_get_setting('header-overlay-width')){?>width:<?php echo esc_html(ampforwp_get_setting('header-overlay-width'))?>;<?php } ?>height:100%;position: absolute;z-index:99;padding: 2% 0% 100vh 0%;}
|
244 |
.m-menu{display: inline-block;width: 100%;padding: 2px 20px 10px 20px;}
|
@@ -367,6 +373,7 @@ if( ampforwp_is_home() || is_archive() || is_search() || (function_exists('is_sh
|
|
367 |
.amp-sub-archives ul li a{color:#005be2;}
|
368 |
.loop-pagination{margin:20px 0px 20px 0px;}
|
369 |
.right a, .left a{background: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;padding: 8px 22px 12px 25px;color: #fff;line-height: 1;border-radius: 46px;font-size: 14px;display: inline-block;}
|
|
|
370 |
.right a:after{content:"»";display: inline-block;padding-left: 6px;font-size: 20px;line-height: 20px;height: 20px;position: relative;top: 1px;}
|
371 |
.left a:before{content:"«";display: inline-block;padding-right: 6px;font-size: 20px;line-height: 20px;height: 20px;position: relative;top: -1px;}
|
372 |
.cntn-wrp.srch p { margin: 30px 0px 30px 0px; }
|
@@ -485,7 +492,15 @@ if( is_page() || ampforwp_is_front_page() || ampforwp_polylang_front_page() ){?>
|
|
485 |
blockquote p {font-size:20px;}
|
486 |
}
|
487 |
<?php } ?>
|
488 |
-
<?php } // Level Condition Ends
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
<?php if(is_singular()){ ?>
|
490 |
/** Pre tag Styling **/
|
491 |
pre {padding: 30px 15px;background: #f7f7f7;white-space: pre-wrap;;font-size: 14px;color: #666666;border-left: 3px solid;border-color: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;margin-bottom: 20px;}
|
@@ -735,6 +750,7 @@ letter-spacing: 0.10px;margin-top: 5px;font-weight: 400;}
|
|
735 |
.form-submit #submit{background-color: #005be2;font-size: 14px;text-align: center;border-radius: 3px;font-weight: 500;color: #fff;cursor: pointer;margin: 0;border: 0;padding: 11px 21px;}
|
736 |
#respond p {margin: 12px 0;}
|
737 |
.amp-comment-button a{color: #fff;display: block;padding: 7px 0px 8px 0px;}
|
|
|
738 |
.comment-form-comment #comment {border-color: #ccc;width: 100%;padding: 20px;}
|
739 |
.cmts h3{margin: 0;font-size: 12px;padding-bottom: 6px;border-bottom: 1px solid #eee;font-weight: 400;letter-spacing: 0.5px;text-transform: uppercase;color: #444;}
|
740 |
.cmts h3:after{content: "";display: block;width: 115px;border-bottom: 1px solid #005be2;position: relative;top: 7px;}
|
@@ -1182,7 +1198,7 @@ if ( ampforwp_get_setting('gbl-sidebar') && ampforwp_get_setting('gnrl-sidebar')
|
|
1182 |
}
|
1183 |
}
|
1184 |
<?php }
|
1185 |
-
if ( ( true == ampforwp_get_setting('gbl-sidebar') && (ampforwp_is_front_page() || ampforwp_is_home()) || ampforwp_is_blog()) || ( true == ampforwp_get_setting('swift-sidebar') && is_singular() ) ) { ?>
|
1186 |
/*** Sidebar CSS ***/
|
1187 |
<?php if ( is_active_sidebar( 'swift-sidebar' ) ) : ?>
|
1188 |
.sdbr-right{
|
11 |
@font-face {font-family: 'Poppins';font-display: swap;font-style: normal;font-weight: 700;src: local('Poppins Bold'), local('Poppins-Bold'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-Bold.ttf'); }
|
12 |
<?php } // Level up Condition ends
|
13 |
} ?>
|
14 |
+
<?php
|
15 |
$hovercolor = '';
|
16 |
$hovercolor = ampforwp_get_setting('swift-hover-color-scheme');
|
17 |
$hovercolor = $hovercolor['color'];
|
18 |
+
|
19 |
+
$swift_cs_color = '#005be2';
|
20 |
+
$swift_btn_hvr_color = '#fff';
|
21 |
+
$swift_cs = ampforwp_get_setting('swift-color-scheme');
|
22 |
+
if( !empty($swift_cs['color']) ) {
|
23 |
+
$swift_cs_color = $swift_cs['color'];
|
24 |
+
}
|
25 |
+
$swift_btn_hvr_color = ampforwp_get_setting('swift-btn-hover-color-scheme','color'); ?>
|
26 |
+
body{<?php
|
27 |
$fontFamily = "font-family: 'Arial', 'Helvetica', 'sans-serif';";
|
28 |
if( !ampforwp_levelup_compatibility('levelup_theme') && 1==ampforwp_get_setting('ampforwp-google-font-switch') ){
|
29 |
$fontFamily = "font-family: 'Poppins', sans-serif;";
|
31 |
$fontFamily = "font-family: '".$redux_builder_amp['amp_font_selector']."';";
|
32 |
}
|
33 |
}
|
34 |
+
echo $fontFamily; ?>font-size: 16px; line-height:1.25; }
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
ol, ul{ list-style-position: inside }
|
36 |
p, ol, ul, figure{ margin: 0 0 1em; padding: 0; }
|
37 |
a, a:active, a:visited{ text-decoration: none; color: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;}
|
41 |
pre{ white-space: pre-wrap;}
|
42 |
.left{float:left}
|
43 |
.right{float:right}
|
44 |
+
.hidden, .hide, .logo .hide{ display:none }
|
45 |
.clearfix{ clear:both }
|
46 |
blockquote{ background: #f1f1f1; margin: 10px 0 20px 0; padding: 15px;}
|
47 |
blockquote p:last-child {margin-bottom: 0;}
|
215 |
.fsc{width: 100%;height: -webkit-fill-available;position: absolute;cursor: pointer;top:0;left:0;z-index:9;}
|
216 |
<?php if($redux_builder_amp['header-position-type'] == '1'){?>
|
217 |
.tg:checked + .hamb-mnu > .m-ctr {margin-left: 0;border-right: 1px solid <?php if(isset($redux_builder_amp['swift-element-menu-border-color']['rgba'])){echo ampforwp_sanitize_color($redux_builder_amp['swift-element-menu-border-color']['rgba']);}?>;}
|
218 |
+
<?php $overlaybg = ampforwp_get_setting('swift-header-overlay','color'); ?>
|
219 |
+
.tg:checked + .hamb-mnu > .m-ctr .c-btn {position: fixed;right: 5px;top:5px;
|
220 |
+
background: <?php echo ampforwp_sanitize_color( $overlaybg ); ?>;
|
221 |
+
border-radius: 50px;}
|
222 |
.m-ctr{margin-left: -100%;float: left;}
|
223 |
<?php } ?>
|
224 |
<?php if($redux_builder_amp['header-position-type'] == '2'){?>
|
225 |
.tg:checked + .hamb-mnu > .m-ctr {margin-left: calc(100% - <?php echo esc_html(ampforwp_get_setting('header-overlay-width'))?>);}
|
226 |
.m-ctr{margin-left: 100%;float: right;}
|
227 |
<?php } ?>
|
228 |
+
.tg:checked + .hamb-mnu > .fsc{display: block;background: rgba(0,0,0,.9);height:-webkit-fill-available;}
|
229 |
.t-btn, .c-btn{cursor: pointer;}
|
230 |
.t-btn:after{
|
231 |
<?php if ( ampforwp_get_setting('ampforwp_font_icon') == 'swift-icons' ){ ?>
|
244 |
content:"\f00d";font-family: "Font Awesome 5 Free";font-weight:600;font-size:18px;
|
245 |
<?php } ?>
|
246 |
<?php if(isset($redux_builder_amp['swift-element-overlay-color-control'] ['rgba']) && $redux_builder_amp['swift-element-overlay-color-control'] ['rgba']){?>color: <?php echo ampforwp_sanitize_color($redux_builder_amp['swift-element-overlay-color-control']['rgba'])?>;<?php } ?>line-height: 0;display: block;text-indent: 1px;}
|
247 |
+
.c-btn{float: right;padding: 15px 5px;}
|
248 |
.m-ctr{transition: margin 0.3s ease-in-out;}
|
249 |
.m-ctr{<?php if(ampforwp_get_setting('header-overlay-width')){?>width:<?php echo esc_html(ampforwp_get_setting('header-overlay-width'))?>;<?php } ?>height:100%;position: absolute;z-index:99;padding: 2% 0% 100vh 0%;}
|
250 |
.m-menu{display: inline-block;width: 100%;padding: 2px 20px 10px 20px;}
|
373 |
.amp-sub-archives ul li a{color:#005be2;}
|
374 |
.loop-pagination{margin:20px 0px 20px 0px;}
|
375 |
.right a, .left a{background: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;padding: 8px 22px 12px 25px;color: #fff;line-height: 1;border-radius: 46px;font-size: 14px;display: inline-block;}
|
376 |
+
.right a:hover, .left a:hover{color: <?php echo ampforwp_sanitize_color($swift_btn_hvr_color) ?>;}
|
377 |
.right a:after{content:"»";display: inline-block;padding-left: 6px;font-size: 20px;line-height: 20px;height: 20px;position: relative;top: 1px;}
|
378 |
.left a:before{content:"«";display: inline-block;padding-right: 6px;font-size: 20px;line-height: 20px;height: 20px;position: relative;top: -1px;}
|
379 |
.cntn-wrp.srch p { margin: 30px 0px 30px 0px; }
|
492 |
blockquote p {font-size:20px;}
|
493 |
}
|
494 |
<?php } ?>
|
495 |
+
<?php } // Level Condition Ends
|
496 |
+
if(is_page()){ ?>
|
497 |
+
.pg table {width: 100%;margin-bottom:25px;overflow-x: auto;word-break: normal;}
|
498 |
+
.pg td {padding: 0.5em 1em;border: 1px solid #ddd;}
|
499 |
+
.pg tr:nth-child(odd) td {background: #f7f7f7;}
|
500 |
+
@media(max-width:767px){
|
501 |
+
.pg table{display: -webkit-box;}
|
502 |
+
}
|
503 |
+
<?php } // page table css ends ?>
|
504 |
<?php if(is_singular()){ ?>
|
505 |
/** Pre tag Styling **/
|
506 |
pre {padding: 30px 15px;background: #f7f7f7;white-space: pre-wrap;;font-size: 14px;color: #666666;border-left: 3px solid;border-color: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;margin-bottom: 20px;}
|
750 |
.form-submit #submit{background-color: #005be2;font-size: 14px;text-align: center;border-radius: 3px;font-weight: 500;color: #fff;cursor: pointer;margin: 0;border: 0;padding: 11px 21px;}
|
751 |
#respond p {margin: 12px 0;}
|
752 |
.amp-comment-button a{color: #fff;display: block;padding: 7px 0px 8px 0px;}
|
753 |
+
.amp-comment-button a:hover{color:<?php echo ampforwp_sanitize_color($swift_btn_hvr_color) ?>;}
|
754 |
.comment-form-comment #comment {border-color: #ccc;width: 100%;padding: 20px;}
|
755 |
.cmts h3{margin: 0;font-size: 12px;padding-bottom: 6px;border-bottom: 1px solid #eee;font-weight: 400;letter-spacing: 0.5px;text-transform: uppercase;color: #444;}
|
756 |
.cmts h3:after{content: "";display: block;width: 115px;border-bottom: 1px solid #005be2;position: relative;top: 7px;}
|
1198 |
}
|
1199 |
}
|
1200 |
<?php }
|
1201 |
+
if ( ( true == ampforwp_get_setting('gbl-sidebar') && (ampforwp_is_front_page() || ampforwp_is_home()) || is_archive() || ampforwp_is_blog()) || ( true == ampforwp_get_setting('swift-sidebar') && is_singular() ) ) { ?>
|
1202 |
/*** Sidebar CSS ***/
|
1203 |
<?php if ( is_active_sidebar( 'swift-sidebar' ) ) : ?>
|
1204 |
.sdbr-right{
|
@@ -325,8 +325,8 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
325 |
}
|
326 |
|
327 |
|
328 |
-
|
329 |
-
if( get_option('permalink_structure')
|
330 |
global $sitepress_settings, $wp;
|
331 |
if($sitepress_settings[ 'language_negotiation_type' ] == 3){
|
332 |
if( is_singular() ){
|
@@ -335,7 +335,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
335 |
$wpml_url =get_permalink( get_queried_object_id() );
|
336 |
$untrail_wpml_url = untrailingslashit($wpml_url);
|
337 |
$explode_url = explode('/', $untrail_wpml_url);
|
338 |
-
$append_amp =
|
339 |
foreach ($active_langs as $active_lang) {
|
340 |
foreach($explode_url as $a) {
|
341 |
if (stripos('?lang='.$active_lang ,$a) !== false){
|
@@ -401,9 +401,12 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
401 |
}
|
402 |
}
|
403 |
}
|
|
|
|
|
|
|
|
|
|
|
404 |
}
|
405 |
-
// URL Purifier
|
406 |
-
$amp_url = ampforwp_url_purifier($amp_url);
|
407 |
|
408 |
$amp_url = apply_filters('ampforwp_modify_rel_canonical',$amp_url);
|
409 |
|
@@ -421,7 +424,14 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
421 |
}
|
422 |
function ampforwp_static_blog(){
|
423 |
global $page;
|
424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
add_filter('ampforwp_modify_rel_canonical','ampforwp_modify_amphtml_static_blog');
|
426 |
}
|
427 |
}
|
@@ -794,6 +804,14 @@ function ampforwp_title_callback( $post ) {
|
|
794 |
set_transient('ampforwp_exclude_post_transient', $exclude_post_value);
|
795 |
}
|
796 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
797 |
if ( empty( $ampforwp_stored_meta['ampforwp-amp-on-off'][0] ) && $post->post_type == 'page' && ampforwp_get_setting('amp-pages-meta-default') == 'hide' ) {
|
798 |
$ampforwp_stored_meta['ampforwp-amp-on-off'][0] = 'hide-amp';
|
799 |
}?>
|
@@ -1438,18 +1456,16 @@ function ampforwp_yoast_twitter_desc($desc){
|
|
1438 |
function ampforwp_yoast_social_desc($type) {
|
1439 |
if(ampforwp_is_front_page() || ampforwp_is_blog()){
|
1440 |
$desc = $page_id = '';
|
1441 |
-
|
1442 |
-
$page_id = ampforwp_get_frontpage_id();
|
1443 |
-
}
|
1444 |
-
if ( ampforwp_is_blog() ){
|
1445 |
-
$page_id = ampforwp_get_blog_details('id');
|
1446 |
-
}
|
1447 |
if ( 'og' == $type ) {
|
1448 |
$desc = trim( WPSEO_Meta::get_value( 'opengraph-description', $page_id ) );
|
1449 |
}
|
1450 |
if ( 'twitter' == $type ) {
|
1451 |
$desc = trim( WPSEO_Meta::get_value( 'twitter-description', $page_id ) );
|
1452 |
}
|
|
|
|
|
|
|
1453 |
if (empty($desc)){
|
1454 |
$desc = wp_trim_words(get_post_field('post_content', $page_id), 26);
|
1455 |
}
|
@@ -1939,27 +1955,6 @@ function ampforwp_skip_amp_post( $skip, $post_id, $post ) {
|
|
1939 |
return $skip;
|
1940 |
}
|
1941 |
|
1942 |
-
// 29. Remove analytics code if Already added by Glue or Yoast SEO (#370)
|
1943 |
-
add_action('init','ampforwp_remove_analytics_code_if_available',20);
|
1944 |
-
function ampforwp_remove_analytics_code_if_available(){
|
1945 |
-
if ( class_exists('WPSEO_Options') && class_exists('YoastSEO_AMP') ) {
|
1946 |
-
$yoast_glue_seo = get_option('wpseo_amp');
|
1947 |
-
|
1948 |
-
if ( $yoast_glue_seo['analytics-extra'] ) {
|
1949 |
-
remove_action('amp_post_template_head','ampforwp_register_analytics_script', 20);
|
1950 |
-
remove_action('amp_post_template_footer','ampforwp_analytics',11);
|
1951 |
-
}
|
1952 |
-
|
1953 |
-
if ( class_exists('Yoast_GA_Options') ) {
|
1954 |
-
$UA = Yoast_GA_Options::instance()->get_tracking_code();
|
1955 |
-
if ( $UA ) {
|
1956 |
-
remove_action('amp_post_template_head','ampforwp_register_analytics_script', 20);
|
1957 |
-
remove_action('amp_post_template_footer','ampforwp_analytics',11);
|
1958 |
-
}
|
1959 |
-
}
|
1960 |
-
}
|
1961 |
-
}
|
1962 |
-
|
1963 |
//30. TagDiv menu issue removed
|
1964 |
add_action('init','ampforwp_remove_tagdiv_mobile_menu');
|
1965 |
function ampforwp_remove_tagdiv_mobile_menu() {
|
@@ -3011,7 +3006,6 @@ function ampforwp_meta_description() {
|
|
3011 |
if ( false == ampforwp_get_setting('ampforwp-seo-meta-description') || 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
|
3012 |
return;
|
3013 |
}
|
3014 |
-
$desc = "";
|
3015 |
$desc = ampforwp_generate_meta_desc();
|
3016 |
if ( $desc ) {
|
3017 |
echo '<meta name="description" content="'. esc_attr( convert_chars( stripslashes( $desc ) ) ) .'"/>';
|
@@ -3899,13 +3893,11 @@ function ampforwp_cat_specific_skip_amp_post( $skip, $post_id, $post ) {
|
|
3899 |
add_filter('ampforwp_query_args', 'ampforwp_exclude_archive_args');
|
3900 |
function ampforwp_exclude_archive_args( $args ) {
|
3901 |
global $redux_builder_amp;
|
3902 |
-
if (
|
3903 |
-
|
3904 |
-
|
3905 |
-
|
3906 |
-
|
3907 |
-
$args['tag__not_in'] = ampforwp_exclude_archive('tag');
|
3908 |
-
}
|
3909 |
}
|
3910 |
return $args;
|
3911 |
}
|
@@ -4281,6 +4273,9 @@ function ampforwp_enable_post_and_featured_image($show_image){
|
|
4281 |
|
4282 |
// 82. Grab Featured Image from The Content
|
4283 |
function ampforwp_get_featured_image_from_content( $featured_image = "", $size="") {
|
|
|
|
|
|
|
4284 |
global $post, $posts;
|
4285 |
$image_url = $image_width = $image_height = $output = $matches = $output_fig = $amp_html_sanitizer = $amp_html = $image_html = $featured_image_output = $matches_fig = $figure = $output_fig_image = $matches_fig_img = '';
|
4286 |
ob_start();
|
@@ -4453,7 +4448,8 @@ function ampforwp_inline_related_posts(){
|
|
4453 |
}
|
4454 |
}//end of block for tags
|
4455 |
$my_query = new wp_query( $args );
|
4456 |
-
if( $my_query->have_posts() ) {
|
|
|
4457 |
$inline_related_posts = '<div class="amp-wp-content relatedpost">
|
4458 |
<div class="related_posts">
|
4459 |
<ol class="clearfix">
|
@@ -4478,11 +4474,17 @@ function ampforwp_inline_related_posts(){
|
|
4478 |
if ( ampforwp_has_post_thumbnail() ) {
|
4479 |
if( 4 == $redux_builder_amp['amp-design-selector'] ){
|
4480 |
$thumb_url_2 = ampforwp_aq_resize( $thumb_url_2, 220 , 134 , true, false, true );
|
4481 |
-
$
|
4482 |
}
|
4483 |
else{
|
4484 |
-
$
|
|
|
|
|
|
|
|
|
4485 |
}
|
|
|
|
|
4486 |
}
|
4487 |
$inline_related_posts .='</a>';
|
4488 |
}
|
@@ -4608,60 +4610,6 @@ function ampforwp_gallery_new_params($urls, $attachment_id ){
|
|
4608 |
}
|
4609 |
}
|
4610 |
|
4611 |
-
if( ! function_exists( 'ampforwp_additional_style_carousel_caption' ) ){
|
4612 |
-
function ampforwp_additional_style_carousel_caption(){ ?>
|
4613 |
-
.collapsible-captions {--caption-height: 32px; --image-height: 100%; --caption-padding:1rem; --button-size: 28px; --caption-color: #f5f5f5;; --caption-bg-color: #111;}
|
4614 |
-
.collapsible-captions * {
|
4615 |
-
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
|
4616 |
-
box-sizing: border-box;
|
4617 |
-
}
|
4618 |
-
.collapsible-captions .amp-carousel-container {position: relative; width: 100%;}
|
4619 |
-
.collapsible-captions amp-img img {object-fit: contain; }
|
4620 |
-
.collapsible-captions figure { margin: 0; padding: 0; }
|
4621 |
-
.collapsible-captions figcaption { position: absolute; bottom: 0;width: 100%;
|
4622 |
-
max-height: var(--caption-height);margin-bottom:0;
|
4623 |
-
line-height: var(--caption-height);
|
4624 |
-
padding: 0 var(--button-size) 0 5px;
|
4625 |
-
white-space: nowrap;
|
4626 |
-
overflow: hidden;
|
4627 |
-
text-overflow: ellipsis;
|
4628 |
-
transition: max-height 200ms cubic-bezier(0.4, 0, 0.2, 1);
|
4629 |
-
z-index: 1000;
|
4630 |
-
color: var(--caption-color);
|
4631 |
-
background: rgba(0, 0, 0, 0.6);
|
4632 |
-
}
|
4633 |
-
.collapsible-captions figcaption.expanded {
|
4634 |
-
line-height: inherit;
|
4635 |
-
white-space: normal;
|
4636 |
-
text-overflow: auto;
|
4637 |
-
max-height: 100px;
|
4638 |
-
overflow: auto;
|
4639 |
-
}
|
4640 |
-
.collapsible-captions figcaption:focus { outline: none; border: none; }
|
4641 |
-
.collapsible-captions figcaption span { display: block; position: absolute;
|
4642 |
-
top: calc((var(--caption-height) - var(--button-size)) / 2);
|
4643 |
-
right: 2px; width: var(--button-size); height: var(--button-size);
|
4644 |
-
line-height: var(--button-size); text-align: center; font-size: 12px; color: inherit;
|
4645 |
-
cursor: pointer; }
|
4646 |
-
figcaption{ margin-bottom: 20px; }
|
4647 |
-
<?php }
|
4648 |
-
}
|
4649 |
-
// amp-bind for carousel with captions
|
4650 |
-
if( !function_exists('ampforwp_carousel_bind_script')){
|
4651 |
-
function ampforwp_carousel_bind_script($data){
|
4652 |
-
if( 1 == ampforwp_get_setting('ampforwp-gallery-design-type') || 2 == ampforwp_get_setting('ampforwp-gallery-design-type') ){
|
4653 |
-
if ( empty( $data['amp_component_scripts']['amp-bind'] ) ) {
|
4654 |
-
$data['amp_component_scripts']['amp-bind'] = 'https://cdn.ampproject.org/v0/amp-bind-0.1.js';
|
4655 |
-
}
|
4656 |
-
}
|
4657 |
-
if( 3 == ampforwp_get_setting('ampforwp-gallery-design-type') || true == ampforwp_get_setting('ampforwp-gallery-lightbox') ){
|
4658 |
-
if ( empty( $data['amp_component_scripts']['amp-image-lightbox'] ) ) {
|
4659 |
-
$data['amp_component_scripts']['amp-image-lightbox'] = 'https://cdn.ampproject.org/v0/amp-image-lightbox-0.1.js';
|
4660 |
-
}
|
4661 |
-
}
|
4662 |
-
return $data;
|
4663 |
-
}
|
4664 |
-
}
|
4665 |
if( !function_exists( 'ampforwp_carousel_class_magic' ) ){
|
4666 |
function ampforwp_carousel_class_magic($content){
|
4667 |
$content = str_replace(array(':openbrack:',':closebrack:'), array('[',']'), $content);
|
@@ -5658,6 +5606,18 @@ function ampforwp_coauthors_links($args){
|
|
5658 |
return $args;
|
5659 |
}
|
5660 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5661 |
// amp-image-lightbox #1892
|
5662 |
if ( ! function_exists('ampforwp_amp_img_lightbox') ) {
|
5663 |
function ampforwp_amp_img_lightbox(){
|
@@ -5766,7 +5726,7 @@ function ampforwp_resave_permalink( $option, $old_value, $value ){
|
|
5766 |
}
|
5767 |
}
|
5768 |
|
5769 |
-
// Canonical From Yoast #2118 and All in One SEO #1720
|
5770 |
function ampforwp_generate_canonical(){
|
5771 |
global $redux_builder_amp;
|
5772 |
$canonical = '';
|
@@ -5780,7 +5740,7 @@ function ampforwp_generate_canonical(){
|
|
5780 |
$opts = $All_in_One_SEO_Pack->get_current_options( array(), 'aiosp' );
|
5781 |
$canonical = $opts['aiosp_custom_link'];
|
5782 |
}
|
5783 |
-
elseif (defined( 'RANK_MATH_FILE' ) && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
|
5784 |
$canonical = \RankMath\Paper\Paper::get()->get_canonical();
|
5785 |
}
|
5786 |
return $canonical;
|
@@ -6419,9 +6379,29 @@ if ( ! function_exists('ampforwp_rank_math') ) {
|
|
6419 |
if ( 'rank_math' !== ampforwp_get_setting('ampforwp-seo-selection') ) {
|
6420 |
return;
|
6421 |
}
|
|
|
6422 |
// Remove Canonical & Title Tag added by the Rank Math plugin.
|
6423 |
remove_all_actions( 'rank_math/head', 20 );
|
6424 |
remove_all_actions( 'rank_math/head', 1 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6425 |
do_action( 'rank_math/head' );
|
6426 |
}
|
6427 |
}
|
@@ -6684,3 +6664,31 @@ function ampforwp_featured_video_plus_css(){
|
|
6684 |
.f_vid { background: #000; }
|
6685 |
<?php }
|
6686 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
}
|
326 |
|
327 |
|
328 |
+
if( class_exists('SitePress') ){
|
329 |
+
if( get_option('permalink_structure') ){
|
330 |
global $sitepress_settings, $wp;
|
331 |
if($sitepress_settings[ 'language_negotiation_type' ] == 3){
|
332 |
if( is_singular() ){
|
335 |
$wpml_url =get_permalink( get_queried_object_id() );
|
336 |
$untrail_wpml_url = untrailingslashit($wpml_url);
|
337 |
$explode_url = explode('/', $untrail_wpml_url);
|
338 |
+
$append_amp = AMPFORWP_AMP_QUERY_VAR;
|
339 |
foreach ($active_langs as $active_lang) {
|
340 |
foreach($explode_url as $a) {
|
341 |
if (stripos('?lang='.$active_lang ,$a) !== false){
|
401 |
}
|
402 |
}
|
403 |
}
|
404 |
+
}
|
405 |
+
}
|
406 |
+
if( !class_exists('SitePress') ){
|
407 |
+
// URL Purifier
|
408 |
+
$amp_url = ampforwp_url_purifier($amp_url);
|
409 |
}
|
|
|
|
|
410 |
|
411 |
$amp_url = apply_filters('ampforwp_modify_rel_canonical',$amp_url);
|
412 |
|
424 |
}
|
425 |
function ampforwp_static_blog(){
|
426 |
global $page;
|
427 |
+
$modify_canonical = ampforwp_is_front_page();
|
428 |
+
$get_front_page_reading_settings = get_option('page_on_front');
|
429 |
+
// Homepage support on
|
430 |
+
$get_amp_homepage_support = ampforwp_get_setting('ampforwp-homepage-on-off-support');
|
431 |
+
if ( 'page' == get_option( 'show_on_front') && is_front_page() && $get_front_page_reading_settings && $get_amp_homepage_support ){
|
432 |
+
$modify_canonical = true;
|
433 |
+
}
|
434 |
+
if ( true == $modify_canonical && $page >= 2 && is_page() ) {
|
435 |
add_filter('ampforwp_modify_rel_canonical','ampforwp_modify_amphtml_static_blog');
|
436 |
}
|
437 |
}
|
804 |
set_transient('ampforwp_exclude_post_transient', $exclude_post_value);
|
805 |
}
|
806 |
}
|
807 |
+
if ( ( 'default' == $ampforwp_stored_meta['ampforwp-amp-on-off'][0] || !isset($ampforwp_stored_meta['ampforwp-amp-on-off'][0]) ) && 'page' != $post->post_type ) {
|
808 |
+
if ( in_array($post->ID, $exclude_post_value) ) {
|
809 |
+
$exclude_post_value = array_flip($exclude_post_value);
|
810 |
+
unset($exclude_post_value[$post->ID] );
|
811 |
+
$exclude_post_value = array_flip($exclude_post_value);
|
812 |
+
set_transient('ampforwp_exclude_post_transient', $exclude_post_value);
|
813 |
+
}
|
814 |
+
}
|
815 |
if ( empty( $ampforwp_stored_meta['ampforwp-amp-on-off'][0] ) && $post->post_type == 'page' && ampforwp_get_setting('amp-pages-meta-default') == 'hide' ) {
|
816 |
$ampforwp_stored_meta['ampforwp-amp-on-off'][0] = 'hide-amp';
|
817 |
}?>
|
1456 |
function ampforwp_yoast_social_desc($type) {
|
1457 |
if(ampforwp_is_front_page() || ampforwp_is_blog()){
|
1458 |
$desc = $page_id = '';
|
1459 |
+
$page_id = ampforwp_get_the_ID();
|
|
|
|
|
|
|
|
|
|
|
1460 |
if ( 'og' == $type ) {
|
1461 |
$desc = trim( WPSEO_Meta::get_value( 'opengraph-description', $page_id ) );
|
1462 |
}
|
1463 |
if ( 'twitter' == $type ) {
|
1464 |
$desc = trim( WPSEO_Meta::get_value( 'twitter-description', $page_id ) );
|
1465 |
}
|
1466 |
+
if (empty($desc) ){
|
1467 |
+
$desc = get_post_meta($page_id, '_yoast_wpseo_metadesc', true);
|
1468 |
+
}
|
1469 |
if (empty($desc)){
|
1470 |
$desc = wp_trim_words(get_post_field('post_content', $page_id), 26);
|
1471 |
}
|
1955 |
return $skip;
|
1956 |
}
|
1957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1958 |
//30. TagDiv menu issue removed
|
1959 |
add_action('init','ampforwp_remove_tagdiv_mobile_menu');
|
1960 |
function ampforwp_remove_tagdiv_mobile_menu() {
|
3006 |
if ( false == ampforwp_get_setting('ampforwp-seo-meta-description') || 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
|
3007 |
return;
|
3008 |
}
|
|
|
3009 |
$desc = ampforwp_generate_meta_desc();
|
3010 |
if ( $desc ) {
|
3011 |
echo '<meta name="description" content="'. esc_attr( convert_chars( stripslashes( $desc ) ) ) .'"/>';
|
3893 |
add_filter('ampforwp_query_args', 'ampforwp_exclude_archive_args');
|
3894 |
function ampforwp_exclude_archive_args( $args ) {
|
3895 |
global $redux_builder_amp;
|
3896 |
+
if ( ampforwp_exclude_archive() ) {
|
3897 |
+
$args['category__not_in'] = ampforwp_exclude_archive();
|
3898 |
+
}
|
3899 |
+
if ( ampforwp_exclude_archive('tag') ) {
|
3900 |
+
$args['tag__not_in'] = ampforwp_exclude_archive('tag');
|
|
|
|
|
3901 |
}
|
3902 |
return $args;
|
3903 |
}
|
4273 |
|
4274 |
// 82. Grab Featured Image from The Content
|
4275 |
function ampforwp_get_featured_image_from_content( $featured_image = "", $size="") {
|
4276 |
+
if(get_the_post_thumbnail_url()){
|
4277 |
+
return;
|
4278 |
+
}
|
4279 |
global $post, $posts;
|
4280 |
$image_url = $image_width = $image_height = $output = $matches = $output_fig = $amp_html_sanitizer = $amp_html = $image_html = $featured_image_output = $matches_fig = $figure = $output_fig_image = $matches_fig_img = '';
|
4281 |
ob_start();
|
4448 |
}
|
4449 |
}//end of block for tags
|
4450 |
$my_query = new wp_query( $args );
|
4451 |
+
if( $my_query->have_posts() ) {
|
4452 |
+
$inline_related_posts_img = '';
|
4453 |
$inline_related_posts = '<div class="amp-wp-content relatedpost">
|
4454 |
<div class="related_posts">
|
4455 |
<ol class="clearfix">
|
4474 |
if ( ampforwp_has_post_thumbnail() ) {
|
4475 |
if( 4 == $redux_builder_amp['amp-design-selector'] ){
|
4476 |
$thumb_url_2 = ampforwp_aq_resize( $thumb_url_2, 220 , 134 , true, false, true );
|
4477 |
+
$inline_related_posts_img = '<amp-img src="'.esc_url( $thumb_url_2[0] ).'" width="' . esc_attr($thumb_url_2[1]) . '" height="' . esc_attr($thumb_url_2[2]) . '" layout="responsive"></amp-img>';
|
4478 |
}
|
4479 |
else{
|
4480 |
+
$thumb_url_2 = ampforwp_aq_resize( $thumb_url_2, 150 , 150 , true, false,true );
|
4481 |
+
$thumb_url = $thumb_url_2[0];
|
4482 |
+
$thumb_width = $thumb_url_2[1];
|
4483 |
+
$thumb_height = $thumb_url_2[2];
|
4484 |
+
$inline_related_posts_img = '<amp-img src="'.esc_url( $thumb_url ).'" width="'.esc_attr($thumb_width).'" height="'.esc_attr($thumb_height).'" layout="responsive" ></amp-img>';
|
4485 |
}
|
4486 |
+
$inline_related_posts_img = apply_filters("ampforwp_modify_inline_rp_loop_image",$inline_related_posts_img);
|
4487 |
+
$inline_related_posts .= $inline_related_posts_img;
|
4488 |
}
|
4489 |
$inline_related_posts .='</a>';
|
4490 |
}
|
4610 |
}
|
4611 |
}
|
4612 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4613 |
if( !function_exists( 'ampforwp_carousel_class_magic' ) ){
|
4614 |
function ampforwp_carousel_class_magic($content){
|
4615 |
$content = str_replace(array(':openbrack:',':closebrack:'), array('[',']'), $content);
|
5606 |
return $args;
|
5607 |
}
|
5608 |
|
5609 |
+
//remove anchor from the image when lightbox option is enabled #2695
|
5610 |
+
add_action('pre_amp_render_post','ampforwp_remove_ahref_lightbox');
|
5611 |
+
function ampforwp_remove_ahref_lightbox(){
|
5612 |
+
if(true == ampforwp_get_setting('ampforwp-amp-img-lightbox')){
|
5613 |
+
add_filter( 'the_content', 'ampforwp_remove_ahref_lightbox_in_amp' );
|
5614 |
+
}
|
5615 |
+
}
|
5616 |
+
function ampforwp_remove_ahref_lightbox_in_amp( $content ) {
|
5617 |
+
$updated_content = preg_replace("/<a[^>]+\>(<img[^>]+\>)<\/a>/i", '$1', $content);
|
5618 |
+
return $updated_content;
|
5619 |
+
}
|
5620 |
+
|
5621 |
// amp-image-lightbox #1892
|
5622 |
if ( ! function_exists('ampforwp_amp_img_lightbox') ) {
|
5623 |
function ampforwp_amp_img_lightbox(){
|
5726 |
}
|
5727 |
}
|
5728 |
|
5729 |
+
// Canonical From Yoast #2118 and All in One SEO #1720 and Rank Math #2701
|
5730 |
function ampforwp_generate_canonical(){
|
5731 |
global $redux_builder_amp;
|
5732 |
$canonical = '';
|
5740 |
$opts = $All_in_One_SEO_Pack->get_current_options( array(), 'aiosp' );
|
5741 |
$canonical = $opts['aiosp_custom_link'];
|
5742 |
}
|
5743 |
+
elseif ( defined( 'RANK_MATH_FILE' ) && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') && ampforwp_get_setting( 'ampforwp-seo-rank_math-canonical' ) ) {
|
5744 |
$canonical = \RankMath\Paper\Paper::get()->get_canonical();
|
5745 |
}
|
5746 |
return $canonical;
|
6379 |
if ( 'rank_math' !== ampforwp_get_setting('ampforwp-seo-selection') ) {
|
6380 |
return;
|
6381 |
}
|
6382 |
+
|
6383 |
// Remove Canonical & Title Tag added by the Rank Math plugin.
|
6384 |
remove_all_actions( 'rank_math/head', 20 );
|
6385 |
remove_all_actions( 'rank_math/head', 1 );
|
6386 |
+
|
6387 |
+
// Remove meta tags added by the Rank Math plugin.
|
6388 |
+
if ( ! ampforwp_get_setting( 'ampforwp-seo-rank_math-meta' ) ) {
|
6389 |
+
$json_ld_data = isset( $wp_filter['rank_math/json_ld'] ) ? $wp_filter['rank_math/json_ld'] : '';
|
6390 |
+
remove_all_actions( 'rank_math/opengraph/facebook' );
|
6391 |
+
remove_all_actions( 'rank_math/opengraph/twitter' );
|
6392 |
+
add_filter( 'rank_math/frontend/robots', function() {
|
6393 |
+
return [];
|
6394 |
+
});
|
6395 |
+
}else if(ampforwp_is_front_page()){
|
6396 |
+
add_filter( 'rank_math/frontend/robots', function() {
|
6397 |
+
return [];
|
6398 |
+
});
|
6399 |
+
}
|
6400 |
+
// Remove ld+json data added by the Rank math plugin.
|
6401 |
+
if ( ! ampforwp_get_setting( 'ampforwp-seo-rank_math-schema' ) ) {
|
6402 |
+
remove_all_actions( 'rank_math/json_ld' );
|
6403 |
+
}
|
6404 |
+
|
6405 |
do_action( 'rank_math/head' );
|
6406 |
}
|
6407 |
}
|
6664 |
.f_vid { background: #000; }
|
6665 |
<?php }
|
6666 |
}
|
6667 |
+
function ampforwp_webp_featured_image() {
|
6668 |
+
$post_id = ampforwp_get_the_ID();
|
6669 |
+
|
6670 |
+
if ( ! has_post_thumbnail( $post_id )) {
|
6671 |
+
return false;
|
6672 |
+
}
|
6673 |
+
|
6674 |
+
$thumb_id = get_post_thumbnail_id($post_id);
|
6675 |
+
$image_size = apply_filters( 'ampforwp_featured_image', 'full' );
|
6676 |
+
$image = wp_get_attachment_image_src( $thumb_id, $image_size );
|
6677 |
+
if( $image ) {
|
6678 |
+
if(empty($image[1])){
|
6679 |
+
$image[1] = 750;
|
6680 |
+
}
|
6681 |
+
if(empty($image[2])){
|
6682 |
+
$image[2] = 500;
|
6683 |
+
}
|
6684 |
+
$image_output = "<amp-img src='".esc_url($image[0])."' width='".esc_attr($image[1])."' height='".esc_attr($image[2])."' layout='responsive' ></amp-img>";?>
|
6685 |
+
<figure class="amp-wp-article-featured-image">
|
6686 |
+
<?php
|
6687 |
+
if(4 != ampforwp_get_setting('amp-design-selector')){
|
6688 |
+
echo $image_output;
|
6689 |
+
}
|
6690 |
+
?>
|
6691 |
+
</figure>
|
6692 |
+
<?php
|
6693 |
+
}
|
6694 |
+
}
|