AMP for WP – Accelerated Mobile Pages - Version 0.9.70

Version Description

(30th November 2017) = * View More details on https://ampforwp.com/0-9-70-released-stability-update-76th-update/ * Image alt tags are empty which caused issues. #1154 (thanks to @liagua) * ALT and IMG tags are in one line #1442 * Updated the permalink for post view in admin area #1318 * aria-current causing validation issues #1427 * Aligning Captions in the Bottom in Gallery #1428 * Logos height & width should dynamically come from the logo. This was a great UX improvement in my opinion. The logo would good regardless of the kind of image you upload. #1429 * After 0.9.69.1 update Call to undefined function mb_convert_encoding #1447 * Featured image options now also reflect the structured data #1430 * Blur & Stretching issues of Design 3 thumbnails are now fixed. Theyre crisp and clear than ever! #1227 * Related posts are showing on single even when turned off #1434 * Show Related posts CSS only when it is selected #1356 * Author image now displays on author pages #1426 * Category base removal in AMP from url option is only working on the first page #1418 * Bug fixed: PHP Warning DOMDocument Empty string supplied as input #1449 * Video support added in Instant Articles #1300 * Read more tag in Instant articles issue fixed #1415 * Amp carousel issues fixed #1446 #1456 * Compatibilty with Envira Gallery Lazy Loading #1432 * Inline Related Posts in AMP Theme Framework #1457 * Different number of in-content related post and related posts at the footer #1448 * FooGallery update broke all the AMP compatibility, but we fixed it from our side so that users gallery work perfectly #1424 * WPBakery Page Builder Conflict solved #1419 * Goodlife theme Lazy Load compatibility added #1416 * AMP-Facebook-Like Was found but unused Validation Error fixed. #1463 * Playbuzz not displaying if added with https: #1466 * Options Panel labels renamed for better understanding.

Download this release

Release Info

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

Code changes from version 0.9.69.1 to 0.9.70

Files changed (30) hide show
  1. accelerated-moblie-pages.php +2 -2
  2. base_remover/base_remover.php +7 -14
  3. components/components-core.php +1 -1
  4. components/logo/logo.php +5 -11
  5. components/post-pagination/post-pagination.php +1 -1
  6. includes/options/admin-config.php +54 -49
  7. includes/vendor/amp/includes/sanitizers/class-amp-img-sanitizer.php +8 -0
  8. includes/vendor/amp/includes/sanitizers/class-amp-playbuzz-sanitizer.php +8 -0
  9. includes/vendor/vendor-changelog.txt +3 -1
  10. pagebuilder/functions.php +1 -1
  11. readme.txt +30 -3
  12. templates/design-manager/design-1/archive.php +11 -0
  13. templates/design-manager/design-1/elements/featured-image.php +4 -2
  14. templates/design-manager/design-1/elements/related-posts.php +3 -2
  15. templates/design-manager/design-1/header-bar.php +2 -62
  16. templates/design-manager/design-1/style.php +8 -2
  17. templates/design-manager/design-2/archive.php +12 -1
  18. templates/design-manager/design-2/elements/featured-image.php +4 -2
  19. templates/design-manager/design-2/elements/related-posts.php +27 -30
  20. templates/design-manager/design-2/header-bar.php +6 -54
  21. templates/design-manager/design-2/style.php +18 -13
  22. templates/design-manager/design-3/archive.php +17 -4
  23. templates/design-manager/design-3/elements/featured-image.php +5 -3
  24. templates/design-manager/design-3/elements/related-posts.php +37 -40
  25. templates/design-manager/design-3/header-bar.php +2 -55
  26. templates/design-manager/design-3/index.php +5 -3
  27. templates/design-manager/design-3/style.php +25 -24
  28. templates/features.php +217 -67
  29. templates/instant-articles/instant-article-sanitizer.php +23 -0
  30. templates/instant-articles/instant-article.php +5 -2
accelerated-moblie-pages.php CHANGED
@@ -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.69.1
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -18,7 +18,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
18
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
19
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
20
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
21
- define('AMPFORWP_VERSION','0.9.69.1');
22
 
23
  // any changes to AMP_QUERY_VAR should be refelected here
24
  function ampforwp_generate_endpoint(){
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.70
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
18
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
19
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
20
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
21
+ define('AMPFORWP_VERSION','0.9.70');
22
 
23
  // any changes to AMP_QUERY_VAR should be refelected here
24
  function ampforwp_generate_endpoint(){
base_remover/base_remover.php CHANGED
@@ -91,7 +91,7 @@ function amp_flush_rewrite_rules($hard=true){
91
  }
92
 
93
  function ampforwp_category_url_rewrite_rules($rewrite){
94
- global $redux_builder_amp;
95
  $categoryBaseRewrite = $redux_builder_amp['ampforwp-category-base-removel-link'];
96
  $categories = get_categories( array( 'hide_empty' => false ) );
97
  if(is_array( $categories ) && ! empty( $categories ) ) {
@@ -106,16 +106,9 @@ function ampforwp_category_url_rewrite_rules($rewrite){
106
  }
107
  $category_nicename = trim($category_nicename);
108
 
109
- $rewrite["(".$category_nicename.")".'\/amp/?$'] = 'index.php?amp&category_name='.$category_nicename;
110
- $rewrite["(".$category_nicename.")".'\/amp\/page\/?([0-9]{1,})\/?$'] = 'index.php?amp&category_name='.$category_nicename.'&paged=$matches[1]';
111
-
112
-
113
- // Redirect support from Old Category Base
114
- $old_category_base = get_option( 'category_base' ) ? get_option( 'category_base' ) : 'category';
115
- $old_category_base = trim( $old_category_base, '/' );
116
- $rewrite[ $old_category_base . '/(.*)$' ] = 'index.php?category_redirect=$matches[1]';
117
-
118
-
119
  // Redirect support from Old Category Base
120
  $old_category_base = get_option( 'category_base' ) ? get_option( 'category_base' ) : 'category';
121
  $old_category_base = trim( $old_category_base, '/' );
@@ -132,9 +125,9 @@ function ampforwp_tag_url_rewrite_rules($rewrite){
132
  foreach ( $terms as $term ) {
133
  $term_nicename = trim($term->slug);
134
 
135
- $rewrite["(".$term_nicename.")".'\/amp/?$'] = 'index.php?amp&tag='.$term_nicename;
136
- $rewrite["(".$term_nicename.")".'\/amp\/page\/?([0-9]{1,})\/?$'] =
137
- 'index.php?amp&tag='.$term_nicename.'&paged=$matches[1]';
138
 
139
  }
140
 
91
  }
92
 
93
  function ampforwp_category_url_rewrite_rules($rewrite){
94
+ global $redux_builder_amp, $wp_rewrite;
95
  $categoryBaseRewrite = $redux_builder_amp['ampforwp-category-base-removel-link'];
96
  $categories = get_categories( array( 'hide_empty' => false ) );
97
  if(is_array( $categories ) && ! empty( $categories ) ) {
106
  }
107
  $category_nicename = trim($category_nicename);
108
 
109
+ $rewrite['('.$category_nicename.')'.'/amp/?$'] = 'index.php?amp&category_name=$matches[1]';
110
+ $rewrite['('.$category_nicename.')'.'/amp/' . $wp_rewrite->pagination_base . '/?([0-9]{1,})/?$'] = 'index.php?amp&category_name=$matches[1]&paged=$matches[2]';
111
+
 
 
 
 
 
 
 
112
  // Redirect support from Old Category Base
113
  $old_category_base = get_option( 'category_base' ) ? get_option( 'category_base' ) : 'category';
114
  $old_category_base = trim( $old_category_base, '/' );
125
  foreach ( $terms as $term ) {
126
  $term_nicename = trim($term->slug);
127
 
128
+ $rewrite['('.$term_nicename.')'.'/amp/?$'] = 'index.php?amp&tag=$matches[1]';
129
+ $rewrite['('.$term_nicename.')'.'/amp/page/?([0-9]{1,})/?$'] =
130
+ 'index.php?amp&tag=$matches[1]&paged=$matches[2]';
131
 
132
  }
133
 
components/components-core.php CHANGED
@@ -343,7 +343,7 @@ $thisTemplate = new AMP_Post_Template($post_id);
343
  // Custom/Alternative AMP content added through post meta
344
  $ampforwp_the_content = $thisTemplate->get( 'ampforwp_amp_content' );
345
  }
346
- $ampforwp_the_content = apply_filters('ampforwp_content_filter',$ampforwp_the_content);
347
  echo $ampforwp_the_content;
348
  do_action('ampforwp_after_post_content',$thisTemplate); ?>
349
  </div>
343
  // Custom/Alternative AMP content added through post meta
344
  $ampforwp_the_content = $thisTemplate->get( 'ampforwp_amp_content' );
345
  }
346
+ $ampforwp_the_content = apply_filters('ampforwp_modify_the_content',$ampforwp_the_content);
347
  echo $ampforwp_the_content;
348
  do_action('ampforwp_after_post_content',$thisTemplate); ?>
349
  </div>
components/logo/logo.php CHANGED
@@ -3,7 +3,7 @@ function ampforwp_framework_get_logo(){
3
  global $redux_builder_amp; ?>
4
  <div class="amp-logo">
5
  <?php
6
- do_action('ampforwp_header_top_design3');
7
  $set_rel_to_noamp=false;
8
 
9
  if( $redux_builder_amp['amp-on-off-support-for-non-amp-home-page'] ) {
@@ -26,18 +26,12 @@ function ampforwp_framework_get_logo(){
26
  }
27
  }?>
28
 
29
- <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) { ?>
 
 
30
  <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
31
 
32
- <?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
33
-
34
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="<?php echo $redux_builder_amp['opt-media-width']; ?>" height="<?php echo $redux_builder_amp['opt-media-height']; ?>" alt="<?php bloginfo('name'); ?>" class="amp-logo"></amp-img>
35
-
36
- <?php } else { ?>
37
-
38
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt="<?php bloginfo('name'); ?>" class="amp-logo"></amp-img>
39
-
40
- <?php } ?>
41
 
42
  </a>
43
  <?php } else { ?>
3
  global $redux_builder_amp; ?>
4
  <div class="amp-logo">
5
  <?php
6
+ do_action('amp_header_top');
7
  $set_rel_to_noamp=false;
8
 
9
  if( $redux_builder_amp['amp-on-off-support-for-non-amp-home-page'] ) {
26
  }
27
  }?>
28
 
29
+ <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) {
30
+ $logo_id = attachment_url_to_postid($redux_builder_amp['opt-media'] ['url']);
31
+ $alt = ampforwp_default_logo('alt') ?>
32
  <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
33
 
34
+ <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="<?php echo ampforwp_default_logo('width'); ?>" height="<?php echo ampforwp_default_logo('height'); ?>" alt="<?php echo $alt; ?>" class="amp-logo" layout="responsive"></amp-img>
 
 
 
 
 
 
 
 
35
 
36
  </a>
37
  <?php } else { ?>
components/post-pagination/post-pagination.php CHANGED
@@ -154,7 +154,7 @@ function amp_paginated_post_rel_canonical(){
154
  <link rel="canonical" href="<?php echo $new_canonical_url.$post_paginated_page ?>/" /><?php }
155
  }
156
 
157
- add_filter('ampforwp_content_filter','ampforwp_post_paginated_content');
158
  function ampforwp_post_paginated_content($content){
159
  global $redux_builder_amp;
160
  $ampforwp_new_content = '';
154
  <link rel="canonical" href="<?php echo $new_canonical_url.$post_paginated_page ?>/" /><?php }
155
  }
156
 
157
+ add_filter('ampforwp_modify_the_content','ampforwp_post_paginated_content');
158
  function ampforwp_post_paginated_content($content){
159
  global $redux_builder_amp;
160
  $ampforwp_new_content = '';
includes/options/admin-config.php CHANGED
@@ -401,7 +401,18 @@ Redux::setArgs( "redux_builder_amp", $args );
401
  , 'accelerated-mobile-pages' ),
402
  'icon' => 'el el-cogs'
403
  ) );
404
-
 
 
 
 
 
 
 
 
 
 
 
405
  Redux::setSection( $opt_name, array(
406
  'title' => __( 'General', 'accelerated-mobile-pages' ),
407
  // 'desc' => __( 'For full documentation on this field, visit: ', 'accelerated-mobile-pages' ) . '<a href="http://docs.reduxframework.com/core/fields/text/" target="_blank">http://docs.reduxframework.com/core/fields/text/</a>',
@@ -415,7 +426,8 @@ Redux::setArgs( "redux_builder_amp", $args );
415
  'url' => true,
416
  'title' => __('Logo', 'accelerated-mobile-pages'),
417
  'subtitle' => __('Upload a logo for the AMP version.', 'accelerated-mobile-pages'),
418
- 'desc' => __('Recommend logo size is: 190x36', 'accelerated-mobile-pages')
 
419
  ),
420
  array(
421
  'id' => 'ampforwp-custom-logo-dimensions',
@@ -509,13 +521,6 @@ Redux::setArgs( "redux_builder_amp", $args );
509
  'subtitle' => __('Enable AMP Support on Archives.', 'accelerated-mobile-pages'),
510
  'default' => '0'
511
  ),
512
- array(
513
- 'id' => 'ampforwp-sub-categories-support',
514
- 'type' => 'switch',
515
- 'title' => __('Sub-Categories', 'accelerated-mobile-pages'),
516
- 'subtitle' => __('Display sub-categories on category pages', 'accelerated-mobile-pages'),
517
- 'default' => '0'
518
- ),
519
 
520
  // array(
521
  // 'id' => 'amp-ad-places',
@@ -1047,6 +1052,7 @@ Redux::setArgs( "redux_builder_amp", $args );
1047
  'desc' => __('Example: UA-XXXXX-Y', 'accelerated-mobile-pages' ),
1048
  'default' => 'UA-XXXXX-Y',
1049
  ),
 
1050
  // Advance Tracking options for Google Analytics
1051
  array(
1052
  'id' => 'ampforwp-ga-field-advance-switch',
@@ -1183,7 +1189,7 @@ Redux::setArgs( "redux_builder_amp", $args );
1183
  array(
1184
  'id' => 'amp-use-gtm-option',
1185
  'type' => 'switch',
1186
- 'title' => __( 'Use Google Tag Manager', 'accelerated-mobile-pages' ),
1187
  'subtitle' => __( 'Select your Analytics provider.', 'accelerated-mobile-pages' ),
1188
  'default' => 0,
1189
  ),
@@ -1219,7 +1225,17 @@ Redux::setArgs( "redux_builder_amp", $args );
1219
  'required' => array(
1220
  array('amp-use-gtm-option', '=' , '1')),
1221
  ),
1222
-
 
 
 
 
 
 
 
 
 
 
1223
  array(
1224
  'id' =>'amp-fb-pixel',
1225
  'type' => 'switch',
@@ -1753,16 +1769,6 @@ Redux::setSection( $opt_name, array(
1753
  'default' => 0,
1754
 
1755
  ),
1756
- array(
1757
- 'id' => 'amp-meta-permissions',
1758
- 'type' => 'select',
1759
- 'title' => __('AMP Metabox Permission', 'accelerated-mobile-pages'),
1760
- 'options' => array(
1761
- 'all' => 'All users who can post',
1762
- 'admin' => 'Only to Admin'
1763
- ),
1764
- 'default' => 'all',
1765
- ),
1766
  array(
1767
  'id' => 'amp-header-text-area-for-html',
1768
  'type' => 'textarea',
@@ -1857,6 +1863,16 @@ Redux::setSection( $opt_name, array(
1857
  'true' => 'true',
1858
  'false' => 'false',
1859
  'default' => 0,
 
 
 
 
 
 
 
 
 
 
1860
  ),
1861
  array(
1862
  'id' => 'ampforwp-development-mode',
@@ -2645,10 +2661,8 @@ Redux::setSection( $opt_name, array(
2645
  'id' => 'ampforwp-homepage-posts-image-modify-size',
2646
  'type' => 'switch',
2647
  'title' => __('Override Homepage Thumbnail Size', 'accelerated-mobile-pages'),
 
2648
  'default' => 0,
2649
- 'required' => array(
2650
- array('amp-design-selector','!=',3)
2651
- )
2652
  ),
2653
  array(
2654
  'id' => 'ampforwp-homepage-posts-design-1-2-width',
@@ -2672,31 +2686,6 @@ Redux::setSection( $opt_name, array(
2672
  array('ampforwp-homepage-posts-image-modify-size','=',1)
2673
  )
2674
  ),
2675
- array(
2676
- 'id' => 'ampforwp-homepage-posts-design-3-width',
2677
- 'type' => 'text',
2678
- 'title' => __('Image Width', 'accelerated-mobile-pages'),
2679
- 'subtitle' => __('Defaults to 450', 'accelerated-mobile-pages'),
2680
- 'default' => 330,
2681
- 'required' => array(
2682
- array('amp-design-selector','=',3),
2683
- array('ampforwp-homepage-posts-image-modify-size','=',1)
2684
- )
2685
- ),
2686
- array(
2687
- 'id' => 'ampforwp-homepage-posts-design-3-height',
2688
- 'type' => 'text',
2689
- 'title' => __('Image Height', 'accelerated-mobile-pages'),
2690
- 'subtitle' => __('Defaults to 270', 'accelerated-mobile-pages'),
2691
- 'default' => 198,
2692
- 'required' => array(
2693
- array('amp-design-selector','=',3),
2694
- array('ampforwp-homepage-posts-image-modify-size','=',1)
2695
- )
2696
- ),
2697
-
2698
-
2699
-
2700
  )
2701
  ));
2702
 
@@ -2840,6 +2829,15 @@ Redux::setSection( $opt_name, array(
2840
  'subtitle' => __('Insert Related Posts between the content', 'accelerated-mobile-pages'),
2841
  'default' => 0,
2842
  ),
 
 
 
 
 
 
 
 
 
2843
 
2844
  // array(
2845
  // 'id' => 'ampforwp-comments-banner',
@@ -3303,6 +3301,13 @@ Redux::setSection( $opt_name, array(
3303
  'true' => 'true',
3304
  'false' => 'false',
3305
  ),
 
 
 
 
 
 
 
3306
  )
3307
 
3308
  ) );
401
  , 'accelerated-mobile-pages' ),
402
  'icon' => 'el el-cogs'
403
  ) );
404
+
405
+ function ampforwp_default_logo_settings($param=""){
406
+ $custom_logo_id = '';
407
+ $image = '';
408
+ $value = '';
409
+ $custom_logo_id = get_theme_mod( 'custom_logo' );
410
+ $image = wp_get_attachment_image_src( $custom_logo_id , 'full');
411
+ if( $image ){
412
+ return $image[0];
413
+ }
414
+ return $value;
415
+ }
416
  Redux::setSection( $opt_name, array(
417
  'title' => __( 'General', 'accelerated-mobile-pages' ),
418
  // 'desc' => __( 'For full documentation on this field, visit: ', 'accelerated-mobile-pages' ) . '<a href="http://docs.reduxframework.com/core/fields/text/" target="_blank">http://docs.reduxframework.com/core/fields/text/</a>',
426
  'url' => true,
427
  'title' => __('Logo', 'accelerated-mobile-pages'),
428
  'subtitle' => __('Upload a logo for the AMP version.', 'accelerated-mobile-pages'),
429
+ 'desc' => __('Recommend logo size is: 190x36', 'accelerated-mobile-pages'),
430
+ 'default' => array('url' => ampforwp_default_logo_settings() ),
431
  ),
432
  array(
433
  'id' => 'ampforwp-custom-logo-dimensions',
521
  'subtitle' => __('Enable AMP Support on Archives.', 'accelerated-mobile-pages'),
522
  'default' => '0'
523
  ),
 
 
 
 
 
 
 
524
 
525
  // array(
526
  // 'id' => 'amp-ad-places',
1052
  'desc' => __('Example: UA-XXXXX-Y', 'accelerated-mobile-pages' ),
1053
  'default' => 'UA-XXXXX-Y',
1054
  ),
1055
+
1056
  // Advance Tracking options for Google Analytics
1057
  array(
1058
  'id' => 'ampforwp-ga-field-advance-switch',
1189
  array(
1190
  'id' => 'amp-use-gtm-option',
1191
  'type' => 'switch',
1192
+ 'title' => __( 'Google Tag Manager', 'accelerated-mobile-pages' ),
1193
  'subtitle' => __( 'Select your Analytics provider.', 'accelerated-mobile-pages' ),
1194
  'default' => 0,
1195
  ),
1225
  'required' => array(
1226
  array('amp-use-gtm-option', '=' , '1')),
1227
  ),
1228
+ // Google Cliend ID API
1229
+ array(
1230
+ 'id' => 'ampforwp-ga-clientid-api-gtm',
1231
+ 'type' => 'info',
1232
+ 'style' => 'info',
1233
+ 'desc' => '<a href="https://ampforwp.com/tutorials/article/set-google-amp-client-id-api/" target="_blank">Check this Tutorial to set it up</a>',
1234
+ 'title' => __('Set up Google AMP Client ID API', 'accelerated-mobile-pages'),
1235
+ 'required' => array(
1236
+ array('amp-use-gtm-option', '=' , '1'),
1237
+ ),
1238
+ ),
1239
  array(
1240
  'id' =>'amp-fb-pixel',
1241
  'type' => 'switch',
1769
  'default' => 0,
1770
 
1771
  ),
 
 
 
 
 
 
 
 
 
 
1772
  array(
1773
  'id' => 'amp-header-text-area-for-html',
1774
  'type' => 'textarea',
1863
  'true' => 'true',
1864
  'false' => 'false',
1865
  'default' => 0,
1866
+ ),
1867
+ array(
1868
+ 'id' => 'amp-meta-permissions',
1869
+ 'type' => 'select',
1870
+ 'title' => __('Show Metabox in Post Editor to', 'accelerated-mobile-pages'),
1871
+ 'options' => array(
1872
+ 'all' => 'All users who can post',
1873
+ 'admin' => 'Only to Admin'
1874
+ ),
1875
+ 'default' => 'all',
1876
  ),
1877
  array(
1878
  'id' => 'ampforwp-development-mode',
2661
  'id' => 'ampforwp-homepage-posts-image-modify-size',
2662
  'type' => 'switch',
2663
  'title' => __('Override Homepage Thumbnail Size', 'accelerated-mobile-pages'),
2664
+ 'required' => array( array( 'amp-design-selector','!=',3 ) ),
2665
  'default' => 0,
 
 
 
2666
  ),
2667
  array(
2668
  'id' => 'ampforwp-homepage-posts-design-1-2-width',
2686
  array('ampforwp-homepage-posts-image-modify-size','=',1)
2687
  )
2688
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2689
  )
2690
  ));
2691
 
2829
  'subtitle' => __('Insert Related Posts between the content', 'accelerated-mobile-pages'),
2830
  'default' => 0,
2831
  ),
2832
+ array(
2833
+ 'id' => 'ampforwp-number-of-inline-related-posts',
2834
+ 'type' => 'text',
2835
+ 'title' => __('Number of In-Content Related Post', 'accelerated-mobile-pages'),
2836
+ 'subtitle' => __('Type the number of In-Content related posts you need, Eg : 2', 'accelerated-mobile-pages'),
2837
+ 'validate' => 'numeric',
2838
+ 'default' => '3',
2839
+ 'required' => array( array('ampforwp-inline-related-posts', '=' , '1') ),
2840
+ ),
2841
 
2842
  // array(
2843
  // 'id' => 'ampforwp-comments-banner',
3301
  'true' => 'true',
3302
  'false' => 'false',
3303
  ),
3304
+ array(
3305
+ 'id' => 'ampforwp-sub-categories-support',
3306
+ 'type' => 'switch',
3307
+ 'title' => __('Sub-Categories under Category', 'accelerated-mobile-pages'),
3308
+ 'subtitle' => __('Display sub-categories on category pages', 'accelerated-mobile-pages'),
3309
+ 'default' => '0'
3310
+ ),
3311
  )
3312
 
3313
  ) );
includes/vendor/amp/includes/sanitizers/class-amp-img-sanitizer.php CHANGED
@@ -31,6 +31,14 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
31
  for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
32
  $node = $nodes->item( $i );
33
 
 
 
 
 
 
 
 
 
34
  if ( ! $node->hasAttribute( 'src' ) || '' === $node->getAttribute( 'src' ) ) {
35
  $node->parentNode->removeChild( $node );
36
  continue;
31
  for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
32
  $node = $nodes->item( $i );
33
 
34
+ // Add Foo Gallery Support
35
+ if ( $node->hasAttribute( 'data-src-fg' ) ) {
36
+ $image_scr_from_data_src = $node->getAttribute( 'data-src-fg' ) ;
37
+ if ( ! $node->hasAttribute( 'src' ) || '' === $node->getAttribute( 'src' ) ) {
38
+ $node->setAttribute( 'src', $image_scr_from_data_src );
39
+ }
40
+ }
41
+
42
  if ( ! $node->hasAttribute( 'src' ) || '' === $node->getAttribute( 'src' ) ) {
43
  $node->parentNode->removeChild( $node );
44
  continue;
includes/vendor/amp/includes/sanitizers/class-amp-playbuzz-sanitizer.php CHANGED
@@ -52,6 +52,14 @@ class AMP_Playbuzz_Sanitizer extends AMP_Base_Sanitizer {
52
  continue;
53
  }
54
 
 
 
 
 
 
 
 
 
55
  $new_node = AMP_DOM_Utils::create_node( $this->dom, self::$script_slug, $new_attributes );
56
 
57
  $node->parentNode->replaceChild( $new_node, $node );
52
  continue;
53
  }
54
 
55
+ if ( $new_attributes['src'] ) {
56
+ $checker = preg_match("@^https?://@", $new_attributes['src'] ) ;
57
+ }
58
+
59
+ if ( empty( $checker ) ) {
60
+ $new_attributes['src'] = 'https:' . $new_attributes['src'];
61
+ }
62
+
63
  $new_node = AMP_DOM_Utils::create_node( $this->dom, self::$script_slug, $new_attributes );
64
 
65
  $node->parentNode->replaceChild( $new_node, $node );
includes/vendor/vendor-changelog.txt CHANGED
@@ -35,4 +35,6 @@ amp\includes\class-amp-post-template.php, line no: 58, Issue no: 1310
35
  Check #1033 for more details on 10 and 11
36
 
37
  12. Argument specific filters added at line number 43 and 47 of class-amp-content.php
38
- Reason: To extend the functionality of sidebars and Pagebuilder
 
 
35
  Check #1033 for more details on 10 and 11
36
 
37
  12. Argument specific filters added at line number 43 and 47 of class-amp-content.php
38
+ Reason: To extend the functionality of sidebars and Pagebuilder
39
+
40
+ 13. Foo Gallery Support code added in class-amp-img-sanitizer.php in line no 35 #1424
pagebuilder/functions.php CHANGED
@@ -34,7 +34,7 @@ function amppbbase_admin_scripts( $hook_suffix ){
34
  'plupload',
35
  'plupload-all',
36
  ),AMPFORWP_VERSION, true );
37
- add_action( 'admin_footer', 'js_templates');
38
 
39
 
40
  }
34
  'plupload',
35
  'plupload-all',
36
  ),AMPFORWP_VERSION, true );
37
+ add_action( 'admin_footer', 'js_templates', 999);
38
 
39
 
40
  }
readme.txt CHANGED
@@ -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: 4.9
7
- Stable tag: 0.9.69.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -150,8 +150,35 @@ You can contact me using this url: http://ampforwp.com/contact/
150
 
151
  == Changelog ==
152
 
153
- = 0.9.69.1 (21st November 2017) =
154
- * Menu Text Encoding issue after 0.9.69 fixed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
 
156
  = 0.9.69 (20th November 2017) =
157
  * View More details on https://ampforwp.com/0-9-69-released-stability-update-75th-update/
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9
7
+ Stable tag: 0.9.70
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
150
 
151
  == Changelog ==
152
 
153
+ = 0.9.70 (30th November 2017) =
154
+ * View More details on https://ampforwp.com/0-9-70-released-stability-update-76th-update/
155
+ * Image alt tags are empty which caused issues. #1154 (thanks to @liagua)
156
+ * ALT and IMG tags are in one line #1442
157
+ * Updated the permalink for post view in admin area #1318
158
+ * aria-current causing validation issues #1427
159
+ * Aligning Captions in the Bottom in Gallery #1428
160
+ * Logo’s height & width should dynamically come from the logo. This was a great UX improvement in my opinion. The logo would good regardless of the kind of image you upload. #1429
161
+ * After 0.9.69.1 update – Call to undefined function mb_convert_encoding #1447
162
+ * Featured image options now also reflect the structured data #1430
163
+ * Blur & Stretching issues of Design 3 thumbnails are now fixed. They’re crisp and clear than ever! #1227
164
+ * Related posts are showing on single even when turned off #1434
165
+ * Show Related posts CSS only when it is selected #1356
166
+ * Author image now displays on author pages #1426
167
+ * Category base removal in AMP from url option is only working on the first page #1418
168
+ * Bug fixed: PHP Warning DOMDocument Empty string supplied as input #1449
169
+ * Video support added in Instant Articles #1300
170
+ * Read more tag in Instant articles issue fixed #1415
171
+ * Amp carousel issues fixed #1446 #1456
172
+ * Compatibilty with Envira Gallery Lazy Loading #1432
173
+ * Inline Related Posts in AMP Theme Framework #1457
174
+ * Different number of in-content related post and related posts at the footer #1448
175
+ * FooGallery update broke all the AMP compatibility, but we fixed it from our side so that user’s gallery work perfectly #1424
176
+ * WPBakery Page Builder Conflict solved #1419
177
+ * Goodlife theme Lazy Load compatibility added #1416
178
+ * AMP-Facebook-Like Was found but unused Validation Error fixed. #1463
179
+ * Playbuzz not displaying if added with https: #1466
180
+ * Options Panel labels renamed for better understanding.
181
+
182
 
183
  = 0.9.69 (20th November 2017) =
184
  * View More details on https://ampforwp.com/0-9-69-released-stability-update-75th-update/
templates/design-manager/design-1/archive.php CHANGED
@@ -44,6 +44,17 @@
44
  <?php $count = 1; ?>
45
 
46
  <?php if ( is_archive() ) {
 
 
 
 
 
 
 
 
 
 
 
47
  the_archive_title( '<h1 class="page-title">', '</h1>' );
48
 
49
  $arch_desc = $sanitizer->get_amp_content();
44
  <?php $count = 1; ?>
45
 
46
  <?php if ( is_archive() ) {
47
+ if( is_author() ){
48
+ $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
49
+ if( true == ampforwp_comment_gravatar_checker($curauth->user_email) ){
50
+ $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
51
+ if($curauth_url){ ?>
52
+ <div class="author-archive">
53
+ <amp-img src="<?php echo esc_url($curauth_url); ?>" width="90" height="90" layout="fixed"></amp-img>
54
+ </div>
55
+ <?php }
56
+ }
57
+ }
58
  the_archive_title( '<h1 class="page-title">', '</h1>' );
59
 
60
  $arch_desc = $sanitizer->get_amp_content();
templates/design-manager/design-1/elements/featured-image.php CHANGED
@@ -10,9 +10,11 @@ if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf
10
  $caption = $featured_image['caption'];
11
  }
12
  if ( ampforwp_is_custom_field_featured_image() ) {
13
- $amp_img_src = ampforwp_cf_featured_image_src();
 
 
14
  if( $amp_img_src ){
15
- $amp_html = "<amp-img src='$amp_img_src' width=300 height=250 layout=responsive ></amp-img>";
16
  }
17
  }
18
  if( true == $redux_builder_amp['ampforwp-featured-image-from-content'] && ampforwp_get_featured_image_from_content()) {
10
  $caption = $featured_image['caption'];
11
  }
12
  if ( ampforwp_is_custom_field_featured_image() ) {
13
+ $amp_img_src = ampforwp_cf_featured_image_src();
14
+ $amp_img_width = ampforwp_cf_featured_image_src('width');
15
+ $amp_img_height = ampforwp_cf_featured_image_src('height');
16
  if( $amp_img_src ){
17
+ $amp_html = "<amp-img src='$amp_img_src' width=$amp_img_width height=$amp_img_height layout=responsive ></amp-img>";
18
  }
19
  }
20
  if( true == $redux_builder_amp['ampforwp-featured-image-from-content'] && ampforwp_get_featured_image_from_content()) {
templates/design-manager/design-1/elements/related-posts.php CHANGED
@@ -61,8 +61,8 @@
61
  }
62
  }//end of block for tags
63
 
64
-
65
- $my_query = new wp_query( $args );
66
  if( $my_query->have_posts() ) { ?>
67
  <div class="amp-wp-content relatedpost">
68
  <div class="related_posts">
@@ -100,6 +100,7 @@
100
  </div>
101
  </div> <?php
102
  }
 
103
  wp_reset_postdata();
104
  ?>
105
  <?php do_action('ampforwp_below_related_post',$this);
61
  }
62
  }//end of block for tags
63
 
64
+ if( $redux_builder_amp['ampforwp-single-select-type-of-related'] ){
65
+ $my_query = new wp_query( $args );
66
  if( $my_query->have_posts() ) { ?>
67
  <div class="amp-wp-content relatedpost">
68
  <div class="related_posts">
100
  </div>
101
  </div> <?php
102
  }
103
+ }
104
  wp_reset_postdata();
105
  ?>
106
  <?php do_action('ampforwp_below_related_post',$this);
templates/design-manager/design-1/header-bar.php CHANGED
@@ -1,68 +1,8 @@
1
  <?php global $redux_builder_amp; ?>
2
  <header id="#top" class="amp-wp-header">
3
  <div class="ampforwp-logo-area" >
4
- <?php
5
- do_action('ampforwp_header_top_design1');
6
- $nonamp_home_url = "";
7
- $nonamp_home_url = add_query_arg( array( 'nonamp' => '1' ), $this->get( 'home_url' ) );
8
-
9
- if( $redux_builder_amp['amp-on-off-support-for-non-amp-home-page'] ) {
10
- if( $redux_builder_amp['amp-mobile-redirection'] ) { ?>
11
- <a href="<?php echo esc_url( $nonamp_home_url ); ?>" rel="nofollow">
12
- <?php } else { ?>
13
- <a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ); ?>">
14
- <?php }
15
- } else { ?>
16
- <?php if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
17
- <a href="<?php echo ampforwp_url_controller( $this->get( 'home_url' ) ) ; ?>">
18
- <?php } else {
19
- if( $redux_builder_amp['amp-mobile-redirection'] ) { ?>
20
- <a href="<?php echo esc_url( $nonamp_home_url ); ?>" rel="nofollow">
21
- <?php } else { ?>
22
- <a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ); ?>" >
23
- <?php }
24
- }
25
- } ?>
26
-
27
- <?php if ( isset($redux_builder_amp['opt-media']['url'] ) && true == ($redux_builder_amp['opt-media']['url'])) {
28
- $logo_id = attachment_url_to_postid($redux_builder_amp['opt-media'] ['url']);
29
- $logo_alt = get_post_meta( $logo_id, '_wp_attachment_image_alt', true) ;
30
- if($logo_alt){
31
- $alt = $logo_alt;
32
- }
33
- else {
34
- $alt = get_bloginfo('name');
35
- }
36
- if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
37
-
38
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="<?php echo $redux_builder_amp['opt-media-width']; ?>" height="<?php echo $redux_builder_amp['opt-media-height']; ?>" alt="<?php echo $alt; ?>" class="amp-logo"></amp-img>
39
-
40
- <?php } else { ?>
41
-
42
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt="<?php echo $alt; ?>" class="amp-logo"></amp-img>
43
-
44
- <?php } ?>
45
- <?php } else {
46
- echo esc_html( $this->get( 'blog_name' ) );
47
- } ?>
48
- </a>
49
-
50
- <?php
51
-
52
- if($redux_builder_amp['amp-on-off-support-for-non-amp-home-page']){ ?>
53
- <a href="<?php echo esc_url( $nonamp_home_url ); ?>">
54
- <?php }else{ ?>
55
-
56
- <?php if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
57
-
58
- <a href="<?php echo ampforwp_url_controller( $this->get( 'home_url' ) ); ?>">
59
-
60
- <?php } else {?>
61
-
62
- <a href="<?php echo esc_url( $nonamp_home_url ); ?>" rel="nofollow">
63
-
64
- <?php }
65
- } ?>
66
  <?php $site_icon_url = $this->get( 'site_icon_url' );
67
  if ( $site_icon_url ) : ?>
68
  <amp-img src="<?php echo esc_url( $site_icon_url ); ?>" width="32" height="32" class="amp-wp-site-icon"></amp-img>
1
  <?php global $redux_builder_amp; ?>
2
  <header id="#top" class="amp-wp-header">
3
  <div class="ampforwp-logo-area" >
4
+ <?php do_action('ampforwp_header_top_design1'); ?>
5
+ <?php amp_logo(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  <?php $site_icon_url = $this->get( 'site_icon_url' );
7
  if ( $site_icon_url ) : ?>
8
  <amp-img src="<?php echo esc_url( $site_icon_url ); ?>" width="32" height="32" class="amp-wp-site-icon"></amp-img>
templates/design-manager/design-1/style.php CHANGED
@@ -58,12 +58,12 @@ blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background:
58
  .amp-wp-title {color: <?php echo sanitize_hex_color( $text_color ); ?>;display: block;flex: 1 0 100%;font-weight: 900;margin: 0;width: 100%;}.amp-wp-meta {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;display: inline-block;flex: 2 1 50%;font-size: .875em;line-height: 1.7em;margin: 0;padding: 0;}.ampforwp-meta-info{margin-top: 0px;}.amp-wp-article-header .amp-wp-meta:last-of-type {text-align: right;}.amp-wp-article-header .amp-wp-meta:first-of-type {text-align: left;}.amp-wp-byline amp-img,.amp-wp-byline .amp-wp-author {display: inline-block;vertical-align: middle;}.amp-wp-byline amp-img {border: 1px solid <?php echo sanitize_hex_color( $link_color ); ?>;border-radius: 50%;position: relative;margin-right: 6px;}.amp-wp-posted-on {text-align: right;}.hide-meta-info{ display: none; }
59
  .amp-wp-article-featured-image {margin: 1.5em 16px 1.5em;}.amp-wp-article-featured-image amp-img {margin: 0 auto;}.amp-wp-article-featured-image.wp-caption .wp-caption-text, .ampforwp-gallery-item .wp-caption-text {margin: 0 18px;}.amp-wp-frontpage .the_content {padding: 10px;}
60
  .ampforwp-gallery-item.amp-carousel-slide { padding-bottom: 20px;}
61
- .amp-wp-frontpage .ampforwp-title {margin-left:10px;}.amp-wp-article a{text-decoration:none}.amp-wp-article-content {margin: 0 16px;}.amp-wp-article-content ul,.amp-wp-article-content ol {margin-left: 1em;}.amp-wp-article-content amp-img {margin: 0 auto;}.amp-wp-article-content amp-img.alignright {margin: 0 0 1em 16px;}.amp-wp-article-content amp-img.alignleft {margin: 0 16px 1em 0;} .amp-disqus-comments {padding: 15px;}.amp-disqus-comments amp-iframe{background: none;}.wp-caption {padding: 0;}.wp-caption.alignleft {margin-right: 16px;}.wp-caption.alignright { margin-left: 16px;}.wp-caption-text {border-bottom: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;margin: 0;padding: .66em 10px .75em;text-align: center;} amp-carousel {background: <?php echo sanitize_hex_color( $border_color ); ?>;margin: 0 -16px 1.5em;} amp-iframe,amp-youtube,amp-instagram,amp-vine {background: <?php echo sanitize_hex_color( $border_color ); ?>;margin: 0 -16px 1.5em; } .amp-wp-article-content amp-carousel amp-img {border: none;} amp-carousel > amp-img > img {object-fit: contain; } .amp-wp-iframe-placeholder { background: <?php echo sanitize_hex_color( $border_color ); ?> url( <?php echo esc_url( $get_customizer->get( 'placeholder_image_url' ) ); ?> ) no-repeat center 40%;background-size: 48px 48px;min-height: 48px;} .amp-wp-article-footer .amp-wp-meta {display: block;} .amp-wp-tags{ list-style-type: none; padding: 0; margin: 0 0 9px 0; display: inline-flex; } .amp-wp-tags li{display:inline; padding-left: 5px; } .amp-wp-tax-category span{margin-right:5px;} .amp-wp-tax-category, .amp-wp-tax-tag { color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;margin: 1.5em 16px;}.ampforwp-comment-button {margin-bottom:20px;} .amp-wp-comments-link {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;text-align: center;margin: 2.25em 0 1.5em;} .amp-wp-comments-link a { border-style: solid;border-color: <?php echo sanitize_hex_color( $border_color ); ?>;border-width: 1px 1px 2px;border-radius: 4px;background-color: transparent;color: <?php echo sanitize_hex_color( $link_color ); ?>;cursor: pointer; display: block;font-size: 14px;font-weight: 600;line-height: 18px;margin: 0 auto;max-width: 200px;padding: 11px 16px;text-decoration: none;width: 50%;-webkit-transition: background-color 0.2s ease;transition: background-color 0.2s ease;} .page-title {margin: 0 15px; font-size: 1.17em; }.amp-sub-archives li{width: 50%;} .amp-sub-archives ul{padding: 0;list-style: none;display: flex;font-size: 12px;line-height: 1.2;margin: 5px 1.5em 10px 1.5em;} .amp-wp-footer {border-top: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;margin: calc(1.5em - 1px) 0 0;padding-bottom:25px;}
62
  .amp-wp-footer div{margin:0 auto;max-width:calc(840px - 32px);padding:1.25em 16px;position:relative}.amp-wp-footer h2{font-size:1em;line-height:1.375em;margin:0 0 .5em}
63
  .amp-wp-footer p {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .8em;line-height: 1.5em;margin: 0 15px 0 0;}
64
  .amp-wp-footer a{text-decoration:none}.copyright_txt{float:left}.back-to-top{float:right}.amp-wp-header .nav_container{float: right;top: 16px;line-height: 1; right: 65px; position: absolute}.toggle-text{position:absolute;right:0;height:22px;width:28px}.toggle-text span{display:block;position:absolute;height:2px;width:25px;background:#fff;border-radius:19px;opacity:1;left:0}.toggle-text span:nth-child(2){top:9px}.toggle-text span:nth-child(3){top:18px}.amp-wp-home .amp-wp-meta{margin:5px 0}.amp-wp-home .amp-wp-content p{display:inline-block;width:100%}.ampforwp-custom-index .amp-wp-title a {text-decoration: none;color: <?php echo sanitize_hex_color( $text_color ); ?>;}.comment-button-wrapper a,.related_posts ol{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.amp-wp-meta{display:flex}.amp-wp-posted-on{display:initial}#pagination .next,#pagination .prev{display:inline-block}.ampforwp-custom-index .amp-wp-content{margin-bottom:30px}.pagination-holder{margin:1.5em 16px}#pagination .next{float:right}.amp-wp-home .amp-wp-content p{display:inline}.home-post-image{float:right;margin:0 0 10px 20px}.amp-wp-article-content amp-img{max-width:100%}.amp-wp-meta.amp-wp-tax-category,.amp-wp-meta.amp-wp-tax-tag{margin:0}.amp-wp-meta.amp-wp-tax-tag{display:initial}.ampforwp-social-icons{margin:1.5em 16px}.custom-amp-socialsharing-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; }
65
  .custom-amp-socialsharing-icon amp-img{ top: 4px; }
66
- .custom-amp-socialsharing-line{background:#00b900}.custom-amp-socialsharing-vk{background:#45668e}.custom-amp-social-sharing-odnoklassniki{background:#ed812b}.comment-button-wrapper a{border-style:solid;border-color:#c2c2c2;border-width:1px 1px 2px;border-radius:4px;background-color:transparent;color:#0a89c0;cursor:pointer;display:block;font-size:14px;font-weight:600;text-align:center;line-height:18px;margin:0 auto;max-width:200px;padding:11px 16px;text-decoration:none;width:50%;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.close-nav,.comments_list div,.related_posts ol li,.toggle-navigation ul,.toggle-navigationv2 ul li a{display:inline-block}main .amp-wp-content.comments_list,main .amp-wp-content.relatedpost{background:0 0;box-shadow:none;max-width:1030px}.relatedpost{margin:2em 16px}.comments_list h3,.related_posts span{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333} .related_posts span { display: block;} .related_posts ol{list-style-type:none;margin:0;padding:0}.related_posts ol li{width:100%;margin-bottom:12px;padding:0}.related_posts .related_link a{color:#000;font-size:18px}.related_posts ol li amp-img{width:100px;float:left;margin-right:15px}.related_posts ol li p{font-size:12px;color:#999;line-height:1.2;margin:12px 0 0}.no_related_thumbnail{padding:15px 18px}.comments_list{margin:2.5em 16px}.comments_list ul{margin:0;padding:0}.comments_list ul.children{padding-bottom:10px;margin-left:4%;width:96%}
67
  .comments_list ul li p{margin:0;font-size:14px;clear:both;padding-top:5px; word-break:break-word;}
68
  .comments_list ul li{font-family:sans-serif;font-size:11px;list-style-type:none;margin-bottom:12px;background:#fefefe;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:0 2px 3px rgba(0,0,0,.05);-webkit-box-shadow:0 2px 3px rgba(0,0,0,.05);box-shadow:0 2px 3px rgba(0,0,0,.05);padding:0;max-width:1000px;width:96%}.comments_list ul li .says{margin-right:4px}.comments_list li li,.comments_list li li li{margin:20px 20px 10px}.comments_list ul li p{font-family:Merriweather,'Times New Roman',Times,Serif}.comments_list ul li .comment-body{padding:10px 0 15px}.comment-author{float:left}.single-post footer.comment-meta{padding-bottom:0; line-height: 1.9;}.comments_list li li{background:#f7f7f7;box-shadow:none;border:1px solid #eee} .page-numbers{ padding: 9px 10px; background: #fff; font-size: 14px; } .comment-author-img{float: left; margin-right: 5px; border-radius: 60px;} .comment-content amp-img{max-width: 300px;} amp-sidebar{width:250px}.amp-sidebar-image{line-height:100px;vertical-align:middle}.amp-close-image{top:15px;left:225px;cursor:pointer}.toggle-navigationv2 ul{list-style-type:none;margin:0;font-family:sans-serif;padding:0}.toggle-navigationv2 ul ul li a{padding-left:35px;background:#fff;display:inline-block}.toggle-navigationv2 ul li a{padding:10px 15px 10px 25px;width:88%;text-decoration:none;background:#fafafa;font-size:13px;border-bottom:1px solid #efefef}.close-nav{font-size:12px;font-family:sans-serif;background:rgba(0,0,0,.25);letter-spacing:1px;padding:10px;border-radius:100px;line-height:8px;margin:14px;left:191px;color:#fff}.close-nav:hover{background:rgba(0,0,0,.45)}.toggle-navigation ul{list-style-type:none;margin:0;padding:0;width:100%}.menu-all-pages-container:after{content:"";clear:both}.toggle-navigation ul li{font-size:13px;border-bottom:1px solid rgba(0,0,0,.11);padding:11px 0;width:25%;float:left;text-align:center;margin-top:6px}.toggle-navigation ul ul{display:none}.toggle-navigation ul li a{color:#eee;padding:15px}.toggle-navigation{display:none;background:#444}.nav_container:hover+.toggle-navigation,.toggle-navigation:active,.toggle-navigation:focus,.toggle-navigation:hover{display:inline-block;width:100%}#amp-user-notification1 p{display:inline-block}amp-user-notification{padding:5px;text-align:center;background:#fff;border-top:1px solid} amp-user-notification button {padding: 8px 10px;background: <?php echo sanitize_hex_color( $header_background_color ); ?>;color: <?php echo sanitize_hex_color( $header_color ); ?>;margin-left: 5px;border: 0;}amp-user-notification button:hover {cursor: pointer} .amp-ad-wrapper {text-align: center} <?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_single() ) { ?>body {padding-bottom: 43px;}<?php } ?> .sticky_social a{text-decoration:none}.sticky_social{width:100%;bottom:0;display:block;left:0;box-shadow:0 4px 7px #000;background:#fff;padding:7px 0 0;position:fixed;margin:0;z-index:10;text-align:center}.whatsapp-share-icon{width:50px;height:28px;display:inline-block;background:#5cbe4a;padding:4px 0;position:relative;top:-4px}.amp-wp-tax-category span:first-child:after{content:' '}.amp-wp-tax-category span:after,.amp-wp-tax-tag span:after{content:', '}.amp-wp-tax-category span:last-child:after,.amp-wp-tax-tag span:last-child:after{content:' '}pre{white-space:pre-wrap}.amp-ad-wrapper.amp_ad_1{padding-top:20px}
69
  .amp-wp-content-loop{width:100%}
@@ -96,6 +96,10 @@ blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background:
96
  .searchmenu button{ background:transparent; border:none }
97
  .closebutton{ background: transparent; border: 0; color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 30px; width: 32px; height: 32px; font-size: 12px; text-align: center; position: absolute; top: 12px; right: 20px; outline:none }
98
  amp-lightbox{ background: rgba(0, 0, 0,0.85); }
 
 
 
 
99
  <?php if( is_singular() || is_home() && $redux_builder_amp['amp-frontpage-select-option'] && ampforwp_get_blog_details() == false ) { ?>
100
  /* Tables */
101
  table { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; overflow-x: auto; }
@@ -132,6 +136,8 @@ table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, le
132
  .amp-wp-header .ampforwp-search-nav-wrapper{ padding: 0; }
133
  .ampforwp-search-nav-wrapper .searchmenu{ margin-top: 20px; }
134
  .headerlogo a, [class*=icono-]{ top:0; }
 
 
135
  .amp-wp-header a, .headerlogo a, [class*=icono-] {color: <?php echo sanitize_hex_color( $header_color ); ?>;text-decoration: none;}
136
  @media screen and (min-width: 650px) { table {display: inline-table;} }
137
  <?php if($redux_builder_amp['enable-single-social-icons'] && is_socialshare_or_socialsticky_enabled_in_ampforwp() ){ ?> .amp-wp-footer{padding-bottom: 60px;}<?php } ?>
58
  .amp-wp-title {color: <?php echo sanitize_hex_color( $text_color ); ?>;display: block;flex: 1 0 100%;font-weight: 900;margin: 0;width: 100%;}.amp-wp-meta {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;display: inline-block;flex: 2 1 50%;font-size: .875em;line-height: 1.7em;margin: 0;padding: 0;}.ampforwp-meta-info{margin-top: 0px;}.amp-wp-article-header .amp-wp-meta:last-of-type {text-align: right;}.amp-wp-article-header .amp-wp-meta:first-of-type {text-align: left;}.amp-wp-byline amp-img,.amp-wp-byline .amp-wp-author {display: inline-block;vertical-align: middle;}.amp-wp-byline amp-img {border: 1px solid <?php echo sanitize_hex_color( $link_color ); ?>;border-radius: 50%;position: relative;margin-right: 6px;}.amp-wp-posted-on {text-align: right;}.hide-meta-info{ display: none; }
59
  .amp-wp-article-featured-image {margin: 1.5em 16px 1.5em;}.amp-wp-article-featured-image amp-img {margin: 0 auto;}.amp-wp-article-featured-image.wp-caption .wp-caption-text, .ampforwp-gallery-item .wp-caption-text {margin: 0 18px;}.amp-wp-frontpage .the_content {padding: 10px;}
60
  .ampforwp-gallery-item.amp-carousel-slide { padding-bottom: 20px;}
61
+ .amp-wp-frontpage .ampforwp-title {margin-left:10px;}.amp-wp-article a{text-decoration:none}.amp-wp-article-content {margin: 0 16px;}.amp-wp-article-content ul,.amp-wp-article-content ol {margin-left: 1em;}.amp-wp-article-content amp-img {margin: 0 auto;}.amp-wp-article-content amp-img.alignright {margin: 0 0 1em 16px;}.amp-wp-article-content amp-img.alignleft {margin: 0 16px 1em 0;} .amp-disqus-comments {padding: 15px;}.amp-disqus-comments amp-iframe{background: none;}.wp-caption {padding: 0;}.wp-caption.alignleft {margin-right: 16px;}.wp-caption.alignright { margin-left: 16px;}.wp-caption-text {border-bottom: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;margin: 0;padding: .66em 10px .75em;text-align: center;} amp-carousel {background: <?php echo sanitize_hex_color( $border_color ); ?>;margin: 0 -16px 1.5em;} amp-iframe,amp-youtube,amp-instagram,amp-vine {background: <?php echo sanitize_hex_color( $border_color ); ?>;margin: 0 -16px 1.5em; } .amp-wp-article-content amp-carousel amp-img {border: none;} amp-carousel > amp-img > img {object-fit: contain; } .amp-wp-iframe-placeholder { background: <?php echo sanitize_hex_color( $border_color ); ?> url( <?php echo esc_url( $get_customizer->get( 'placeholder_image_url' ) ); ?> ) no-repeat center 40%;background-size: 48px 48px;min-height: 48px;} .amp-wp-article-footer .amp-wp-meta {display: block;} .amp-wp-tags{ list-style-type: none; padding: 0; margin: 0 0 9px 0; display: inline-flex; } .amp-wp-tags li{display:inline; padding-left: 5px; } .amp-wp-tax-category span{margin-right:5px;} .amp-wp-tax-category, .amp-wp-tax-tag { color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;margin: 1.5em 16px;}.ampforwp-comment-button {margin-bottom:20px;} .amp-wp-comments-link {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;text-align: center;margin: 2.25em 0 1.5em;} .amp-wp-comments-link a { border-style: solid;border-color: <?php echo sanitize_hex_color( $border_color ); ?>;border-width: 1px 1px 2px;border-radius: 4px;background-color: transparent;color: <?php echo sanitize_hex_color( $link_color ); ?>;cursor: pointer; display: block;font-size: 14px;font-weight: 600;line-height: 18px;margin: 0 auto;max-width: 200px;padding: 11px 16px;text-decoration: none;width: 50%;-webkit-transition: background-color 0.2s ease;transition: background-color 0.2s ease;} .page-title {margin: 0 15px; font-size: 1.17em; }.amp-sub-archives li{width: 50%;} .amp-sub-archives ul{padding: 0;list-style: none;display: flex;font-size: 12px;line-height: 1.2;margin: 5px 1.5em 10px 1.5em;} .author-archive amp-img{border-radius: 50%;margin: 0px 8px 10px;display: block;}.author-archive{float: left;} .amp-wp-footer {border-top: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;margin: calc(1.5em - 1px) 0 0;padding-bottom:25px;}
62
  .amp-wp-footer div{margin:0 auto;max-width:calc(840px - 32px);padding:1.25em 16px;position:relative}.amp-wp-footer h2{font-size:1em;line-height:1.375em;margin:0 0 .5em}
63
  .amp-wp-footer p {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .8em;line-height: 1.5em;margin: 0 15px 0 0;}
64
  .amp-wp-footer a{text-decoration:none}.copyright_txt{float:left}.back-to-top{float:right}.amp-wp-header .nav_container{float: right;top: 16px;line-height: 1; right: 65px; position: absolute}.toggle-text{position:absolute;right:0;height:22px;width:28px}.toggle-text span{display:block;position:absolute;height:2px;width:25px;background:#fff;border-radius:19px;opacity:1;left:0}.toggle-text span:nth-child(2){top:9px}.toggle-text span:nth-child(3){top:18px}.amp-wp-home .amp-wp-meta{margin:5px 0}.amp-wp-home .amp-wp-content p{display:inline-block;width:100%}.ampforwp-custom-index .amp-wp-title a {text-decoration: none;color: <?php echo sanitize_hex_color( $text_color ); ?>;}.comment-button-wrapper a,.related_posts ol{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.amp-wp-meta{display:flex}.amp-wp-posted-on{display:initial}#pagination .next,#pagination .prev{display:inline-block}.ampforwp-custom-index .amp-wp-content{margin-bottom:30px}.pagination-holder{margin:1.5em 16px}#pagination .next{float:right}.amp-wp-home .amp-wp-content p{display:inline}.home-post-image{float:right;margin:0 0 10px 20px}.amp-wp-article-content amp-img{max-width:100%}.amp-wp-meta.amp-wp-tax-category,.amp-wp-meta.amp-wp-tax-tag{margin:0}.amp-wp-meta.amp-wp-tax-tag{display:initial}.ampforwp-social-icons{margin:1.5em 16px}.custom-amp-socialsharing-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; }
65
  .custom-amp-socialsharing-icon amp-img{ top: 4px; }
66
+ .custom-amp-socialsharing-line{background:#00b900}.custom-amp-socialsharing-vk{background:#45668e}.custom-amp-social-sharing-odnoklassniki{background:#ed812b}.comment-button-wrapper a{border-style:solid;border-color:#c2c2c2;border-width:1px 1px 2px;border-radius:4px;background-color:transparent;color:#0a89c0;cursor:pointer;display:block;font-size:14px;font-weight:600;text-align:center;line-height:18px;margin:0 auto;max-width:200px;padding:11px 16px;text-decoration:none;width:50%;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.close-nav,.comments_list div,.related_posts ol li,.toggle-navigation ul,.toggle-navigationv2 ul li a{display:inline-block}main .amp-wp-content.comments_list{background:0 0;box-shadow:none;max-width:1030px}.comments_list h3{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}.comments_list{margin:2.5em 16px}.comments_list ul{margin:0;padding:0}.comments_list ul.children{padding-bottom:10px;margin-left:4%;width:96%}
67
  .comments_list ul li p{margin:0;font-size:14px;clear:both;padding-top:5px; word-break:break-word;}
68
  .comments_list ul li{font-family:sans-serif;font-size:11px;list-style-type:none;margin-bottom:12px;background:#fefefe;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:0 2px 3px rgba(0,0,0,.05);-webkit-box-shadow:0 2px 3px rgba(0,0,0,.05);box-shadow:0 2px 3px rgba(0,0,0,.05);padding:0;max-width:1000px;width:96%}.comments_list ul li .says{margin-right:4px}.comments_list li li,.comments_list li li li{margin:20px 20px 10px}.comments_list ul li p{font-family:Merriweather,'Times New Roman',Times,Serif}.comments_list ul li .comment-body{padding:10px 0 15px}.comment-author{float:left}.single-post footer.comment-meta{padding-bottom:0; line-height: 1.9;}.comments_list li li{background:#f7f7f7;box-shadow:none;border:1px solid #eee} .page-numbers{ padding: 9px 10px; background: #fff; font-size: 14px; } .comment-author-img{float: left; margin-right: 5px; border-radius: 60px;} .comment-content amp-img{max-width: 300px;} amp-sidebar{width:250px}.amp-sidebar-image{line-height:100px;vertical-align:middle}.amp-close-image{top:15px;left:225px;cursor:pointer}.toggle-navigationv2 ul{list-style-type:none;margin:0;font-family:sans-serif;padding:0}.toggle-navigationv2 ul ul li a{padding-left:35px;background:#fff;display:inline-block}.toggle-navigationv2 ul li a{padding:10px 15px 10px 25px;width:88%;text-decoration:none;background:#fafafa;font-size:13px;border-bottom:1px solid #efefef}.close-nav{font-size:12px;font-family:sans-serif;background:rgba(0,0,0,.25);letter-spacing:1px;padding:10px;border-radius:100px;line-height:8px;margin:14px;left:191px;color:#fff}.close-nav:hover{background:rgba(0,0,0,.45)}.toggle-navigation ul{list-style-type:none;margin:0;padding:0;width:100%}.menu-all-pages-container:after{content:"";clear:both}.toggle-navigation ul li{font-size:13px;border-bottom:1px solid rgba(0,0,0,.11);padding:11px 0;width:25%;float:left;text-align:center;margin-top:6px}.toggle-navigation ul ul{display:none}.toggle-navigation ul li a{color:#eee;padding:15px}.toggle-navigation{display:none;background:#444}.nav_container:hover+.toggle-navigation,.toggle-navigation:active,.toggle-navigation:focus,.toggle-navigation:hover{display:inline-block;width:100%}#amp-user-notification1 p{display:inline-block}amp-user-notification{padding:5px;text-align:center;background:#fff;border-top:1px solid} amp-user-notification button {padding: 8px 10px;background: <?php echo sanitize_hex_color( $header_background_color ); ?>;color: <?php echo sanitize_hex_color( $header_color ); ?>;margin-left: 5px;border: 0;}amp-user-notification button:hover {cursor: pointer} .amp-ad-wrapper {text-align: center} <?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_single() ) { ?>body {padding-bottom: 43px;}<?php } ?> .sticky_social a{text-decoration:none}.sticky_social{width:100%;bottom:0;display:block;left:0;box-shadow:0 4px 7px #000;background:#fff;padding:7px 0 0;position:fixed;margin:0;z-index:10;text-align:center}.whatsapp-share-icon{width:50px;height:28px;display:inline-block;background:#5cbe4a;padding:4px 0;position:relative;top:-4px}.amp-wp-tax-category span:first-child:after{content:' '}.amp-wp-tax-category span:after,.amp-wp-tax-tag span:after{content:', '}.amp-wp-tax-category span:last-child:after,.amp-wp-tax-tag span:last-child:after{content:' '}pre{white-space:pre-wrap}.amp-ad-wrapper.amp_ad_1{padding-top:20px}
69
  .amp-wp-content-loop{width:100%}
96
  .searchmenu button{ background:transparent; border:none }
97
  .closebutton{ background: transparent; border: 0; color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 30px; width: 32px; height: 32px; font-size: 12px; text-align: center; position: absolute; top: 12px; right: 20px; outline:none }
98
  amp-lightbox{ background: rgba(0, 0, 0,0.85); }
99
+ <?php if( $redux_builder_amp['ampforwp-single-select-type-of-related'] ){ ?>
100
+ .related_posts span{display: block;}.related_posts ol{list-style-type:none;margin:0;padding:0}.related_posts ol li{width:100%;margin-bottom:12px;padding:0}.related_posts .related_link a{color:#000;font-size:18px}.related_posts ol li amp-img{width:100px;float:left;margin-right:15px}.related_posts ol li p{font-size:12px;color:#999;line-height:1.2;margin:12px 0 0}.no_related_thumbnail{padding:15px 18px} main .amp-wp-content.relatedpost{background:0 0;box-shadow:none;max-width:1030px}.relatedpost{margin:2em 16px}.related_posts span{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}
101
+ .related_posts ol li{display:inline-block}
102
+ <?php } ?>
103
  <?php if( is_singular() || is_home() && $redux_builder_amp['amp-frontpage-select-option'] && ampforwp_get_blog_details() == false ) { ?>
104
  /* Tables */
105
  table { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; overflow-x: auto; }
136
  .amp-wp-header .ampforwp-search-nav-wrapper{ padding: 0; }
137
  .ampforwp-search-nav-wrapper .searchmenu{ margin-top: 20px; }
138
  .headerlogo a, [class*=icono-]{ top:0; }
139
+ .amp-logo h1{font-size: 1em; font-weight: 400; line-height: 1.75em; margin: 0;}
140
+ .amp-logo amp-img{max-width: 190px;width:<?php echo ampforwp_default_logo('width');?>px ;}
141
  .amp-wp-header a, .headerlogo a, [class*=icono-] {color: <?php echo sanitize_hex_color( $header_color ); ?>;text-decoration: none;}
142
  @media screen and (min-width: 650px) { table {display: inline-table;} }
143
  <?php if($redux_builder_amp['enable-single-social-icons'] && is_socialshare_or_socialsticky_enabled_in_ampforwp() ){ ?> .amp-wp-footer{padding-bottom: 60px;}<?php } ?>
templates/design-manager/design-2/archive.php CHANGED
@@ -45,7 +45,18 @@
45
 
46
  <?php if ( is_archive() ) { ?>
47
  <div class="amp-wp-content amp-archive-heading">
48
- <?php
 
 
 
 
 
 
 
 
 
 
 
49
  the_archive_title( '<h1 class="page-title">', '</h1>' );
50
  $arch_desc = $sanitizer->get_amp_content();
51
  if( $arch_desc ) {
45
 
46
  <?php if ( is_archive() ) { ?>
47
  <div class="amp-wp-content amp-archive-heading">
48
+ <?php
49
+ if( is_author() ){
50
+ $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
51
+ if( true == ampforwp_comment_gravatar_checker($curauth->user_email) ){
52
+ $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
53
+ if($curauth_url){ ?>
54
+ <div class="author-archive">
55
+ <amp-img src="<?php echo esc_url($curauth_url); ?>" width="90" height="90" layout="fixed"></amp-img>
56
+ </div>
57
+ <?php }
58
+ }
59
+ }
60
  the_archive_title( '<h1 class="page-title">', '</h1>' );
61
  $arch_desc = $sanitizer->get_amp_content();
62
  if( $arch_desc ) {
templates/design-manager/design-2/elements/featured-image.php CHANGED
@@ -10,9 +10,11 @@ if( $featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_c
10
  $caption = $featured_image['caption'];
11
  }
12
  if ( ampforwp_is_custom_field_featured_image() ) {
13
- $amp_img_src = ampforwp_cf_featured_image_src();
 
 
14
  if( $amp_img_src ){
15
- $amp_html = "<amp-img src='$amp_img_src' width=300 height=250 layout=responsive ></amp-img>";
16
  }
17
  }
18
  if( true == $redux_builder_amp['ampforwp-featured-image-from-content'] && ampforwp_get_featured_image_from_content() ){
10
  $caption = $featured_image['caption'];
11
  }
12
  if ( ampforwp_is_custom_field_featured_image() ) {
13
+ $amp_img_src = ampforwp_cf_featured_image_src();
14
+ $amp_img_width = ampforwp_cf_featured_image_src('width');
15
+ $amp_img_height = ampforwp_cf_featured_image_src('height');
16
  if( $amp_img_src ){
17
+ $amp_html = "<amp-img src='$amp_img_src' width=$amp_img_width height=$amp_img_height layout=responsive ></amp-img>";
18
  }
19
  }
20
  if( true == $redux_builder_amp['ampforwp-featured-image-from-content'] && ampforwp_get_featured_image_from_content() ){
templates/design-manager/design-2/elements/related-posts.php CHANGED
@@ -58,44 +58,41 @@
58
  );
59
  }
60
  }//end of block for tags
61
- $my_query = new wp_query( $args );
 
62
  if( $my_query->have_posts() ) { ?>
63
  <div class="amp-wp-content relatedpost">
64
  <div class="related_posts">
65
- <ol class="clearfix">
66
- <span class="related-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></span>
67
- <?php
68
- while( $my_query->have_posts() ) {
69
- $my_query->the_post();
70
- $related_post_permalink = ampforwp_url_controller( get_permalink() );?>
71
- <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
72
- <a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
73
- <?php if ( ampforwp_has_post_thumbnail() ) {
74
- $thumb_url = ampforwp_get_post_thumbnail();
75
- if($thumb_url){ ?>
76
- <amp-img src="<?php echo esc_url( $thumb_url ); ?>" width="150" height="150" layout="responsive"></amp-img>
77
- <?php }
78
- }?>
79
- </a>
80
  <div class="related_link">
81
  <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
82
  <?php if(has_excerpt()){
83
- $content = get_the_excerpt();
84
- }else{
85
- $content = get_the_content();
86
- }
87
- ?>
88
  <p><?php echo wp_trim_words( strip_shortcodes($content) , '15' ); ?></p>
89
  </div>
90
- </li>
91
- <?php
92
- }
93
-
94
- } ?>
95
- </ol>
96
  </div>
97
  </div> <?php
98
- wp_reset_postdata();
99
- //related posts code ends here
100
- ?>
101
  <?php do_action('ampforwp_below_related_post',$this);
58
  );
59
  }
60
  }//end of block for tags
61
+ if( $redux_builder_amp['ampforwp-single-select-type-of-related'] ) {
62
+ $my_query = new wp_query( $args );
63
  if( $my_query->have_posts() ) { ?>
64
  <div class="amp-wp-content relatedpost">
65
  <div class="related_posts">
66
+ <ol class="clearfix">
67
+ <span class="related-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></span>
68
+ <?php
69
+ while( $my_query->have_posts() ) {
70
+ $my_query->the_post();
71
+ $related_post_permalink = ampforwp_url_controller( get_permalink() );?>
72
+ <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
73
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
74
+ <?php if ( ampforwp_has_post_thumbnail() ) {
75
+ $thumb_url = ampforwp_get_post_thumbnail();
76
+ if($thumb_url){ ?>
77
+ <amp-img src="<?php echo esc_url( $thumb_url ); ?>" width="150" height="150" layout="responsive"></amp-img>
78
+ <?php }
79
+ }?>
80
+ </a>
81
  <div class="related_link">
82
  <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
83
  <?php if(has_excerpt()){
84
+ $content = get_the_excerpt();
85
+ }else{
86
+ $content = get_the_content();
87
+ } ?>
 
88
  <p><?php echo wp_trim_words( strip_shortcodes($content) , '15' ); ?></p>
89
  </div>
90
+ </li>
91
+ <?php } ?>
92
+ </ol>
 
 
 
93
  </div>
94
  </div> <?php
95
+ wp_reset_postdata();
96
+ }
97
+ } ?>
98
  <?php do_action('ampforwp_below_related_post',$this);
templates/design-manager/design-2/header-bar.php CHANGED
@@ -1,60 +1,12 @@
 
1
  <header class="container">
2
  <div id="headerwrap">
3
  <div id="header">
4
- <?php
5
- global $redux_builder_amp;
6
- $set_rel_to_noamp=false;
7
-
8
- if( $redux_builder_amp['amp-on-off-support-for-non-amp-home-page'] ) {
9
- if( $redux_builder_amp['amp-mobile-redirection'] ) {
10
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
11
- $set_rel_to_noamp = true;
12
- } else {
13
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') );
14
- }
15
- } else {
16
- if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
17
- $ampforwp_home_url = ampforwp_url_controller( get_bloginfo('url') ) ;
18
- } else {
19
- if( $redux_builder_amp['amp-mobile-redirection'] ) {
20
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
21
- $set_rel_to_noamp = true;
22
- } else {
23
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') );
24
- }
25
- }
26
- }?>
27
-
28
- <?php
29
- do_action('ampforwp_header_top_design2');
30
- if (! empty( $redux_builder_amp['opt-media']['url'] ) ) {
31
- $logo_id = attachment_url_to_postid($redux_builder_amp['opt-media'] ['url']);
32
- $logo_alt = get_post_meta( $logo_id, '_wp_attachment_image_alt', true) ;
33
- if($logo_alt){
34
- $alt = $logo_alt;
35
- }
36
- else {
37
- $alt = get_bloginfo('name');
38
- } ?>
39
- <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){echo ' rel="nofollow"'; } ?> >
40
-
41
- <?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
42
-
43
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="<?php echo $redux_builder_amp['opt-media-width']; ?>" height="<?php echo $redux_builder_amp['opt-media-height']; ?>" alt= "<?php echo $alt; ?>" class="amp-logo"></amp-img>
44
-
45
- <?php } else { ?>
46
-
47
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt= "<?php echo $alt; ?>" class="amp-logo"></amp-img>
48
-
49
- <?php } ?>
50
-
51
- </a>
52
- <?php } else { ?>
53
- <h3><a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){echo ' rel="nofollow"';} ?> ><?php bloginfo('name'); ?></a></h3>
54
- <?php } ?>
55
- <?php do_action('ampforwp_header_search'); ?>
56
- <?php do_action('ampforwp_call_button');
57
- do_action('ampforwp_header_bottom_design2'); ?>
58
  </div>
59
  </div>
60
  </header>
1
+ <?php global $redux_builder_amp; ?>
2
  <header class="container">
3
  <div id="headerwrap">
4
  <div id="header">
5
+ <?php do_action('ampforwp_header_top_design2'); ?>
6
+ <?php amp_logo(); ?>
7
+ <?php do_action('ampforwp_header_search'); ?>
8
+ <?php do_action('ampforwp_call_button');
9
+ do_action('ampforwp_header_bottom_design2'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  </div>
11
  </div>
12
  </header>
templates/design-manager/design-2/style.php CHANGED
@@ -41,7 +41,6 @@ amp-anim { max-width: 100%; }
41
  margin: 0 auto;
42
  <?php endif; ?>
43
  }
44
-
45
  /* Slide Navigation code */
46
  .nav_container{ padding: 18px 15px; background: #312C7E; color: #fff; text-align: center }
47
  amp-sidebar{ width: 250px; }
@@ -70,7 +69,10 @@ amp-sidebar{ width: 250px; }
70
  .amp-category-post{ width: 32%;display: inline-block; word-wrap: break-word;float: left;}
71
  .amp-category-post amp-img{ margin-bottom:5px; }
72
  .amp-category-block li:nth-child(3){ margin: 0 1%;}
73
- .searchmenu{ margin-right: 15px; margin-top: 11px; position: absolute; top: 0; right: 0; }
 
 
 
74
  .searchmenu button{ background:transparent; border:none }
75
  .closebutton{ background: transparent; border: 0; color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 30px; width: 32px; height: 32px; font-size: 12px; text-align: center; position: absolute; top: 12px; right: 20px; outline:none }
76
  amp-lightbox{ background: rgba(0, 0, 0,0.85); }
@@ -105,9 +107,12 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
105
  .custom-amp-social-sharing-odnoklassniki{background:#ed812b}
106
  <?php }?>
107
  /* Header */
108
- #header{ background: #fff; text-align: center; }
109
- #header h3{ text-align: center; font-size: 20px; font-weight: bold; line-height: 1; padding: 15px; margin: 0; }
110
- .amp-logo{ margin: 15px 0px 10px 0px; }
 
 
 
111
  main { padding: 30px 15% 10px 15%; }
112
  .amp-wp-content.widget-wrapper{padding: 0px 15%;}
113
  main .amp-wp-content{ margin-bottom: 12px; padding: 15px; }
@@ -126,11 +131,9 @@ h2.amp-wp-title , .amp-wp-post-content p{ margin: 0 0 0 5px; }
126
  }
127
  .amp-wp-post-content p{ font-size: 12px; color: #999; line-height: 20px; margin: 3px 0 0 5px; }
128
  main .amp-archive-heading{ background : none; box-shadow: none; padding: 5px; }
129
- .amp-sub-archives li{width: 50%;} .amp-sub-archives ul{padding: 0;list-style: none;display: flex;font-size: 12px;line-height: 1.2;margin: 5px 0 10px 0px;}
130
- .page-title{
131
- font-size: 1.17em;
132
- padding: 6px 0;
133
- }
134
  /* Footer */
135
  #footer{ background : #fff; font-size: 13px; text-align: center; letter-spacing: 0.2px; padding: 20px 0; }
136
  #footer p:first-child{ margin-bottom: 12px; }
@@ -177,7 +180,8 @@ main .amp-wp-content.featured-image-content{ padding: 0px; border: 0; margin-bot
177
  .amp-wp-article-header.amp-wp-article-category.ampforwp-meta-taxonomy{ margin: 10px auto; max-width: 1030px; } .ampforwp_single_excerpt { margin-bottom:15px; font-size: 15px; text-align:center}
178
  .single-post .amp_author_area amp-img{ margin: 0; float: left; margin-right: 12px; border-radius: 60px; }
179
  .single-post .amp_author_area .amp_author_area_wrapper{ display: inline-block; width: 100%; line-height: 1.4; margin-top: 2px; font-size: 13px; color:#333; font-family: sans-serif; }
180
- <?php if(is_single()){?>
 
181
  /* Related Posts */
182
  main .amp-wp-content.relatedpost{ background: none; box-shadow: none; max-width: 1030px; padding:0px 0 0 0; margin:1.8em auto 1.5em auto }
183
  .related_posts .related-title, .comments_list h3{ font-size: 14px; font-weight: bold; letter-spacing: 0.4px; margin: 15px 0 10px 0; color: #333; }
@@ -192,7 +196,7 @@ main .amp-wp-content.relatedpost{ background: none; box-shadow: none; max-width:
192
  .related_posts ol li p{ font-size: 12px; color: #999; line-height: 1.2; margin: 12px 0 0 0; }
193
  .no_related_thumbnail{ padding: 15px 18px; }
194
  .no_related_thumbnail .related_link{ margin: 16px 18px 20px 19px; }
195
- <?php }
196
  if(isset($redux_builder_amp['wordpress-comments-support']) && $redux_builder_amp['wordpress-comments-support'] ==1 ) { ?>
197
  /* Comments */
198
  .page-numbers{padding: 9px 10px;background: #fff;font-size: 14px}
@@ -299,7 +303,8 @@ amp-user-notification button { background-color: <?php echo sanitize_hex_color(
299
  .ampforwp-tax-category span:last-child:after, .ampforwp-tax-tag span:last-child:after { content: ' '; }
300
  .amp-wp-article-content img { max-width: 100%; }
301
  <?php if ($redux_builder_amp['ampforwp-callnow-button']) { ?>
302
- .callnow{ position: relative; top: -35px; right: 39px }
 
303
  .callnow a:before { content: ""; position: absolute; right: 23px; width: 4px; height: 8px; border-width: 6px 0 6px 3px; border-style: solid; border-color:<?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme-call']['color']; ?>; background: transparent; transform: rotate(-30deg); box-sizing: initial; border-top-left-radius: 3px 5px; border-bottom-left-radius: 3px 5px; }
304
  <?php } ?>
305
  <?php if ( class_exists('TablePress') ) { ?>
41
  margin: 0 auto;
42
  <?php endif; ?>
43
  }
 
44
  /* Slide Navigation code */
45
  .nav_container{ padding: 18px 15px; background: #312C7E; color: #fff; text-align: center }
46
  amp-sidebar{ width: 250px; }
69
  .amp-category-post{ width: 32%;display: inline-block; word-wrap: break-word;float: left;}
70
  .amp-category-post amp-img{ margin-bottom:5px; }
71
  .amp-category-block li:nth-child(3){ margin: 0 1%;}
72
+ .searchmenu{
73
+ right: 10px;
74
+ top: 31%;
75
+ position: absolute; }
76
  .searchmenu button{ background:transparent; border:none }
77
  .closebutton{ background: transparent; border: 0; color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 30px; width: 32px; height: 32px; font-size: 12px; text-align: center; position: absolute; top: 12px; right: 20px; outline:none }
78
  amp-lightbox{ background: rgba(0, 0, 0,0.85); }
107
  .custom-amp-social-sharing-odnoklassniki{background:#ed812b}
108
  <?php }?>
109
  /* Header */
110
+ header{line-height: 0;}
111
+ #header{ background: #fff; text-align: center;padding:17px 0px 17px 0px;display: inline-block;width: 100%;position:relative}
112
+ #header h1{ text-align: center; font-size: 20px; font-weight: bold; line-height: 1; padding: 4px 3px; margin: 0; }
113
+ .amp-logo{left: 0;right: 0;display:inline-block}
114
+ .amp-logo amp-img{ margin: 15px 0px 10px 0px; }
115
+ .amp-logo amp-img{max-width: 190px;margin: 0 auto;width:<?php echo ampforwp_default_logo('width');?>px ;}
116
  main { padding: 30px 15% 10px 15%; }
117
  .amp-wp-content.widget-wrapper{padding: 0px 15%;}
118
  main .amp-wp-content{ margin-bottom: 12px; padding: 15px; }
131
  }
132
  .amp-wp-post-content p{ font-size: 12px; color: #999; line-height: 20px; margin: 3px 0 0 5px; }
133
  main .amp-archive-heading{ background : none; box-shadow: none; padding: 5px; }
134
+ .amp-sub-archives li{width: 50%;} .amp-sub-archives ul{padding: 0;list-style: none;display: flex;font-size: 12px;line-height: 1.2;margin: 5px 0 10px 0px;}.page-title{font-size: 1.17em;padding: 6px 0;}
135
+ <?php if(is_author()){ ?> .author-archive amp-img{border-radius: 50%;margin: 0px 8px 10px;display: block;}.author-archive{float: left;} .amp-wp-content .taxonomy-description{background: #f1f1f1; padding:0px} .page-title{padding:0} <?php } ?>
136
+
 
 
137
  /* Footer */
138
  #footer{ background : #fff; font-size: 13px; text-align: center; letter-spacing: 0.2px; padding: 20px 0; }
139
  #footer p:first-child{ margin-bottom: 12px; }
180
  .amp-wp-article-header.amp-wp-article-category.ampforwp-meta-taxonomy{ margin: 10px auto; max-width: 1030px; } .ampforwp_single_excerpt { margin-bottom:15px; font-size: 15px; text-align:center}
181
  .single-post .amp_author_area amp-img{ margin: 0; float: left; margin-right: 12px; border-radius: 60px; }
182
  .single-post .amp_author_area .amp_author_area_wrapper{ display: inline-block; width: 100%; line-height: 1.4; margin-top: 2px; font-size: 13px; color:#333; font-family: sans-serif; }
183
+ <?php if(is_single()){
184
+ if( $redux_builder_amp['ampforwp-single-select-type-of-related'] ){ ?>
185
  /* Related Posts */
186
  main .amp-wp-content.relatedpost{ background: none; box-shadow: none; max-width: 1030px; padding:0px 0 0 0; margin:1.8em auto 1.5em auto }
187
  .related_posts .related-title, .comments_list h3{ font-size: 14px; font-weight: bold; letter-spacing: 0.4px; margin: 15px 0 10px 0; color: #333; }
196
  .related_posts ol li p{ font-size: 12px; color: #999; line-height: 1.2; margin: 12px 0 0 0; }
197
  .no_related_thumbnail{ padding: 15px 18px; }
198
  .no_related_thumbnail .related_link{ margin: 16px 18px 20px 19px; }
199
+ <?php } }
200
  if(isset($redux_builder_amp['wordpress-comments-support']) && $redux_builder_amp['wordpress-comments-support'] ==1 ) { ?>
201
  /* Comments */
202
  .page-numbers{padding: 9px 10px;background: #fff;font-size: 14px}
303
  .ampforwp-tax-category span:last-child:after, .ampforwp-tax-tag span:last-child:after { content: ' '; }
304
  .amp-wp-article-content img { max-width: 100%; }
305
  <?php if ($redux_builder_amp['ampforwp-callnow-button']) { ?>
306
+ .callnow{ left: 58px; top: 36%; position: absolute;
307
+ }
308
  .callnow a:before { content: ""; position: absolute; right: 23px; width: 4px; height: 8px; border-width: 6px 0 6px 3px; border-style: solid; border-color:<?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme-call']['color']; ?>; background: transparent; transform: rotate(-30deg); box-sizing: initial; border-top-left-radius: 3px 5px; border-bottom-left-radius: 3px 5px; }
309
  <?php } ?>
310
  <?php if ( class_exists('TablePress') ) { ?>
templates/design-manager/design-3/archive.php CHANGED
@@ -66,15 +66,28 @@ if ( get_query_var( 'paged' ) ) {
66
  'post_status'=> 'publish'
67
  ) ); ?>
68
 
69
- <?php if ( is_archive() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  the_archive_title( '<h1 class="amp-wp-content page-title">', '</h1>' );
71
-
72
  $arch_desc = $sanitizer->get_amp_content();
73
  if( $arch_desc ) {
74
  if($paged <= '1') {?>
75
- <div class="amp-wp-content taxonomy-description">
76
  <?php echo $arch_desc ; ?>
77
- </div> <?php
 
78
  }
79
  }
80
  if(is_category() && 1 == $redux_builder_amp['ampforwp-sub-categories-support']){
66
  'post_status'=> 'publish'
67
  ) ); ?>
68
 
69
+ <?php if ( is_archive() ) { ?>
70
+ <div class="amp-wp-content archive-heading">
71
+ <?php
72
+ if( is_author() ){
73
+ $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
74
+ if( true == ampforwp_comment_gravatar_checker($curauth->user_email) ){
75
+ $curauth_url = get_avatar_url( $curauth->user_email, array('size'=>180) );
76
+ if($curauth_url){ ?>
77
+ <div class="amp-wp-content author-img">
78
+ <amp-img src="<?php echo esc_url($curauth_url); ?>" width="90" height="90" layout="responsive"></amp-img>
79
+ </div>
80
+ <?php }
81
+ }
82
+ }
83
  the_archive_title( '<h1 class="amp-wp-content page-title">', '</h1>' );
 
84
  $arch_desc = $sanitizer->get_amp_content();
85
  if( $arch_desc ) {
86
  if($paged <= '1') {?>
87
+ <div class="taxonomy-description">
88
  <?php echo $arch_desc ; ?>
89
+ </div>
90
+ </div> <?php
91
  }
92
  }
93
  if(is_category() && 1 == $redux_builder_amp['ampforwp-sub-categories-support']){
templates/design-manager/design-3/elements/featured-image.php CHANGED
@@ -10,9 +10,11 @@ if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf
10
  $caption = $featured_image['caption'];
11
  }
12
  if ( ampforwp_is_custom_field_featured_image() ) {
13
- $amp_img_src = ampforwp_cf_featured_image_src();
14
- if( $amp_img_src ){
15
- $amp_html = "<amp-img src='$amp_img_src' width=300 height=250 layout=responsive ></amp-img>";
 
 
16
  }
17
  }
18
  if( true == $redux_builder_amp['ampforwp-featured-image-from-content'] && ampforwp_get_featured_image_from_content() ){
10
  $caption = $featured_image['caption'];
11
  }
12
  if ( ampforwp_is_custom_field_featured_image() ) {
13
+ $amp_img_src = ampforwp_cf_featured_image_src();
14
+ $amp_img_width = ampforwp_cf_featured_image_src('width');
15
+ $amp_img_height = ampforwp_cf_featured_image_src('height');
16
+ if( $amp_img_src ){
17
+ $amp_html = "<amp-img src='$amp_img_src' width=$amp_img_width height=$amp_img_height layout=responsive ></amp-img>";
18
  }
19
  }
20
  if( true == $redux_builder_amp['ampforwp-featured-image-from-content'] && ampforwp_get_featured_image_from_content() ){
templates/design-manager/design-3/elements/related-posts.php CHANGED
@@ -60,46 +60,43 @@
60
  );
61
  }
62
  }//end of block for tags
 
63
  $my_query = new wp_query( $args );
64
- if( $my_query->have_posts() ) { ?>
65
- <div class="amp-wp-content relatedpost">
66
- <div class="related_posts">
67
- <ol class="clearfix">
68
- <span class="related-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></span>
69
- <?php
70
- while( $my_query->have_posts() ) {
71
- $my_query->the_post();
72
- $related_post_permalink = "";
73
- $related_post_permalink = ampforwp_url_controller( get_permalink() );
74
- ?>
75
- <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
76
- <a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
77
- <?php if ( ampforwp_has_post_thumbnail() ) {
78
- $thumb_url = ampforwp_get_post_thumbnail();
79
- if($thumb_url){?>
80
- <amp-img src="<?php echo esc_url( $thumb_url ); ?>" width="150" height="150" layout="responsive"></amp-img>
81
- <?php }
82
- }?>
83
- </a>
84
- <div class="related_link">
85
- <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
86
- <?php if(has_excerpt()){
87
- $content = get_the_excerpt();
88
- }else{
89
- $content = get_the_content();
90
- }
91
- ?>
92
- <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
93
- </div>
94
- </li>
95
- <?php
96
- }
97
-
98
- } ?>
99
- </ol>
100
- </div>
101
- </div> <?php
102
  wp_reset_postdata();
103
- //related posts code ends here
104
- ?>
105
  <?php do_action('ampforwp_below_related_post_hook',$this);
60
  );
61
  }
62
  }//end of block for tags
63
+ if( $redux_builder_amp['ampforwp-single-select-type-of-related'] ){
64
  $my_query = new wp_query( $args );
65
+ if( $my_query->have_posts() ) { ?>
66
+ <div class="amp-wp-content relatedpost">
67
+ <div class="related_posts">
68
+ <ol class="clearfix">
69
+ <span class="related-title"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' ); ?></span>
70
+ <?php
71
+ while( $my_query->have_posts() ) {
72
+ $my_query->the_post();
73
+ $related_post_permalink = "";
74
+ $related_post_permalink = ampforwp_url_controller( get_permalink() );?>
75
+ <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
76
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
77
+ <?php if ( ampforwp_has_post_thumbnail() ) {
78
+ $thumb_url = ampforwp_get_post_thumbnail();
79
+ if($thumb_url){?>
80
+ <amp-img src="<?php echo esc_url( $thumb_url ); ?>" width="150" height="150" layout="responsive"></amp-img>
81
+ <?php }
82
+ }?>
83
+ </a>
84
+ <div class="related_link">
85
+ <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
86
+ <?php if(has_excerpt()){
87
+ $content = get_the_excerpt();
88
+ }else{
89
+ $content = get_the_content();
90
+ }
91
+ ?>
92
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
93
+ </div>
94
+ </li>
95
+ <?php } ?>
96
+ </ol>
97
+ </div>
98
+ </div> <?php
 
 
 
 
99
  wp_reset_postdata();
100
+ }
101
+ } ?>
102
  <?php do_action('ampforwp_below_related_post_hook',$this);
templates/design-manager/design-3/header-bar.php CHANGED
@@ -104,61 +104,8 @@ if(isset($redux_builder_amp['ampforwp-amp-menu']) && $redux_builder_amp['ampforw
104
  </div>
105
  <?php } ?>
106
  <div class="headerlogo">
107
- <?php global $redux_builder_amp;
108
- do_action('ampforwp_header_top_design3');
109
- $set_rel_to_noamp=false;
110
-
111
- if( $redux_builder_amp['amp-on-off-support-for-non-amp-home-page'] ) {
112
- if( $redux_builder_amp['amp-mobile-redirection'] ) {
113
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
114
- $set_rel_to_noamp = true;
115
- } else {
116
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') );
117
- }
118
- } else {
119
- if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
120
- $ampforwp_home_url = user_trailingslashit( trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR );
121
- $get_permalink_structure = get_option('permalink_structure');
122
- if ( empty( $get_permalink_structure ) ) {
123
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?amp=1';
124
- }
125
- } else {
126
- if( $redux_builder_amp['amp-mobile-redirection'] ) {
127
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
128
- $set_rel_to_noamp = true;
129
- } else {
130
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') );
131
- }
132
- }
133
-
134
- }
135
- ?>
136
-
137
- <?php if ( isset($redux_builder_amp['opt-media']['url'] ) && true == ($redux_builder_amp['opt-media']['url']) ) {
138
- $logo_id = attachment_url_to_postid($redux_builder_amp['opt-media'] ['url']);
139
- $logo_alt = get_post_meta( $logo_id, '_wp_attachment_image_alt', true) ;
140
- if($logo_alt){
141
- $alt = $logo_alt;
142
- }
143
- else {
144
- $alt = get_bloginfo('name');
145
- } ?>
146
- <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
147
-
148
- <?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
149
-
150
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="<?php echo $redux_builder_amp['opt-media-width']; ?>" height="<?php echo $redux_builder_amp['opt-media-height']; ?>" alt="<?php echo $alt; ?>" class="amp-logo"></amp-img>
151
-
152
- <?php } else { ?>
153
-
154
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt="<?php echo $alt ?>" class="amp-logo"></amp-img>
155
-
156
- <?php } ?>
157
-
158
- </a>
159
- <?php } else { ?>
160
- <h1><a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> ><?php bloginfo('name'); ?></a></h1>
161
- <?php } ?>
162
  </div>
163
  <?php do_action('ampforwp_call_button'); ?>
164
  <?php do_action('ampforwp_header_search');
104
  </div>
105
  <?php } ?>
106
  <div class="headerlogo">
107
+ <?php do_action('ampforwp_header_top_design3'); ?>
108
+ <?php amp_logo(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  </div>
110
  <?php do_action('ampforwp_call_button'); ?>
111
  <?php do_action('ampforwp_header_search');
templates/design-manager/design-3/index.php CHANGED
@@ -112,7 +112,9 @@ if ( get_query_var( 'paged' ) ) {
112
 
113
  <div class="amp-wp-content amp-loop-list <?php if ( ! ampforwp_has_post_thumbnail() ){?>amp-loop-list-noimg<?php } ?>">
114
  <?php if ( ampforwp_has_post_thumbnail() ) {
115
- $thumb_url = ampforwp_get_post_thumbnail();
 
 
116
  if($thumb_url){
117
  ?>
118
  <div class="home-post_image">
@@ -121,8 +123,8 @@ if ( get_query_var( 'paged' ) ) {
121
  layout="responsive"
122
  src=<?php echo esc_url( $thumb_url ); ?>
123
  <?php ampforwp_thumbnail_alt(); ?>
124
- width=450
125
- height=270
126
  ></amp-img>
127
  </a>
128
  </div>
112
 
113
  <div class="amp-wp-content amp-loop-list <?php if ( ! ampforwp_has_post_thumbnail() ){?>amp-loop-list-noimg<?php } ?>">
114
  <?php if ( ampforwp_has_post_thumbnail() ) {
115
+ $thumb_url = ampforwp_get_post_thumbnail('url');
116
+ $thumb_width = ampforwp_get_post_thumbnail('width');
117
+ $thumb_height = ampforwp_get_post_thumbnail('height');
118
  if($thumb_url){
119
  ?>
120
  <div class="home-post_image">
123
  layout="responsive"
124
  src=<?php echo esc_url( $thumb_url ); ?>
125
  <?php ampforwp_thumbnail_alt(); ?>
126
+ width=<?php echo $thumb_width; ?>
127
+ height=<?php echo $thumb_height; ?>
128
  ></amp-img>
129
  </a>
130
  </div>
templates/design-manager/design-3/style.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
  add_action('amp_post_template_css', 'ampforwp_additional_style_input_3');
3
  function ampforwp_additional_style_input_3( $amp_template ) {
4
- global $redux_builder_amp;
5
  global $post;
6
  $post_id = '';
7
  $post_id = $post->ID;
8
- $get_customizer = new AMP_Post_Template( $post_id );
9
- // Get content width
10
  $colorscheme = $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color'];
11
  $headercolor = $redux_builder_amp['amp-opt-color-rgba-headercolor']['color'];
12
  $font_color = $redux_builder_amp['amp-opt-color-rgba-font']['color'];
@@ -14,11 +14,11 @@ function ampforwp_additional_style_input_3( $amp_template ) {
14
  $headerelements = $redux_builder_amp['amp-opt-color-rgba-headerelements']['color'];
15
  $sticky_head = $redux_builder_amp['amp-opt-sticky-head'];
16
 
17
- $content_max_width = absint( $get_customizer->get( 'content_max_width' ) );
18
- // Get template colors
19
- $header_background_color = $get_customizer->get_customizer_setting( 'header_background_color' );
20
- $header_color = $get_customizer->get_customizer_setting( 'header_color' );
21
- ?>
22
 
23
  /* Global Styling */
24
  body{ font: 16px/1.4 Sans-serif; }
@@ -106,11 +106,11 @@ header{ padding-bottom:50px; }
106
  header{ padding-bottom:0px; }
107
  #headerwrap{ position: relative;}
108
  <?php } ?>
109
- #header h1{ text-align: center; font-size: 16px; position: relative; font-weight: bold; line-height: 53px; padding: 0; margin: 0; text-transform: uppercase }
110
  main .amp-wp-content{ font-size: 18px; line-height: 29px; color:#111 }
111
  .single-post main .amp-wp-article-content h1{ font-size:2em}
112
  .single-post main .amp-wp-article-content h1, .single-post main .amp-wp-article-content h2, .single-post main .amp-wp-article-content h3, .single-post main .amp-wp-article-content h4, .single-post main .amp-wp-article-content h5, .single-post main .amp-wp-article-content h6{ font-family: 'Roboto Slab', serif; margin: 0px 0px 5px 0px; line-height: 1.6; }
113
- .home-post_image{ float: left; width:33%; padding-right: 2%; }
114
  .amp-wp-title{ margin-top: 0px; }
115
  h2.amp-wp-title{ font-family: 'Roboto Slab', serif; font-weight: 700; font-size: 20px; margin-bottom: 7px; line-height: 1.3; }
116
  h2.amp-wp-title a{ color: #000; }
@@ -177,7 +177,8 @@ figcaption{ font-size: 11px; line-height: 1.6; margin-bottom: 11px; background:
177
  main .amp-wp-content.featured-image-content{ padding: 0px; border: 0; margin-bottom: 0; box-shadow: none }
178
  .amp-wp-content .amp-wp-article-featured-image amp-img {margin: 0 auto;}
179
  .single-post .amp-wp-article-content amp-img{ max-width:100% }
180
- <?php if(is_single()){?>
 
181
  /* Related Posts */
182
  main .amp-wp-content.relatedpost{ background: none; box-shadow: none; padding:0px 0 0 0; margin:1.8em auto 1.5em auto }
183
  .single-post main,.related-title,.single-post .comments_list h3{ font-size: 20px; color: #777; font-family:'Roboto Slab', serif; border-bottom: 1px solid #eee; font-weight: 400; padding-bottom: 1px; margin-bottom: 10px; }
@@ -190,6 +191,7 @@ main .amp-wp-content.relatedpost{ background: none; box-shadow: none; padding:0p
190
  .no_related_thumbnail{ padding: 15px 18px; }
191
  .no_related_thumbnail .related_link{ margin: 16px 18px 20px 19px; }
192
  <?php }
 
193
  if( $redux_builder_amp['wordpress-comments-support'] ==1) { ?>
194
  /* Comments */
195
  .page-numbers{ padding: 9px 10px; background: #fff; font-size: 14px; }
@@ -248,8 +250,8 @@ pre{ white-space: pre-wrap; }
248
  .amp-category-block li:nth-child(3){ margin: 0 1%; }
249
  .searchmenu{ margin-right: 15px; margin-top: 11px; position: absolute; top: 0; right: 0; }
250
  .searchmenu button{ background:transparent; border:none }
 
251
  .headerlogo{ margin: 0 auto; width: 80%; text-align: center; }
252
- .headerlogo amp-img{ margin-top:6px }
253
  .headerlogo a{ color:#F42; }
254
 
255
  /*Navigation Menu*/
@@ -281,9 +283,8 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
281
  #searchsubmit{opacity:0}
282
  .featured_time{ font-size: 12px; color: #fff; opacity: 0.8; padding-left: 20px; }
283
  .archives_body main{ margin-top:30px }
284
- .archives_body .page-title, .taxonomy-description, .amp-sub-archives{padding: 0 15px}
285
  .taxonomy-description p{margin-top: 5px;font-size: 14px;line-height: 1.5;}
286
- .amp-sub-archives li{width: 50%;} .amp-sub-archives ul{padding: 0;list-style: none;display: flex;font-size: 12px;line-height: 1.2;margin: 5px 0 10px 0px;}
287
  <?php if(is_home() && $redux_builder_amp['amp-frontpage-select-option']==0){?>
288
  /* AMP carousel */
289
  .amp-carousel-button-prev, .amp-carousel-button-next{ top:30px;border-radius:60px; }
@@ -326,12 +327,12 @@ amp-user-notification button:hover{ cursor: pointer }
326
  /* Responsive */
327
  @media screen and (min-width: 650px) { table {display: inline-table;} }
328
 
329
- @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;} }
330
  @media screen and (max-width: 600px){ .amp-loop-list .amp-wp-tags{display:none} }
331
  @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} }
332
- @media screen and (max-width: 425px){ .home-post_image{ /* width: 125px;*/ width: 31.6%; overflow: hidden; height: 100px; /* margin-right: 13px; */ margin-right: 3%; } .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%; } .amp-loop-list .amp-wp-post-content .large-screen-excerpt-design-3, .related_posts .related_link p{ display:none } .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 } }
333
  @media screen and (max-width: 400px){ .amp-wp-title{ font-size: 19px; } }
334
- @media screen and (max-width: 375px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 24px;} .home-post_image{ height: 79px; } .amp-carousel-slide h1{ font-size: 28px; 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 a{ font-size: 15px; line-height: 1.6; } }
335
  @media screen and (max-width: 340px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 22px;} .amp-loop-list{ padding: 20px 15px 18px 15px; } h2.amp-wp-title{ line-height: 1.31578947; font-size: 17px; } .related_posts .related_link a{ font-size: 15px; } .the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; } }
336
  @media screen and (max-width: 320px){ .related_posts .related_link a{ font-size: 13px; } .ampforwp-social-icons amp-social-share{ margin-right: 1px; } }
337
  .entry-content amp-anim{display:table-cell;}
@@ -339,7 +340,7 @@ amp-user-notification button:hover{ cursor: pointer }
339
  .amp-carousel-slide h1{ direction: rtl; }
340
  .featured_time{ text-align: right; padding-right: 20px; }
341
  main .amp-wp-content{ direction: rtl; }
342
- .home-post_image{ float: right; padding-right: 0%; padding-left: 2%; margin-right: 0%; }
343
  .searchmenu{ margin-right: 15px; margin-top: 11px; position: absolute; top: 0; right: inherit; }
344
  .searchform label{ text-align: right; right: -30px; position: relative; }
345
  .searchform input{ text-align: right; padding: 15px; }
@@ -373,11 +374,11 @@ amp-user-notification button { background-color: <?php echo $redux_builder_amp[
373
  .amp-wp-article-content img { max-width: 100%;}
374
  @font-face {
375
  font-family: 'icomoon';
376
- src: url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.eot?b9qrme');
377
- src: url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.eot?b9qrme#iefix') format('embedded-opentype'),
378
- url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.ttf?b9qrme') format('truetype'),
379
- url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.woff?b9qrme') format('woff'),
380
- url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.svg?b9qrme#icomoon') format('svg');
381
  font-weight: normal;
382
  font-style: normal;
383
  }
@@ -419,7 +420,7 @@ amp-user-notification button { background-color: <?php echo $redux_builder_amp[
419
  <?php
420
  if ( class_exists('TablePress') ) { ?>
421
  .tablepress-table-description{ clear: both; display: block; }
422
- .tablepress{ border-collapse: collapse; border-spacing: 0; width: 100%; margin-bottom: 1em; border: none; }
423
  .tablepress th, .tablepress td{ padding: 8px; border: none; background: none; text-align: left; }
424
  .tablepress tbody td{ vertical-align: top; }
425
  .tablepress tbody td, .tablepress tfoot th{ border-top: 1px solid #dddddd; }
1
  <?php
2
  add_action('amp_post_template_css', 'ampforwp_additional_style_input_3');
3
  function ampforwp_additional_style_input_3( $amp_template ) {
4
+ global $redux_builder_amp;
5
  global $post;
6
  $post_id = '';
7
  $post_id = $post->ID;
8
+ $get_customizer = new AMP_Post_Template( $post_id );
9
+ // Get content width
10
  $colorscheme = $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color'];
11
  $headercolor = $redux_builder_amp['amp-opt-color-rgba-headercolor']['color'];
12
  $font_color = $redux_builder_amp['amp-opt-color-rgba-font']['color'];
14
  $headerelements = $redux_builder_amp['amp-opt-color-rgba-headerelements']['color'];
15
  $sticky_head = $redux_builder_amp['amp-opt-sticky-head'];
16
 
17
+ $content_max_width = absint( $get_customizer->get( 'content_max_width' ) );
18
+ // Get template colors
19
+ $header_background_color = $get_customizer->get_customizer_setting( 'header_background_color' );
20
+ $header_color = $get_customizer->get_customizer_setting( 'header_color' );
21
+ ?>
22
 
23
  /* Global Styling */
24
  body{ font: 16px/1.4 Sans-serif; }
106
  header{ padding-bottom:0px; }
107
  #headerwrap{ position: relative;}
108
  <?php } ?>
109
+ #header h1{ text-align: center; font-size: 16px; position: relative; font-weight: bold; line-height: 50px; padding: 0; margin: 0; text-transform: uppercase }
110
  main .amp-wp-content{ font-size: 18px; line-height: 29px; color:#111 }
111
  .single-post main .amp-wp-article-content h1{ font-size:2em}
112
  .single-post main .amp-wp-article-content h1, .single-post main .amp-wp-article-content h2, .single-post main .amp-wp-article-content h3, .single-post main .amp-wp-article-content h4, .single-post main .amp-wp-article-content h5, .single-post main .amp-wp-article-content h6{ font-family: 'Roboto Slab', serif; margin: 0px 0px 5px 0px; line-height: 1.6; }
113
+ .home-post_image{ float: left; width:33%; padding-right: 2%; overflow:hidden; max-height: 225px }
114
  .amp-wp-title{ margin-top: 0px; }
115
  h2.amp-wp-title{ font-family: 'Roboto Slab', serif; font-weight: 700; font-size: 20px; margin-bottom: 7px; line-height: 1.3; }
116
  h2.amp-wp-title a{ color: #000; }
177
  main .amp-wp-content.featured-image-content{ padding: 0px; border: 0; margin-bottom: 0; box-shadow: none }
178
  .amp-wp-content .amp-wp-article-featured-image amp-img {margin: 0 auto;}
179
  .single-post .amp-wp-article-content amp-img{ max-width:100% }
180
+ <?php if(is_single()){
181
+ if( $redux_builder_amp['ampforwp-single-select-type-of-related'] ){ ?>
182
  /* Related Posts */
183
  main .amp-wp-content.relatedpost{ background: none; box-shadow: none; padding:0px 0 0 0; margin:1.8em auto 1.5em auto }
184
  .single-post main,.related-title,.single-post .comments_list h3{ font-size: 20px; color: #777; font-family:'Roboto Slab', serif; border-bottom: 1px solid #eee; font-weight: 400; padding-bottom: 1px; margin-bottom: 10px; }
191
  .no_related_thumbnail{ padding: 15px 18px; }
192
  .no_related_thumbnail .related_link{ margin: 16px 18px 20px 19px; }
193
  <?php }
194
+ }
195
  if( $redux_builder_amp['wordpress-comments-support'] ==1) { ?>
196
  /* Comments */
197
  .page-numbers{ padding: 9px 10px; background: #fff; font-size: 14px; }
250
  .amp-category-block li:nth-child(3){ margin: 0 1%; }
251
  .searchmenu{ margin-right: 15px; margin-top: 11px; position: absolute; top: 0; right: 0; }
252
  .searchmenu button{ background:transparent; border:none }
253
+ .amp-logo amp-img{max-width: 190px;margin: 0 auto;width:<?php echo ampforwp_default_logo('width');?>px ;position:relative;top:9px;}
254
  .headerlogo{ margin: 0 auto; width: 80%; text-align: center; }
 
255
  .headerlogo a{ color:#F42; }
256
 
257
  /*Navigation Menu*/
283
  #searchsubmit{opacity:0}
284
  .featured_time{ font-size: 12px; color: #fff; opacity: 0.8; padding-left: 20px; }
285
  .archives_body main{ margin-top:30px }
 
286
  .taxonomy-description p{margin-top: 5px;font-size: 14px;line-height: 1.5;}
287
+ .amp-sub-archives li{width: 50%;} .amp-sub-archives ul{padding: 0;list-style: none;display: flex;font-size: 12px;line-height: 1.2;margin: 5px 0 10px 0px;} .author-img amp-img{border-radius: 50%;margin: 0px 12px 10px 0px;display: block; width:50px;}.author-img{float: left;padding-bottom: 25px;}
288
  <?php if(is_home() && $redux_builder_amp['amp-frontpage-select-option']==0){?>
289
  /* AMP carousel */
290
  .amp-carousel-button-prev, .amp-carousel-button-next{ top:30px;border-radius:60px; }
327
  /* Responsive */
328
  @media screen and (min-width: 650px) { table {display: inline-table;} }
329
 
330
+ @media screen and (max-width: 768px){ .amp-wp-meta{ margin:10px 0px 15px 0px } .archive-heading{padding: 0 15px;} .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;} }
331
  @media screen and (max-width: 600px){ .amp-loop-list .amp-wp-tags{display:none} }
332
  @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} }
333
+ @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%; } .amp-loop-list .amp-wp-post-content .large-screen-excerpt-design-3, .related_posts .related_link p{ display:none } .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 } }
334
  @media screen and (max-width: 400px){ .amp-wp-title{ font-size: 19px; } }
335
+ @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: 28px; 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 a{ font-size: 15px; line-height: 1.6; } }
336
  @media screen and (max-width: 340px){ .single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 22px;} .amp-loop-list{ padding: 20px 15px 18px 15px; } h2.amp-wp-title{ line-height: 1.31578947; font-size: 17px; } .related_posts .related_link a{ font-size: 15px; } .the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; } }
337
  @media screen and (max-width: 320px){ .related_posts .related_link a{ font-size: 13px; } .ampforwp-social-icons amp-social-share{ margin-right: 1px; } }
338
  .entry-content amp-anim{display:table-cell;}
340
  .amp-carousel-slide h1{ direction: rtl; }
341
  .featured_time{ text-align: right; padding-right: 20px; }
342
  main .amp-wp-content{ direction: rtl; }
343
+ .home-post_image{ float: right; padding-right: 0%; padding-left: 2%; margin-right: 0%; overflow: hidden;}
344
  .searchmenu{ margin-right: 15px; margin-top: 11px; position: absolute; top: 0; right: inherit; }
345
  .searchform label{ text-align: right; right: -30px; position: relative; }
346
  .searchform input{ text-align: right; padding: 15px; }
374
  .amp-wp-article-content img { max-width: 100%;}
375
  @font-face {
376
  font-family: 'icomoon';
377
+ src: url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.eot');
378
+ src: url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.eot') format('embedded-opentype'),
379
+ url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.ttf') format('truetype'),
380
+ url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.woff') format('woff'),
381
+ url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.svg') format('svg');
382
  font-weight: normal;
383
  font-style: normal;
384
  }
420
  <?php
421
  if ( class_exists('TablePress') ) { ?>
422
  .tablepress-table-description{ clear: both; display: block; }
423
+ .tablepress{ border-collapse: collapse; border-spacing: 0; width: 100%; margin-bottom: 1em; border: none; }
424
  .tablepress th, .tablepress td{ padding: 8px; border: none; background: none; text-align: left; }
425
  .tablepress tbody td{ vertical-align: top; }
426
  .tablepress tbody td, .tablepress tfoot th{ border-top: 1px solid #dddddd; }
templates/features.php CHANGED
@@ -107,8 +107,12 @@
107
  97. Change the format of the post date on Loops #1384
108
  98. Create Dynamic url of amp according to the permalink structure #1318
109
  99. Merriweather Font Management
110
- 100. Flags compatibility in Menu
 
111
  */
 
 
 
112
  // Adding AMP-related things to the main theme
113
  global $redux_builder_amp;
114
 
@@ -474,7 +478,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
474
  }
475
  }
476
  // Facebook Like Script
477
- if( isset($redux_builder_amp['ampforwp-facebook-like-button'] ) && true == $redux_builder_amp['ampforwp-facebook-like-button'] && is_single() ){
478
  if(empty($data['amp_component_scripts']['amp-facebook-like'])){
479
  $data['amp_component_scripts']['amp-facebook-like'] = 'https://cdn.ampproject.org/v0/amp-facebook-like-0.1.js';
480
  }
@@ -954,7 +958,16 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
954
  <?php
955
  }//code ends for supporting Chartbeat Analytics
956
  }//analytics function ends here
957
-
 
 
 
 
 
 
 
 
 
958
  // 11. Strip unwanted codes and tags from the_content
959
  add_action( 'pre_amp_render_post','ampforwp_strip_invalid_content');
960
  function ampforwp_strip_invalid_content() {
@@ -1044,6 +1057,10 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
1044
  $content = preg_replace('/(<[^>]+) ga-on=".*?"/', '$1', $content);
1045
  // ga-event-category
1046
  $content = preg_replace('/(<[^>]+) ga-event-category=".*?"/', '$1', $content);
 
 
 
 
1047
 
1048
  return $content;
1049
  }
@@ -1143,6 +1160,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
1143
  $structured_data_image_url = '';
1144
 
1145
  if ( $post_image_check == false) {
 
1146
  if (! empty( $redux_builder_amp['amp-structured-data-placeholder-image']['url'] ) ) {
1147
  $structured_data_image_url = $redux_builder_amp['amp-structured-data-placeholder-image']['url'];
1148
  }
@@ -1184,14 +1202,32 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
1184
  $metadata['headline'] = $structured_data_archive_title;
1185
  }
1186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1187
  if( in_array( "image" , $metadata ) ) {
1188
  if ( $metadata['image']['width'] < 696 ) {
1189
  $metadata['image']['width'] = 700 ;
1190
- }
1191
  }
1192
-
1193
-
1194
- return $metadata;
1195
  }
1196
 
1197
  // 14. Adds a meta box to the post editing screen for AMP on-off on specific pages.
@@ -1635,6 +1671,8 @@ function ampforwp_remove_schema_data() {
1635
  remove_filter ('the_content', 'FTGSB');
1636
  // Jannah Theme Lazy Load Compatibility
1637
  remove_filter( 'wp_get_attachment_image_attributes', 'jannah_lazyload_image_attributes', 8, 3 );
 
 
1638
  }
1639
 
1640
  // 22. Removing author links from comments Issue #180
@@ -3807,7 +3845,7 @@ function ampforwp_thumbnail_alt(){
3807
  $thumb_id = get_post_thumbnail_id();
3808
  $thumb_alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true) ;
3809
  if($thumb_alt){
3810
- echo 'alt="' . esc_attr($thumb_alt) . '"';
3811
  }
3812
  }
3813
 
@@ -4029,22 +4067,39 @@ function ampforwp_is_custom_field_featured_image(){
4029
  return false;
4030
  }
4031
 
4032
- function ampforwp_cf_featured_image_src(){
4033
  global $redux_builder_amp, $post;
4034
  if($redux_builder_amp['ampforwp-custom-fields-featured-image-switch']){
4035
- $post_id = '';
4036
- $custom_fields = '';
4037
- $featured_image_field = '';
4038
- $custom_fields_name = array();
4039
- $post_id = get_the_ID();
4040
- $custom_fields = get_post_custom($post_id);
 
4041
  foreach ($custom_fields as $key => $value) {
4042
  $custom_fields_name[] = $key;
4043
  }
4044
  $featured_image_field = $redux_builder_amp['ampforwp-custom-fields-featured-image'];
4045
  if(in_array($featured_image_field, $custom_fields_name)){
4046
  $amp_img_src = $custom_fields[$featured_image_field][0];
4047
- return $amp_img_src;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4048
  }
4049
  }
4050
  }
@@ -4264,21 +4319,25 @@ function ampforwp_enable_post_and_featured_image($show_image){
4264
  // 82. Grab Featured Image from The Content
4265
  function ampforwp_get_featured_image_from_content($featured_image = "") {
4266
  global $post, $posts;
4267
- $image_url = '';
4268
- $output = '';
4269
- $matches = '';
4270
- $amp_html_sanitizer = '';
4271
- $amp_html = '';
4272
- $image_html = '';
4273
- $featured_image_output = '';
 
 
4274
  ob_start();
4275
  ob_end_clean();
4276
  // Match all the images from the content
4277
- $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
4278
  //Grab the First Image
4279
  if ( $matches[0] ) {
4280
- $image_url = $matches[1][0];
4281
- $image_html = $matches[0][0];
 
 
4282
  // Sanitize it
4283
  $amp_html_sanitizer = new AMPFORWP_Content( $image_html, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array() ) ) );
4284
  $amp_html = $amp_html_sanitizer->get_amp_content();
@@ -4295,6 +4354,14 @@ function ampforwp_get_featured_image_from_content($featured_image = "") {
4295
  $featured_image_output = $image_url;
4296
  break;
4297
 
 
 
 
 
 
 
 
 
4298
  default:
4299
  $featured_image_output = $amp_html;
4300
  break;
@@ -4335,8 +4402,8 @@ function ampforwp_add_advance_ga_fields($ga_fields){
4335
  // 84. Inline Related Posts
4336
 
4337
  function ampforwp_inline_related_posts(){
4338
- global $post, $redux_builder_amp;
4339
- $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
4340
  $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
4341
 
4342
  // declaring this variable here to prevent debug errors
@@ -4505,44 +4572,32 @@ if( ! function_exists( 'ampforwp_additional_style_carousel_caption' ) ){
4505
  function ampforwp_additional_style_carousel_caption(){ ?>
4506
  .collapsible-captions {--caption-height: 32px; --image-height: 100%; --caption-padding:1rem; --button-size: 28px; --caption-color: #f5f5f5;; --caption-bg-color: #111;}
4507
  .collapsible-captions * {
4508
- /* disable chrome touch highlight */
4509
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
4510
  box-sizing: border-box;
4511
  }
4512
  .collapsible-captions .amp-carousel-container {position: relative; width: 100%;}
4513
  .collapsible-captions amp-img img {object-fit: contain; }
4514
  .collapsible-captions figure { margin: 0; padding: 0; }
4515
- /* single line caption */
4516
  .collapsible-captions figcaption { position: absolute; bottom: 0;width: 100%;
4517
- /* inital height is one line */
4518
- max-height: var(--caption-height);
4519
  line-height: var(--caption-height);
4520
  padding: 0 var(--button-size) 0 5px;
4521
- /* cut text after first line and show an ellipsis */
4522
  white-space: nowrap;
4523
  overflow: hidden;
4524
  text-overflow: ellipsis;
4525
- /* animate expansion */
4526
  transition: max-height 200ms cubic-bezier(0.4, 0, 0.2, 1);
4527
- /* overlay the carousel icons */
4528
  z-index: 1000;
4529
- /* some styling */
4530
  color: var(--caption-color);
4531
- background: rgba(0, 0, 0, 0.6);
4532
  }
4533
- /* expanded caption */
4534
  .collapsible-captions figcaption.expanded {
4535
- /* add padding and show all of the text */
4536
  line-height: inherit;
4537
  white-space: normal;
4538
  text-overflow: auto;
4539
  max-height: 100px;
4540
- /* show scrollbar in case caption is larger than image */
4541
  overflow: auto;
4542
  }
4543
- /* don't show focus highlights in chrome */
4544
  .collapsible-captions figcaption:focus { outline: none; border: none; }
4545
- /* the expand/collapse icon */
4546
  .collapsible-captions figcaption span { display: block; position: absolute;
4547
  top: calc((var(--caption-height) - var(--button-size)) / 2);
4548
  right: 2px; width: var(--button-size); height: var(--button-size);
@@ -4666,21 +4721,44 @@ if( !function_exists('ampforwp_has_post_thumbnail')){
4666
  }
4667
  // Get Post Thumbnail URL
4668
  if( !function_exists('ampforwp_get_post_thumbnail')){
4669
- function ampforwp_get_post_thumbnail(){
4670
  global $post, $redux_builder_amp;
4671
- $thumb_url = '';
 
 
 
4672
  if ( has_post_thumbnail()) {
4673
- $thumb_id = get_post_thumbnail_id();
4674
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
4675
- $thumb_url = $thumb_url_array[0];
 
 
4676
  }
4677
  if(ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src()){
4678
- $thumb_url = ampforwp_cf_featured_image_src();
 
 
4679
  }
4680
  if( true == $redux_builder_amp['ampforwp-featured-image-from-content'] && ampforwp_get_featured_image_from_content('url') ){
4681
- $thumb_url = ampforwp_get_featured_image_from_content('url');
 
 
4682
  }
4683
- return $thumb_url;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4684
  }
4685
  }
4686
 
@@ -4813,7 +4891,7 @@ if( ! function_exists( 'ampforwp_view_amp_admin_bar' ) ) {
4813
  $wp_admin_bar->add_node(array(
4814
  'id' => 'ampforwp-view-amp',
4815
  'title' => 'View ' . $post_type_title . ' (AMP)' ,
4816
- 'href' => user_trailingslashit( trailingslashit( get_permalink( $post->ID ) ) . AMPFORWP_AMP_QUERY_VAR )
4817
  ));
4818
  }
4819
  }
@@ -5085,24 +5163,96 @@ if( ! function_exists(' ampforwp_modify_menu_content ') ){
5085
  $dom = '';
5086
  $nodes = '';
5087
  $num_nodes = '';
5088
- // Create a new document
5089
- $dom = new DOMDocument();
5090
- $dom->loadHTML(mb_convert_encoding($menu, 'HTML-ENTITIES', 'UTF-8'));
5091
-
5092
- // get all the img's
5093
- $nodes = $dom->getElementsByTagName( 'img' );
5094
- $num_nodes = $nodes->length;
5095
- for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
5096
- $node = $nodes->item( $i );
5097
- // Set The Width and Height if there in none
5098
- if ( '' === $node->getAttribute( 'width' ) ) {
5099
- $node->setAttribute('width', 15);
5100
  }
5101
- if( '' === $node->getAttribute( 'height' ) ){
5102
- $node->setAttribute('height', 15);
5103
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5104
  }
5105
- $menu = $dom->saveHTML();
5106
  return $menu;
5107
  }
5108
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  97. Change the format of the post date on Loops #1384
108
  98. Create Dynamic url of amp according to the permalink structure #1318
109
  99. Merriweather Font Management
110
+ 100. Flags compatibility in Menu
111
+ 101. Function for Logo attributes
112
  */
113
+ // AMP Components
114
+ // AMP LOGO
115
+ add_amp_theme_support('AMP-logo');
116
  // Adding AMP-related things to the main theme
117
  global $redux_builder_amp;
118
 
478
  }
479
  }
480
  // Facebook Like Script
481
+ if( true == $redux_builder_amp['ampforwp-facebook-like-button'] && is_single() && defined('AMPFORWP_DM_SOCIAL_CHECK') && 'true' === AMPFORWP_DM_SOCIAL_CHECK ){
482
  if(empty($data['amp_component_scripts']['amp-facebook-like'])){
483
  $data['amp_component_scripts']['amp-facebook-like'] = 'https://cdn.ampproject.org/v0/amp-facebook-like-0.1.js';
484
  }
958
  <?php
959
  }//code ends for supporting Chartbeat Analytics
960
  }//analytics function ends here
961
+ // For Setting up Google AMP Client ID API
962
+ add_action( 'amp_post_template_head' , 'ampforwp_analytics_clientid_api' );
963
+ if( ! function_exists( ' ampforwp_analytics_clientid_api ' ) ) {
964
+ function ampforwp_analytics_clientid_api() {
965
+ global $redux_builder_amp;
966
+ if ( 1 == $redux_builder_amp['amp-analytics-select-option'] || 'googleanalytics' == $redux_builder_amp['amp-gtm-analytics-type']){ ?>
967
+ <meta name="amp-google-client-id-api" content="googleanalytics">
968
+ <?php }
969
+ }
970
+ }
971
  // 11. Strip unwanted codes and tags from the_content
972
  add_action( 'pre_amp_render_post','ampforwp_strip_invalid_content');
973
  function ampforwp_strip_invalid_content() {
1057
  $content = preg_replace('/(<[^>]+) ga-on=".*?"/', '$1', $content);
1058
  // ga-event-category
1059
  $content = preg_replace('/(<[^>]+) ga-event-category=".*?"/', '$1', $content);
1060
+ // aria-current
1061
+ $content = preg_replace('/(<[^>]+) aria-current=".*?"/', '$1', $content);
1062
+ // Gallery Break fix
1063
+ $content = preg_replace('/\[gallery(.*?)\]/', '</p>[gallery$1]</p>', $content);
1064
 
1065
  return $content;
1066
  }
1160
  $structured_data_image_url = '';
1161
 
1162
  if ( $post_image_check == false) {
1163
+
1164
  if (! empty( $redux_builder_amp['amp-structured-data-placeholder-image']['url'] ) ) {
1165
  $structured_data_image_url = $redux_builder_amp['amp-structured-data-placeholder-image']['url'];
1166
  }
1202
  $metadata['headline'] = $structured_data_archive_title;
1203
  }
1204
 
1205
+ // Get Image metadata from the Custom Field
1206
+ if(ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src()){
1207
+ $metadata['image'] = array(
1208
+ '@type' => 'ImageObject',
1209
+ 'url' => ampforwp_cf_featured_image_src('url') ,
1210
+ 'width' => ampforwp_cf_featured_image_src('width'),
1211
+ 'height' => ampforwp_cf_featured_image_src('height'),
1212
+ );
1213
+ }
1214
+
1215
+ // Get image metadata from The Content
1216
+ if( true == $redux_builder_amp['ampforwp-featured-image-from-content'] && ampforwp_get_featured_image_from_content() ){
1217
+ $metadata['image'] = array(
1218
+ '@type' => 'ImageObject',
1219
+ 'url' => ampforwp_get_featured_image_from_content('url') ,
1220
+ 'width' => ampforwp_get_featured_image_from_content('width'),
1221
+ 'height' => ampforwp_get_featured_image_from_content('height'),
1222
+ );
1223
+ }
1224
+
1225
  if( in_array( "image" , $metadata ) ) {
1226
  if ( $metadata['image']['width'] < 696 ) {
1227
  $metadata['image']['width'] = 700 ;
1228
+ }
1229
  }
1230
+ return $metadata;
 
 
1231
  }
1232
 
1233
  // 14. Adds a meta box to the post editing screen for AMP on-off on specific pages.
1671
  remove_filter ('the_content', 'FTGSB');
1672
  // Jannah Theme Lazy Load Compatibility
1673
  remove_filter( 'wp_get_attachment_image_attributes', 'jannah_lazyload_image_attributes', 8, 3 );
1674
+ // Goodlife Theme Lazy Load Compatibility
1675
+ remove_filter( 'post_thumbnail_html', 'thb_src_attribute', 10, 3 );
1676
  }
1677
 
1678
  // 22. Removing author links from comments Issue #180
3845
  $thumb_id = get_post_thumbnail_id();
3846
  $thumb_alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true) ;
3847
  if($thumb_alt){
3848
+ echo ' alt="' . esc_attr($thumb_alt) . '" ';
3849
  }
3850
  }
3851
 
4067
  return false;
4068
  }
4069
 
4070
+ function ampforwp_cf_featured_image_src($param=""){
4071
  global $redux_builder_amp, $post;
4072
  if($redux_builder_amp['ampforwp-custom-fields-featured-image-switch']){
4073
+ $post_id = '';
4074
+ $custom_fields = '';
4075
+ $featured_image_field = '';
4076
+ $output = '';
4077
+ $custom_fields_name = array();
4078
+ $post_id = get_the_ID();
4079
+ $custom_fields = get_post_custom($post_id);
4080
  foreach ($custom_fields as $key => $value) {
4081
  $custom_fields_name[] = $key;
4082
  }
4083
  $featured_image_field = $redux_builder_amp['ampforwp-custom-fields-featured-image'];
4084
  if(in_array($featured_image_field, $custom_fields_name)){
4085
  $amp_img_src = $custom_fields[$featured_image_field][0];
4086
+ $image_id = attachment_url_to_postid($amp_img_src);
4087
+ $image = wp_get_attachment_image_src($image_id, 'full');
4088
+ switch ($param) {
4089
+ case 'url':
4090
+ $output = $image[0];
4091
+ break;
4092
+ case 'width':
4093
+ $output = $image[1];
4094
+ break;
4095
+ case 'height':
4096
+ $output = $image[2];
4097
+ break;
4098
+ default:
4099
+ $output = $image[0];
4100
+ break;
4101
+ }
4102
+ return $output;
4103
  }
4104
  }
4105
  }
4319
  // 82. Grab Featured Image from The Content
4320
  function ampforwp_get_featured_image_from_content($featured_image = "") {
4321
  global $post, $posts;
4322
+ $image_url = '';
4323
+ $image_width = '';
4324
+ $image_height = '';
4325
+ $output = '';
4326
+ $matches = '';
4327
+ $amp_html_sanitizer = '';
4328
+ $amp_html = '';
4329
+ $image_html = '';
4330
+ $featured_image_output = '';
4331
  ob_start();
4332
  ob_end_clean();
4333
  // Match all the images from the content
4334
+ $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*.+width=[\'"]([^\'"]+)[\'"].*.+height=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
4335
  //Grab the First Image
4336
  if ( $matches[0] ) {
4337
+ $image_url = $matches[1][0];
4338
+ $image_html = $matches[0][0];
4339
+ $image_width = $matches[2][0];
4340
+ $image_height = $matches[3][0];
4341
  // Sanitize it
4342
  $amp_html_sanitizer = new AMPFORWP_Content( $image_html, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array() ) ) );
4343
  $amp_html = $amp_html_sanitizer->get_amp_content();
4354
  $featured_image_output = $image_url;
4355
  break;
4356
 
4357
+ case 'width':
4358
+ $featured_image_output = $image_width;
4359
+ break;
4360
+
4361
+ case 'height':
4362
+ $featured_image_output = $image_height;
4363
+ break;
4364
+
4365
  default:
4366
  $featured_image_output = $amp_html;
4367
  break;
4402
  // 84. Inline Related Posts
4403
 
4404
  function ampforwp_inline_related_posts(){
4405
+ global $post, $redux_builder_amp;
4406
+ $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-inline-related-posts'];
4407
  $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
4408
 
4409
  // declaring this variable here to prevent debug errors
4572
  function ampforwp_additional_style_carousel_caption(){ ?>
4573
  .collapsible-captions {--caption-height: 32px; --image-height: 100%; --caption-padding:1rem; --button-size: 28px; --caption-color: #f5f5f5;; --caption-bg-color: #111;}
4574
  .collapsible-captions * {
 
4575
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
4576
  box-sizing: border-box;
4577
  }
4578
  .collapsible-captions .amp-carousel-container {position: relative; width: 100%;}
4579
  .collapsible-captions amp-img img {object-fit: contain; }
4580
  .collapsible-captions figure { margin: 0; padding: 0; }
 
4581
  .collapsible-captions figcaption { position: absolute; bottom: 0;width: 100%;
4582
+ max-height: var(--caption-height);margin-bottom:0;
 
4583
  line-height: var(--caption-height);
4584
  padding: 0 var(--button-size) 0 5px;
 
4585
  white-space: nowrap;
4586
  overflow: hidden;
4587
  text-overflow: ellipsis;
 
4588
  transition: max-height 200ms cubic-bezier(0.4, 0, 0.2, 1);
 
4589
  z-index: 1000;
 
4590
  color: var(--caption-color);
4591
+ background: rgba(0, 0, 0, 0.6);
4592
  }
 
4593
  .collapsible-captions figcaption.expanded {
 
4594
  line-height: inherit;
4595
  white-space: normal;
4596
  text-overflow: auto;
4597
  max-height: 100px;
 
4598
  overflow: auto;
4599
  }
 
4600
  .collapsible-captions figcaption:focus { outline: none; border: none; }
 
4601
  .collapsible-captions figcaption span { display: block; position: absolute;
4602
  top: calc((var(--caption-height) - var(--button-size)) / 2);
4603
  right: 2px; width: var(--button-size); height: var(--button-size);
4721
  }
4722
  // Get Post Thumbnail URL
4723
  if( !function_exists('ampforwp_get_post_thumbnail')){
4724
+ function ampforwp_get_post_thumbnail($param=""){
4725
  global $post, $redux_builder_amp;
4726
+ $thumb_url = '';
4727
+ $thumb_width = '';
4728
+ $thumb_height = '';
4729
+ $output = '';
4730
  if ( has_post_thumbnail()) {
4731
+ $thumb_id = get_post_thumbnail_id();
4732
+ $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
4733
+ $thumb_url = $thumb_url_array[0];
4734
+ $thumb_width = $thumb_url_array[1];
4735
+ $thumb_height = $thumb_url_array[2];
4736
  }
4737
  if(ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src()){
4738
+ $thumb_url = ampforwp_cf_featured_image_src();
4739
+ $thumb_width = ampforwp_cf_featured_image_src('width');
4740
+ $thumb_height = ampforwp_cf_featured_image_src('height');
4741
  }
4742
  if( true == $redux_builder_amp['ampforwp-featured-image-from-content'] && ampforwp_get_featured_image_from_content('url') ){
4743
+ $thumb_url = ampforwp_get_featured_image_from_content('url');
4744
+ $thumb_width = ampforwp_get_featured_image_from_content('width');
4745
+ $thumb_height = ampforwp_get_featured_image_from_content('height');
4746
  }
4747
+ switch ($param) {
4748
+ case 'url':
4749
+ $output = $thumb_url;
4750
+ break;
4751
+ case 'width':
4752
+ $output = $thumb_width;
4753
+ break;
4754
+ case 'height':
4755
+ $output = $thumb_height;
4756
+ break;
4757
+ default:
4758
+ $output = $thumb_url;
4759
+ break;
4760
+ }
4761
+ return $output;
4762
  }
4763
  }
4764
 
4891
  $wp_admin_bar->add_node(array(
4892
  'id' => 'ampforwp-view-amp',
4893
  'title' => 'View ' . $post_type_title . ' (AMP)' ,
4894
+ 'href' => ampforwp_url_controller( get_permalink( $post->ID ) )
4895
  ));
4896
  }
4897
  }
5163
  $dom = '';
5164
  $nodes = '';
5165
  $num_nodes = '';
5166
+ if( !empty( $menu ) ){
5167
+ // Create a new document
5168
+ $dom = new DOMDocument();
5169
+ if( function_exists( 'mb_convert_encoding' ) ){
5170
+ $menu = mb_convert_encoding($menu, 'HTML-ENTITIES', 'UTF-8');
 
 
 
 
 
 
 
5171
  }
5172
+ else{
5173
+ $menu = preg_replace( '/&.*?;/', 'x', $menu ); // multi-byte characters converted to X
5174
  }
5175
+ $dom->loadHTML($menu);
5176
+
5177
+ // get all the img's
5178
+ $nodes = $dom->getElementsByTagName( 'img' );
5179
+ $num_nodes = $nodes->length;
5180
+ for ( $i = $num_nodes - 1; $i >= 0; $i-- ) {
5181
+ $node = $nodes->item( $i );
5182
+ // Set The Width and Height if there in none
5183
+ if ( '' === $node->getAttribute( 'width' ) ) {
5184
+ $node->setAttribute('width', 15);
5185
+ }
5186
+ if( '' === $node->getAttribute( 'height' ) ){
5187
+ $node->setAttribute('height', 15);
5188
+ }
5189
+ }
5190
+ $menu = $dom->saveHTML();
5191
  }
 
5192
  return $menu;
5193
  }
5194
+ }
5195
+
5196
+ // 101. Function for Logo attributes
5197
+ function ampforwp_default_logo($param=""){
5198
+ global $redux_builder_amp;
5199
+ $logo_id = '';
5200
+ $image = '';
5201
+ $value = '';
5202
+ $logo_alt = '';
5203
+ $logo_url = $redux_builder_amp['opt-media']['url'];
5204
+ if($logo_url){
5205
+ $logo_id = attachment_url_to_postid($redux_builder_amp['opt-media']['url']);
5206
+ $logo_alt = get_post_meta( $logo_id, '_wp_attachment_image_alt', true) ;
5207
+ $image = wp_get_attachment_image_src( $logo_id , 'full');
5208
+ switch ($param) {
5209
+ case 'url':
5210
+ if( $logo_id == get_theme_mod( 'custom_logo' ) ){
5211
+ $value = $image[0];
5212
+ }
5213
+ else
5214
+ $value = $logo_url;
5215
+ break;
5216
+ case 'width':
5217
+ if (true == $redux_builder_amp['ampforwp-custom-logo-dimensions']) {
5218
+ $value = $redux_builder_amp['opt-media-width'];
5219
+ }
5220
+ else
5221
+ $value = $image[1];
5222
+ break;
5223
+ case 'height':
5224
+ if (true == $redux_builder_amp['ampforwp-custom-logo-dimensions']) {
5225
+ $value = $redux_builder_amp['opt-media-height'];
5226
+ }
5227
+ else
5228
+ $value = $image[2];
5229
+ break;
5230
+ case 'alt':
5231
+ if($logo_alt){
5232
+ $value = $logo_alt;
5233
+ }
5234
+ else
5235
+ $value = get_bloginfo('name');
5236
+ break;
5237
+ default:
5238
+ $value = $image[0];
5239
+ break;
5240
+ }
5241
+ }
5242
+ return $value;
5243
+ }
5244
+ // Envira Lazy Load compatibility
5245
+ add_filter('envira_gallery_pre_data', 'ampforwp_envira_lazy_load');
5246
+ if( ! function_exists(' ampforwp_envira_lazy_load ') ){
5247
+ function ampforwp_envira_lazy_load($data){
5248
+ if( function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint() ){
5249
+ if(function_exists('envira_get_config')){
5250
+ $checker = envira_get_config( 'lazy_loading', $data);
5251
+ if( 1 === $checker){
5252
+ $data['config']['lazy_loading'] = 0;
5253
+ }
5254
+ }
5255
+ }
5256
+ return $data;
5257
+ }
5258
+ }
templates/instant-articles/instant-article-sanitizer.php CHANGED
@@ -14,6 +14,8 @@ if(class_exists("DOMDocument")){
14
  add_filter( 'fbia_content_dom','no_empty_p_tags');
15
  // Wrap the Tables and Iframes inside Figure
16
  add_filter( 'fbia_content_dom','ampforwp_fbia_wrap_elements');
 
 
17
  }
18
  function headlines($content){
19
  // Replace h3, h4, h5, h6 with h2
@@ -251,6 +253,27 @@ function ampforwp_fbia_wrap_elements( $DOMDocument ){
251
  }
252
  return $DOMDocument;
253
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
 
255
  function get_ia_placement_id(){
256
  global $redux_builder_amp;
14
  add_filter( 'fbia_content_dom','no_empty_p_tags');
15
  // Wrap the Tables and Iframes inside Figure
16
  add_filter( 'fbia_content_dom','ampforwp_fbia_wrap_elements');
17
+ // Video Filter
18
+ add_filter( 'fbia_content_dom','ampforwp_fbia_video_element');
19
  }
20
  function headlines($content){
21
  // Replace h3, h4, h5, h6 with h2
253
  }
254
  return $DOMDocument;
255
  }
256
+ // Video Element
257
+ function ampforwp_fbia_video_element( $DOMDocument ){
258
+ $video_elements = $DOMDocument->getElementsByTagName( 'video' );
259
+
260
+ // Iterate over all the video items
261
+ for ( $i = 0; $i < $video_elements->length; ++$i ) {
262
+ $video = $video_elements->item( $i );
263
+
264
+ if($video->parentNode->nodeName == "figure"){
265
+ // This element is already wrapped in a figure tag, we only need to make sure it's placed right
266
+ $video = $video->parentNode;
267
+ } else {
268
+ // Wrap this video into a figure tag
269
+ $figure = $DOMDocument->createElement('figure');
270
+ $video->parentNode->replaceChild($figure, $video);
271
+ $figure->appendChild($video);
272
+ $video = $figure;
273
+ }
274
+ }
275
+ return $DOMDocument;
276
+ }
277
 
278
  function get_ia_placement_id(){
279
  global $redux_builder_amp;
templates/instant-articles/instant-article.php CHANGED
@@ -62,8 +62,11 @@
62
  </header>
63
 
64
  <!-- body -->
65
- <?php
66
- echo apply_filters('fbia_content', apply_filters('the_content', get_the_content( '' ))); ?>
 
 
 
67
  <?php if (isset($redux_builder_amp['fb-instant-article-analytics']) && $redux_builder_amp['fb-instant-article-analytics'] ){
68
  if(isset($redux_builder_amp['fb-instant-article-analytics-code']) && $redux_builder_amp['fb-instant-article-analytics-code'] ) {?>
69
  <!-- Analytics code -->
62
  </header>
63
 
64
  <!-- body -->
65
+ <?php
66
+ global $more;
67
+ // Make it 1 to allow the full article
68
+ $more = 1;
69
+ echo apply_filters('fbia_content', apply_filters('the_content', get_the_content())); ?>
70
  <?php if (isset($redux_builder_amp['fb-instant-article-analytics']) && $redux_builder_amp['fb-instant-article-analytics'] ){
71
  if(isset($redux_builder_amp['fb-instant-article-analytics-code']) && $redux_builder_amp['fb-instant-article-analytics-code'] ) {?>
72
  <!-- Analytics code -->