AMP for WP – Accelerated Mobile Pages - Version 0.9.43.5

Version Description

  • View more details at https://ampforwp.com/stability-sprint-2-50th-update/
  • Fixed shortcodes issue in related posts #543
  • Iframe Scripts Added properly
  • Proper conditions added for the social section of Design 3
  • Featured Image issue stretched in Design 2 & 3
  • Removed extra global $redux_builder_amp;
  • Custom Logo Dimensions option added #479
  • Index & NoIndex options added for SEO section. #558
  • Added URL for rewrite flushing rules in Options
  • Option to enable and disable the Author area in Design 3#577
  • Rel Nofollow added in credit link
  • debug issue solved: fn_offset not defined
  • debug issue solved: global $post not declared
  • The word 'ago' is now translatable in design 3
  • The word 'read next' is translatable now
  • Tablepress compatibility added #392
  • Secure API server is now serving through Google Cloud Manager.
  • Thrive Content builder was displaying twice when the Custom AMP content was on. It was a complex issue which has been solved now.
  • amp-ad extension.js script was loading if the Ads are not enabled. #598
  • Social Share Extension Included on Homepage even if we didn't have social icons #599
  • Installation UX improvement #593
  • Removed duplicate global variable
  • Proper OG tags added #588
  • Proper instructions added for Custom AMP content #471
Download this release

Release Info

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

Code changes from version 0.9.43.1 to 0.9.43.5

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.43.1
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/5
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
16
  define('AMPFORWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
17
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
18
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
19
- define('AMPFORWP_VERSION','0.9.43.1');
20
 
21
  // Rewrite the Endpoints after the plugin is activate, as priority is set to 11
22
  function ampforwp_add_custom_post_support() {
@@ -115,14 +115,23 @@ function ampforwp_rewrite_deactivate() {
115
  * As we don't need plugin activation code to run everytime the site loads
116
  */
117
  if ( is_admin() ) {
118
- add_action('init','ampforwp_plugin_notice');
 
 
 
119
  function ampforwp_plugin_notice() {
120
 
121
  if ( ! defined( 'AMP__FILE__' ) ) {
122
  add_action( 'admin_notices', 'ampforwp_plugin_not_found_notice' );
123
- function ampforwp_plugin_not_found_notice() { ?>
 
 
 
 
 
 
124
 
125
- <div class="notice notice-error is-dismissible">
126
 
127
  <?php add_thickbox(); ?>
128
  <p>
@@ -136,13 +145,15 @@ if ( is_admin() ) {
136
  add_action('admin_head','ampforwp_required_plugin_styling');
137
  function ampforwp_required_plugin_styling() { ?>
138
  <style>
 
139
  .plugin-card.plugin-card-amp:before{
140
- content: "Install & Activate this plugin ↓";
141
  font-weight: bold;
142
- left: 50%;
143
  position: relative;
144
- top: 9px;
145
- font-size: 16px;
 
146
  }
147
  .plugin-action-buttons a{
148
  color: #fff
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.43.5
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/5
16
  define('AMPFORWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
17
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
18
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
19
+ define('AMPFORWP_VERSION','0.9.43.5');
20
 
21
  // Rewrite the Endpoints after the plugin is activate, as priority is set to 11
22
  function ampforwp_add_custom_post_support() {
115
  * As we don't need plugin activation code to run everytime the site loads
116
  */
117
  if ( is_admin() ) {
118
+
119
+ add_action('init','ampforwp_plugin_notice');
120
+
121
+
122
  function ampforwp_plugin_notice() {
123
 
124
  if ( ! defined( 'AMP__FILE__' ) ) {
125
  add_action( 'admin_notices', 'ampforwp_plugin_not_found_notice' );
126
+ function ampforwp_plugin_not_found_notice() {
127
+
128
+ $current_screen = get_current_screen();
129
+
130
+ if( $current_screen ->id == "plugin-install" ) {
131
+ return;
132
+ } ?>
133
 
134
+ <div class="notice notice-error is-dismissible ampinstallation">
135
 
136
  <?php add_thickbox(); ?>
137
  <p>
145
  add_action('admin_head','ampforwp_required_plugin_styling');
146
  function ampforwp_required_plugin_styling() { ?>
147
  <style>
148
+ .notice, .notice-error, .is-dismissible, .ampinstallation{}
149
  .plugin-card.plugin-card-amp:before{
150
+ content: "FINISH INSTALLATION: Install & Activate this plugin ↓";
151
  font-weight: bold;
152
+ float: right;
153
  position: relative;
154
+ color: #dc3232;
155
+ top: -28px;
156
+ font-size: 18px;
157
  }
158
  .plugin-action-buttons a{
159
  color: #fff
includes/options/admin-config.php CHANGED
@@ -148,6 +148,30 @@ Redux::setArgs( "redux_builder_amp", $args );
148
  'subtitle' => __('Upload a logo for the AMP version.', 'redux-framework-demo'),
149
  'desc' => __('Recommend logo size is: 190x36', 'redux-framework-demo')
150
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
 
152
 
153
  array(
@@ -187,7 +211,7 @@ Redux::setArgs( "redux_builder_amp", $args );
187
  'title' => __('AMP on Pages', 'redux-framework-demo'),
188
  'subtitle' => __('Enable or Disable AMP on all Pages', 'redux-framework-demo'),
189
  'default' => 1,
190
- 'desc' => __( 'Re-Save permalink if you make changes in this option', 'redux-framework-demo' ),
191
  ),
192
 
193
 
@@ -438,6 +462,15 @@ Redux::setArgs( "redux_builder_amp", $args );
438
  ),
439
  'default' => '1'
440
  ),
 
 
 
 
 
 
 
 
 
441
 
442
 
443
  array(
@@ -489,6 +522,50 @@ Redux::setArgs( "redux_builder_amp", $args );
489
  'placeholder' => "<!-- Paste your Additional HTML , that goes between <head> </head> tags -->"
490
  ),
491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  )
493
 
494
  )
@@ -731,23 +808,6 @@ Redux::setArgs( "redux_builder_amp", $args );
731
  'default' => 1,
732
  'subtitle' => __('Enable Next-Previous links in single', 'redux-framework-demo'),
733
  ),
734
- // Width and Height of Image
735
- array(
736
- 'id' => 'enable-single-featured-img-width',
737
- 'type' => 'text',
738
- 'title' => __('Featured Image Width', 'redux-framework-demo'),
739
- 'default' => 512,
740
- 'subtitle' => __('Custom featured image width in Units : Px', 'redux-framework-demo'),
741
- 'placeholder' =>'Width here',
742
- ),
743
- array(
744
- 'id' => 'enable-single-featured-img-height',
745
- 'type' => 'text',
746
- 'title' => __('Featured Image Height', 'redux-framework-demo'),
747
- 'default' => 300,
748
- 'subtitle' => __('Custom featured image height in Units : Px', 'redux-framework-demo'),
749
- 'placeholder' =>'Height here',
750
- ),
751
  // Related Post
752
  array(
753
  'id' => 'ampforwp-single-select-type-of-related',
@@ -780,13 +840,6 @@ Redux::setArgs( "redux_builder_amp", $args );
780
  'desc' => 'enable social share and your social profiels here',
781
  'subsection' => true,
782
  'fields' => array(
783
- array(
784
- 'id' => 'social-media-share-subsection',
785
- 'type' => 'section',
786
- 'title' => __('Social Media Share', 'redux-framework-demo'),
787
- 'subtitle' => __('Please enable shocial media companies for share here', 'redux-framework-demo'),
788
- 'indent' => true
789
- ),
790
  // Facebook ON/OFF
791
  array(
792
  'id' => 'enable-single-facebook-share',
@@ -860,7 +913,10 @@ Redux::setArgs( "redux_builder_amp", $args );
860
  'type' => 'section',
861
  'title' => __('Social Media Profiles (Design #3)', 'redux-framework-demo'),
862
  'subtitle' => __('Please enter your personal/organizational social media profiles here', 'redux-framework-demo'),
863
- 'indent' => true
 
 
 
864
  ),
865
  //#1
866
  array(
@@ -1339,6 +1395,13 @@ Redux::setArgs( "redux_builder_amp", $args );
1339
  'default' => 'Tag: ',
1340
  'placeholder'=>'write here'
1341
  ),
 
 
 
 
 
 
 
1342
  )
1343
  ) );
1344
 
148
  'subtitle' => __('Upload a logo for the AMP version.', 'redux-framework-demo'),
149
  'desc' => __('Recommend logo size is: 190x36', 'redux-framework-demo')
150
  ),
151
+ array(
152
+ 'id' => 'ampforwp-custom-logo-dimensions',
153
+ 'title' => __('Custom Logo Size', 'redux-framework-demo'),
154
+ 'type' => 'switch',
155
+ 'default' => 0,
156
+ ),
157
+ array(
158
+ 'id' => 'opt-media-width',
159
+ 'type' => 'text',
160
+ 'title' => __('Logo Width', 'redux-framework-demo'),
161
+ 'desc' => __('Default width is 190 pixels', 'redux-framework-demo'),
162
+ 'default' => '190',
163
+ 'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
164
+
165
+ ),
166
+ array(
167
+ 'id' => 'opt-media-height',
168
+ 'type' => 'text',
169
+ 'title' => __('Logo Height', 'redux-framework-demo'),
170
+ 'desc' => __('Default height is 36 pixels', 'redux-framework-demo'),
171
+ 'default' => '36',
172
+ 'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
173
+
174
+ ),
175
 
176
 
177
  array(
211
  'title' => __('AMP on Pages', 'redux-framework-demo'),
212
  'subtitle' => __('Enable or Disable AMP on all Pages', 'redux-framework-demo'),
213
  'default' => 1,
214
+ 'desc' => __( 'Re-Save permalink if you make changes in this option, please have a look <a href="https://ampforwp.com/flush-rewrite-urls/">here</a> on how to do it', 'redux-framework-demo' ),
215
  ),
216
 
217
 
462
  ),
463
  'default' => '1'
464
  ),
465
+ array(
466
+ 'id' => 'amp-design-3-author-description',
467
+ 'type' => 'switch',
468
+ 'title' => __( 'Author Bio in Single', 'redux-framework-demo' ),
469
+ 'required' => array(
470
+ array('amp-design-selector', '=' , '3')
471
+ ),
472
+ 'default' => '1'
473
+ ),
474
 
475
 
476
  array(
522
  'placeholder' => "<!-- Paste your Additional HTML , that goes between <head> </head> tags -->"
523
  ),
524
 
525
+ array(
526
+ 'id' => 'ampforwp-seo-index-noindex-sub-section',
527
+ 'type' => 'section',
528
+ 'title' => __('Advanced Index & No Index Options', 'redux-framework-demo'),
529
+ 'indent' => true
530
+ ),
531
+ array(
532
+ 'id' => 'ampforwp-robots-archive-sub-pages-sitewide',
533
+ 'type' => 'switch',
534
+ 'title' => __('Archive subpages (sitewide)', 'redux-framework-demo'),
535
+ 'desc' => "Such as /page/2 so on and so forth",
536
+ 'default' => 0,
537
+ 'on' => 'index',
538
+ 'off' => 'noindex'
539
+ ),
540
+ array(
541
+ 'id' => 'ampforwp-robots-archive-author-pages',
542
+ 'type' => 'switch',
543
+ 'title' => __('Author Archive pages', 'redux-framework-demo'),
544
+ 'default' => 1,
545
+ 'on' => 'index',
546
+ 'off' => 'noindex'
547
+
548
+ ),
549
+ array(
550
+ 'id' => 'ampforwp-robots-archive-date-page1',
551
+ 'type' => 'switch',
552
+ 'title' => __('Date Archive pages', 'redux-framework-demo'),
553
+ 'default' => 1,
554
+ 'on' => 'index',
555
+ 'off' => 'noindex'
556
+
557
+ ),
558
+ array(
559
+ 'id' => 'ampforwp-robots-archive-taxonomy-pages',
560
+ 'type' => 'switch',
561
+ 'title' => __('Categories & Tags', 'redux-framework-demo'),
562
+ 'default' => 1,
563
+ 'on' => 'index',
564
+ 'off' => 'noindex'
565
+
566
+ ),
567
+
568
+
569
  )
570
 
571
  )
808
  'default' => 1,
809
  'subtitle' => __('Enable Next-Previous links in single', 'redux-framework-demo'),
810
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
811
  // Related Post
812
  array(
813
  'id' => 'ampforwp-single-select-type-of-related',
840
  'desc' => 'enable social share and your social profiels here',
841
  'subsection' => true,
842
  'fields' => array(
 
 
 
 
 
 
 
843
  // Facebook ON/OFF
844
  array(
845
  'id' => 'enable-single-facebook-share',
913
  'type' => 'section',
914
  'title' => __('Social Media Profiles (Design #3)', 'redux-framework-demo'),
915
  'subtitle' => __('Please enter your personal/organizational social media profiles here', 'redux-framework-demo'),
916
+ 'indent' => true,
917
+ 'required' => array(
918
+ array('amp-design-selector', '=' , '3')
919
+ ),
920
  ),
921
  //#1
922
  array(
1395
  'default' => 'Tag: ',
1396
  'placeholder'=>'write here'
1397
  ),
1398
+ array(
1399
+ 'id' => 'amp-translator-next-read-text',
1400
+ 'type' => 'text',
1401
+ 'title' => __('Next Read', 'redux-framework-demo'),
1402
+ 'default' => 'Next Read: ',
1403
+ 'placeholder'=>'write here'
1404
+ ),
1405
  )
1406
  ) );
1407
 
includes/options/redux-core/assets/css/redux-admin.css CHANGED
@@ -174,4 +174,7 @@
174
  }
175
  img.ampforwp-post-builder-img{
176
  height: 72px
 
 
 
177
  }
174
  }
175
  img.ampforwp-post-builder-img{
176
  height: 72px
177
+ }
178
+ .redux-main .form-table-section-indented{
179
+ margin-left: 0 !important
180
  }
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/5
5
  Requires at least: 3.0
6
  Tested up to: 4.7.2
7
- Stable tag: 0.9.43.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -126,6 +126,33 @@ You can contact me using this url: http://ampforwp.com/contact/
126
 
127
  == Changelog ==
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  = 0.9.43.1 =
130
  * View more details at https://ampforwp.com/0-9-43-1-released-stability-sprint-1-49th-update/
131
  * Emoji in comments leads to AMP errors
4
  Donate link: https://www.paypal.me/Kaludi/5
5
  Requires at least: 3.0
6
  Tested up to: 4.7.2
7
+ Stable tag: 0.9.43.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
126
 
127
  == Changelog ==
128
 
129
+ = 0.9.43.5 =
130
+ * View more details at https://ampforwp.com/stability-sprint-2-50th-update/
131
+ * Fixed shortcodes issue in related posts #543
132
+ * Iframe Scripts Added properly
133
+ * Proper conditions added for the social section of Design 3
134
+ * Featured Image issue stretched in Design 2 & 3
135
+ * Removed extra global $redux_builder_amp;
136
+ * Custom Logo Dimensions option added #479
137
+ * Index & NoIndex options added for SEO section. #558
138
+ * Added URL for rewrite flushing rules in Options
139
+ * Option to enable and disable the Author area in Design 3#577
140
+ * Rel Nofollow added in credit link
141
+ * debug issue solved: fn_offset not defined
142
+ * debug issue solved: global $post not declared
143
+ * The word 'ago' is now translatable in design 3
144
+ * The word 'read next' is translatable now
145
+ * Tablepress compatibility added #392
146
+ * Secure API server is now serving through Google Cloud Manager.
147
+ * Thrive Content builder was displaying twice when the Custom AMP content was on. It was a complex issue which has been solved now.
148
+ * amp-ad extension.js script was loading if the Ads are not enabled. #598
149
+ * Social Share Extension Included on Homepage even if we didn't have social icons #599
150
+ * Installation UX improvement #593
151
+ * Removed duplicate global variable
152
+ * Proper OG tags added #588
153
+ * Proper instructions added for Custom AMP content #471
154
+
155
+
156
  = 0.9.43.1 =
157
  * View more details at https://ampforwp.com/0-9-43-1-released-stability-sprint-1-49th-update/
158
  * Emoji in comments leads to AMP errors
templates/custom-amp-content.php CHANGED
@@ -10,6 +10,7 @@ function ampforwp_custom_post_content_sanitizer( $data, $post ) {
10
  return $data;
11
  }
12
 
 
13
  $amp_custom_post_content_input = get_post_meta($post->ID, 'ampforwp_custom_content_editor', true);
14
  $amp_custom_post_content_check = get_post_meta($post->ID, 'ampforwp_custom_content_editor_checkbox', true);
15
 
@@ -72,7 +73,7 @@ function amp_content_editor_title_callback( $post ) {
72
  <label for="meta-checkbox">
73
  <p>
74
  <input type="checkbox" name="ampforwp_custom_content_editor_checkbox" id="meta-checkbox" value="yes" <?php if ( isset ( $amp_content_on_off ) ) checked( $amp_content_on_off, 'yes' ); ?> />
75
- <?php _e( 'Use This Content as AMP Content' )?> </p>
76
  </label>
77
 
78
  <!--HTML content Ends here-->
10
  return $data;
11
  }
12
 
13
+ global $post;
14
  $amp_custom_post_content_input = get_post_meta($post->ID, 'ampforwp_custom_content_editor', true);
15
  $amp_custom_post_content_check = get_post_meta($post->ID, 'ampforwp_custom_content_editor_checkbox', true);
16
 
73
  <label for="meta-checkbox">
74
  <p>
75
  <input type="checkbox" name="ampforwp_custom_content_editor_checkbox" id="meta-checkbox" value="yes" <?php if ( isset ( $amp_content_on_off ) ) checked( $amp_content_on_off, 'yes' ); ?> />
76
+ <?php _e( 'Use This Content as AMP Content' )?> </p><p>If you want to add some special tags, then please use normal HTML into this area, it will automatically convert them into AMP compatible tags.</p>
77
  </label>
78
 
79
  <!--HTML content Ends here-->
templates/design-manager/design-1/elements/related-posts.php CHANGED
@@ -68,7 +68,7 @@
68
  $content = get_the_content();
69
  }
70
  ?>
71
- <p><?php echo wp_trim_words( $content , '15' ); ?></p>
72
  </div>
73
  </li>
74
  <?php
68
  $content = get_the_content();
69
  }
70
  ?>
71
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
72
  </div>
73
  </li>
74
  <?php
templates/design-manager/design-1/header-bar.php CHANGED
@@ -8,7 +8,7 @@
8
  <?php
9
  }else{
10
  ?>
11
- <?php global $redux_builder_amp; if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
12
  <a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ) . AMP_QUERY_VAR; ?>">
13
 
14
  <?php } else { ?>
@@ -19,7 +19,15 @@
19
  }?>
20
 
21
  <?php if (true == ($redux_builder_amp['opt-media']['url'])) { ?>
22
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt="logo" class="amp-logo"></amp-img>
 
 
 
 
 
 
 
 
23
  <?php } else {
24
  echo esc_html( $this->get( 'blog_name' ) );
25
  } ?>
@@ -31,7 +39,7 @@
31
  <a href="<?php echo esc_url( $this->get( 'home_url' ) ); ?>">
32
  <?php }else{ ?>
33
 
34
- <?php global $redux_builder_amp; if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
35
 
36
  <a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ) . AMP_QUERY_VAR; ?>">
37
 
8
  <?php
9
  }else{
10
  ?>
11
+ <?php if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
12
  <a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ) . AMP_QUERY_VAR; ?>">
13
 
14
  <?php } else { ?>
19
  }?>
20
 
21
  <?php if (true == ($redux_builder_amp['opt-media']['url'])) { ?>
22
+ <?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
23
+
24
+ <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="logo" class="amp-logo"></amp-img>
25
+
26
+ <?php } else { ?>
27
+
28
+ <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt="logo" class="amp-logo"></amp-img>
29
+
30
+ <?php } ?>
31
  <?php } else {
32
  echo esc_html( $this->get( 'blog_name' ) );
33
  } ?>
39
  <a href="<?php echo esc_url( $this->get( 'home_url' ) ); ?>">
40
  <?php }else{ ?>
41
 
42
+ <?php if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
43
 
44
  <a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ) . AMP_QUERY_VAR; ?>">
45
 
templates/design-manager/design-1/style.php CHANGED
@@ -758,6 +758,78 @@ amp-carousel > amp-img > img {
758
  }
759
  <?php } ?>
760
 
761
- /* Custom Style Code */
762
- <?php echo $redux_builder_amp['css_editor'];
763
- } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
758
  }
759
  <?php } ?>
760
 
761
+ <?php
762
+ // Table press support
763
+ if ( class_exists('TablePress') ) { ?>
764
+
765
+ /* Table description */
766
+ .tablepress-table-description {
767
+ clear: both;
768
+ display: block;
769
+ }
770
+
771
+ .tablepress {
772
+ border-collapse: collapse;
773
+ border-spacing: 0;
774
+ width: 100%;
775
+ margin-bottom: 1em;
776
+ border: none;
777
+ }
778
+
779
+ .tablepress th,
780
+ .tablepress td {
781
+ padding: 8px;
782
+ border: none;
783
+ background: none;
784
+ text-align: left;
785
+ }
786
+ .tablepress tbody td {
787
+ vertical-align: top;
788
+ }
789
+
790
+ /* Horizontal borders */
791
+ .tablepress tbody td,
792
+ .tablepress tfoot th {
793
+ border-top: 1px solid #dddddd;
794
+ }
795
+ .tablepress tbody tr:first-child td {
796
+ border-top: 0;
797
+ }
798
+ .tablepress thead th {
799
+ border-bottom: 1px solid #dddddd;
800
+ }
801
+
802
+ /* Row background colors */
803
+ .tablepress thead th,
804
+ .tablepress tfoot th {
805
+ background-color: #d9edf7;
806
+ font-weight: bold;
807
+ vertical-align: middle;
808
+ }
809
+ .tablepress .odd td {
810
+ background-color: #f9f9f9;
811
+ }
812
+ .tablepress .even td {
813
+ background-color: #ffffff;
814
+ }
815
+ .tablepress .row-hover tr:hover td {
816
+ background-color: #f3f3f3;
817
+ }
818
+
819
+ @media (min-width: 768px) and (max-width: 1600px) {
820
+ .tablepress{
821
+ overflow-x: none;
822
+ }
823
+ }
824
+ @media (min-width: 320px) and (max-width: 767px) {
825
+ .tablepress{
826
+ display: inline-block;
827
+ overflow-x: scroll;
828
+ }
829
+ }
830
+
831
+ <?php } ?>
832
+
833
+ /* Custom Style Code */
834
+ <?php echo $redux_builder_amp['css_editor'];
835
+ } ?>
templates/design-manager/design-2/elements/featured-image.php CHANGED
@@ -1,15 +1,20 @@
1
- <div class="amp-wp-article-featured-image amp-wp-content featured-image-content">
2
- <?php global $redux_builder_amp; ?>
3
- <?php
4
- if ( has_post_thumbnail() ) {
5
- $thumb_id = get_post_thumbnail_id();
6
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'large', true);
7
- $thumb_url = $thumb_url_array[0];
8
- ?>
9
- <div class="post-featured-img">
10
- <amp-img src=<?php echo $thumb_url ?>
11
- width=<?php global $redux_builder_amp; echo $redux_builder_amp['enable-single-featured-img-width'] ?>
12
- height=<?php echo $redux_builder_amp['enable-single-featured-img-height']?> layout=responsive></amp-img>
13
- </div>
14
- <?php } ?>
15
- </div>
 
 
 
 
 
1
+ <?php
2
+ $featured_image = $this->get( 'featured_image' );
3
+
4
+ if ( empty( $featured_image ) ) {
5
+ return;
6
+ }
7
+
8
+ $amp_html = $featured_image['amp_html'];
9
+ $caption = $featured_image['caption'];
10
+ ?><div class="amp-wp-article-featured-image amp-wp-content featured-image-content">
11
+
12
+ <figure class="amp-wp-article-featured-image wp-caption">
13
+ <?php echo $amp_html; // amphtml content; no kses ?>
14
+ <?php if ( $caption ) : ?>
15
+ <p class="wp-caption-text">
16
+ <?php echo wp_kses_data( $caption ); ?>
17
+ </p>
18
+ <?php endif; ?>
19
+ </figure>
20
+ </div>
templates/design-manager/design-2/elements/related-posts.php CHANGED
@@ -69,7 +69,7 @@
69
  $content = get_the_content();
70
  }
71
  ?>
72
- <p><?php echo wp_trim_words( $content , '15' ); ?></p>
73
  </div>
74
  </li>
75
  <?php
69
  $content = get_the_content();
70
  }
71
  ?>
72
+ <p><?php echo wp_trim_words( strip_shortcodes($content) , '15' ); ?></p>
73
  </div>
74
  </li>
75
  <?php
templates/design-manager/design-2/header-bar.php CHANGED
@@ -16,7 +16,17 @@
16
 
17
  <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) { ?>
18
  <a href="<?php echo esc_url( $ampforwp_home_url ); ?>">
19
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt="logo" class="amp-logo"></amp-img>
 
 
 
 
 
 
 
 
 
 
20
  </a>
21
  <?php } else { ?>
22
  <h3><a href="<?php echo esc_url( $ampforwp_home_url ); ?>"><?php bloginfo('name'); ?></a></h3>
16
 
17
  <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) { ?>
18
  <a href="<?php echo esc_url( $ampforwp_home_url ); ?>">
19
+
20
+ <?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
21
+
22
+ <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="logo" class="amp-logo"></amp-img>
23
+
24
+ <?php } else { ?>
25
+
26
+ <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt="logo" class="amp-logo"></amp-img>
27
+
28
+ <?php } ?>
29
+
30
  </a>
31
  <?php } else { ?>
32
  <h3><a href="<?php echo esc_url( $ampforwp_home_url ); ?>"><?php bloginfo('name'); ?></a></h3>
templates/design-manager/design-2/style.php CHANGED
@@ -827,6 +827,77 @@ amp-user-notification button {
827
  }
828
  <?php } ?>
829
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
830
  /* Custom Style Code */
831
  <?php echo $redux_builder_amp['css_editor'];
832
  } ?>
827
  }
828
  <?php } ?>
829
 
830
+ <?php
831
+ // Table press support
832
+ if ( class_exists('TablePress') ) { ?>
833
+ /* Table description */
834
+ .tablepress-table-description {
835
+ clear: both;
836
+ display: block;
837
+ }
838
+
839
+ .tablepress {
840
+ border-collapse: collapse;
841
+ border-spacing: 0;
842
+ width: 100%;
843
+ margin-bottom: 1em;
844
+ border: none;
845
+ }
846
+
847
+ .tablepress th,
848
+ .tablepress td {
849
+ padding: 8px;
850
+ border: none;
851
+ background: none;
852
+ text-align: left;
853
+ }
854
+ .tablepress tbody td {
855
+ vertical-align: top;
856
+ }
857
+
858
+ /* Horizontal borders */
859
+ .tablepress tbody td,
860
+ .tablepress tfoot th {
861
+ border-top: 1px solid #dddddd;
862
+ }
863
+ .tablepress tbody tr:first-child td {
864
+ border-top: 0;
865
+ }
866
+ .tablepress thead th {
867
+ border-bottom: 1px solid #dddddd;
868
+ }
869
+
870
+ /* Row background colors */
871
+ .tablepress thead th,
872
+ .tablepress tfoot th {
873
+ background-color: #d9edf7;
874
+ font-weight: bold;
875
+ vertical-align: middle;
876
+ }
877
+ .tablepress .odd td {
878
+ background-color: #f9f9f9;
879
+ }
880
+ .tablepress .even td {
881
+ background-color: #ffffff;
882
+ }
883
+ .tablepress .row-hover tr:hover td {
884
+ background-color: #f3f3f3;
885
+ }
886
+
887
+ @media (min-width: 768px) and (max-width: 1600px) {
888
+ .tablepress{
889
+ overflow-x: none;
890
+ }
891
+ }
892
+ @media (min-width: 320px) and (max-width: 767px) {
893
+ .tablepress{
894
+ display: inline-block;
895
+ overflow-x: scroll;
896
+ }
897
+ }
898
+
899
+ <?php } ?>
900
+
901
  /* Custom Style Code */
902
  <?php echo $redux_builder_amp['css_editor'];
903
  } ?>
templates/design-manager/design-3/archive.php CHANGED
@@ -45,7 +45,6 @@ if ( get_query_var( 'paged' ) ) {
45
  $q = new WP_Query( array(
46
  'post_type' => 'post',
47
  'orderby' => 'date',
48
- 'offset' => esc_attr($fn_offset),
49
  'ignore_sticky_posts' => 1,
50
  'paged' => esc_attr($paged),
51
  'post__not_in' => $exclude_ids,
45
  $q = new WP_Query( array(
46
  'post_type' => 'post',
47
  'orderby' => 'date',
 
48
  'ignore_sticky_posts' => 1,
49
  'paged' => esc_attr($paged),
50
  'post__not_in' => $exclude_ids,
templates/design-manager/design-3/elements/content.php CHANGED
@@ -31,7 +31,7 @@
31
  <div id="pagination">
32
  <?php $next_post = get_next_post();
33
  if (!empty( $next_post )) { ?>
34
- <span>Next Read:</span> <a href="<?php echo trailingslashit(get_permalink( $next_post->ID )) . AMP_QUERY_VAR; ?>"><?php echo $next_post->post_title; ?> &raquo;</a> <?php
35
  } ?>
36
  </div>
37
  </div>
31
  <div id="pagination">
32
  <?php $next_post = get_next_post();
33
  if (!empty( $next_post )) { ?>
34
+ <span><?php global $redux_builder_amp; echo $redux_builder_amp['amp-translator-next-read-text']; ?></span> <a href="<?php echo trailingslashit(get_permalink( $next_post->ID )) . AMP_QUERY_VAR; ?>"><?php echo $next_post->post_title; ?> &raquo;</a> <?php
35
  } ?>
36
  </div>
37
  </div>
templates/design-manager/design-3/elements/featured-image.php CHANGED
@@ -1,15 +1,19 @@
1
  <div class="amp-wp-article-featured-image amp-wp-content featured-image-content">
2
- <?php global $redux_builder_amp; ?>
3
- <?php
4
- if ( has_post_thumbnail() ) {
5
- $thumb_id = get_post_thumbnail_id();
6
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'large', true);
7
- $thumb_url = $thumb_url_array[0];
8
- ?>
9
- <div class="post-featured-img">
10
- <amp-img src=<?php echo $thumb_url ?>
11
- width=<?php global $redux_builder_amp; echo $redux_builder_amp['enable-single-featured-img-width'] ?>
12
- height=<?php echo $redux_builder_amp['enable-single-featured-img-height']?> layout=responsive></amp-img>
13
- </div>
14
- <?php } ?>
15
- </div>
 
 
 
 
1
  <div class="amp-wp-article-featured-image amp-wp-content featured-image-content">
2
+ <?php
3
+ $featured_image = $this->get( 'featured_image' );
4
+ if ( empty( $featured_image ) ) {
5
+ return;
6
+ }
7
+
8
+ $amp_html = $featured_image['amp_html'];
9
+ $caption = $featured_image['caption'];
10
+ ?><div class="post-featured-img">
11
+ <figure class="amp-wp-article-featured-image wp-caption">
12
+ <?php echo $amp_html; // amphtml content; no kses ?>
13
+ <?php if ( $caption ) : ?>
14
+ <p class="wp-caption-text">
15
+ <?php echo wp_kses_data( $caption ); ?>
16
+ </p>
17
+ <?php endif; ?>
18
+ </figure>
19
+ </div></div>
templates/design-manager/design-3/elements/meta-taxonomy.php CHANGED
@@ -13,6 +13,8 @@
13
  </div>
14
  <?php endif;?>
15
  </div>
 
 
16
  <div class="amp-wp-content amp_author_area ampforwp-meta-taxonomy">
17
  <div class="amp-wp-content amp_author_area_wrapper">
18
  <?php $post_author = $this->get( 'post_author' );
@@ -24,6 +26,8 @@
24
  <?php
25
  } ?>
26
  <strong><?php echo esc_html( $post_author->display_name ); ?></strong>: <?php echo esc_html( $post_author->description ); ?>
 
27
  <?php } ?>
28
  </div>
29
- </div>
 
13
  </div>
14
  <?php endif;?>
15
  </div>
16
+
17
+ <?php global $redux_builder_amp; if( $redux_builder_amp['amp-design-3-author-description'] ) { ?>
18
  <div class="amp-wp-content amp_author_area ampforwp-meta-taxonomy">
19
  <div class="amp-wp-content amp_author_area_wrapper">
20
  <?php $post_author = $this->get( 'post_author' );
26
  <?php
27
  } ?>
28
  <strong><?php echo esc_html( $post_author->display_name ); ?></strong>: <?php echo esc_html( $post_author->description ); ?>
29
+
30
  <?php } ?>
31
  </div>
32
+ </div>
33
+ <?php } ?>
templates/design-manager/design-3/elements/related-posts.php CHANGED
@@ -69,7 +69,7 @@
69
  $content = get_the_content();
70
  }
71
  ?>
72
- <p><?php echo wp_trim_words( $content , '15' ); ?></p>
73
  </div>
74
  </li>
75
  <?php
69
  $content = get_the_content();
70
  }
71
  ?>
72
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
73
  </div>
74
  </li>
75
  <?php
templates/design-manager/design-3/footer.php CHANGED
@@ -97,7 +97,7 @@
97
  </p>
98
  <?php global $redux_builder_amp; if( $redux_builder_amp['amp-design-3-credit-link'] ) { ?>
99
  <p class="poweredby">
100
- <a href="https://ampforwp.com">Powered by AMPforWP</a>
101
  <p>
102
  <?php } ?>
103
  </div>
97
  </p>
98
  <?php global $redux_builder_amp; if( $redux_builder_amp['amp-design-3-credit-link'] ) { ?>
99
  <p class="poweredby">
100
+ <a href="https://ampforwp.com" rel="nofollow">Powered by AMPforWP</a>
101
  <p>
102
  <?php } ?>
103
  </div>
templates/design-manager/design-3/header-bar.php CHANGED
@@ -98,7 +98,17 @@
98
  ?>
99
  <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) { ?>
100
  <a href="<?php echo esc_url( $ampforwp_home_url ); ?>">
101
- <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt="logo" class="amp-logo"></amp-img>
 
 
 
 
 
 
 
 
 
 
102
  </a>
103
  <?php } else { ?>
104
  <h1><a href="<?php echo esc_url( $ampforwp_home_url ); ?>"><?php bloginfo('name'); ?></a></h1>
98
  ?>
99
  <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) { ?>
100
  <a href="<?php echo esc_url( $ampforwp_home_url ); ?>">
101
+
102
+ <?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
103
+
104
+ <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="logo" class="amp-logo"></amp-img>
105
+
106
+ <?php } else { ?>
107
+
108
+ <amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt="logo" class="amp-logo"></amp-img>
109
+
110
+ <?php } ?>
111
+
112
  </a>
113
  <?php } else { ?>
114
  <h1><a href="<?php echo esc_url( $ampforwp_home_url ); ?>"><?php bloginfo('name'); ?></a></h1>
templates/design-manager/design-3/index.php CHANGED
@@ -5,7 +5,6 @@
5
  <meta charset="utf-8">
6
  <link rel="dns-prefetch" href="https://cdn.ampproject.org">
7
  <?php
8
- global $redux_builder_amp;
9
  if ( is_home() || is_front_page() || ( is_archive() && $redux_builder_amp['ampforwp-archive-support'] ) ){
10
  global $wp;
11
  $current_archive_url = home_url( $wp->request );
@@ -78,7 +77,7 @@ if ( get_query_var( 'paged' ) ) {
78
  <?php } ?>
79
  <a href="<?php the_permalink(); ?>/amp">
80
  <div class="featured_title">
81
- <div class="featured_time"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></div>
82
  <h1><?php the_title() ?></h1>
83
  </div>
84
  </a>
@@ -97,7 +96,6 @@ if ( get_query_var( 'paged' ) ) {
97
  $q = new WP_Query( array(
98
  'post_type' => 'post',
99
  'orderby' => 'date',
100
- 'offset' => esc_attr($fn_offset),
101
  'paged' => esc_attr($paged),
102
  'post__not_in' => $exclude_ids,
103
  'has_password' => false,
@@ -139,7 +137,7 @@ if ( get_query_var( 'paged' ) ) {
139
  }
140
  ?>
141
  <p><?php echo wp_trim_words( $content , '15' ); ?></p>
142
- <div class="featured_time"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></div>
143
 
144
  </div>
145
  <div class="cb"></div>
5
  <meta charset="utf-8">
6
  <link rel="dns-prefetch" href="https://cdn.ampproject.org">
7
  <?php
 
8
  if ( is_home() || is_front_page() || ( is_archive() && $redux_builder_amp['ampforwp-archive-support'] ) ){
9
  global $wp;
10
  $current_archive_url = home_url( $wp->request );
77
  <?php } ?>
78
  <a href="<?php the_permalink(); ?>/amp">
79
  <div class="featured_title">
80
+ <div class="featured_time"><?php global $redux_builder_amp; echo human_time_diff( get_the_time('U'), current_time('timestamp') ) .' '. $redux_builder_amp['amp-translator-ago-date-text']; ?></div>
81
  <h1><?php the_title() ?></h1>
82
  </div>
83
  </a>
96
  $q = new WP_Query( array(
97
  'post_type' => 'post',
98
  'orderby' => 'date',
 
99
  'paged' => esc_attr($paged),
100
  'post__not_in' => $exclude_ids,
101
  'has_password' => false,
137
  }
138
  ?>
139
  <p><?php echo wp_trim_words( $content , '15' ); ?></p>
140
+ <div class="featured_time"><?php global $redux_builder_amp ; echo human_time_diff( get_the_time('U'), current_time('timestamp') ) .' '. $redux_builder_amp['amp-translator-ago-date-text']; ?></div>
141
 
142
  </div>
143
  <div class="cb"></div>
templates/design-manager/design-3/search.php CHANGED
@@ -84,7 +84,7 @@
84
  }
85
  ?>
86
  <p><?php echo wp_trim_words( $content , '15' ); ?></p>
87
- <div class="featured_time"><?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></div>
88
 
89
  </div>
90
  <div class="cb"></div>
84
  }
85
  ?>
86
  <p><?php echo wp_trim_words( $content , '15' ); ?></p>
87
+ <div class="featured_time"><?php global $redux_builder_amp; echo human_time_diff( get_the_time('U'), current_time('timestamp') ) .' '. $redux_builder_amp['amp-translator-ago-date-text']; ?></div>
88
 
89
  </div>
90
  <div class="cb"></div>
templates/design-manager/design-3/style.php CHANGED
@@ -1322,6 +1322,77 @@ amp-user-notification button {
1322
  }
1323
  <?php } ?>
1324
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1325
  /* Custom Style Code */
1326
  <?php echo $redux_builder_amp['css_editor'];
1327
  } ?>
1322
  }
1323
  <?php } ?>
1324
 
1325
+ <?php
1326
+ // Table press support
1327
+ if ( class_exists('TablePress') ) { ?>
1328
+ /* Table description */
1329
+ .tablepress-table-description {
1330
+ clear: both;
1331
+ display: block;
1332
+ }
1333
+
1334
+ .tablepress {
1335
+ border-collapse: collapse;
1336
+ border-spacing: 0;
1337
+ width: 100%;
1338
+ margin-bottom: 1em;
1339
+ border: none;
1340
+ }
1341
+
1342
+ .tablepress th,
1343
+ .tablepress td {
1344
+ padding: 8px;
1345
+ border: none;
1346
+ background: none;
1347
+ text-align: left;
1348
+ }
1349
+ .tablepress tbody td {
1350
+ vertical-align: top;
1351
+ }
1352
+
1353
+ /* Horizontal borders */
1354
+ .tablepress tbody td,
1355
+ .tablepress tfoot th {
1356
+ border-top: 1px solid #dddddd;
1357
+ }
1358
+ .tablepress tbody tr:first-child td {
1359
+ border-top: 0;
1360
+ }
1361
+ .tablepress thead th {
1362
+ border-bottom: 1px solid #dddddd;
1363
+ }
1364
+
1365
+ /* Row background colors */
1366
+ .tablepress thead th,
1367
+ .tablepress tfoot th {
1368
+ background-color: #d9edf7;
1369
+ font-weight: bold;
1370
+ vertical-align: middle;
1371
+ }
1372
+ .tablepress .odd td {
1373
+ background-color: #f9f9f9;
1374
+ }
1375
+ .tablepress .even td {
1376
+ background-color: #ffffff;
1377
+ }
1378
+ .tablepress .row-hover tr:hover td {
1379
+ background-color: #f3f3f3;
1380
+ }
1381
+
1382
+ @media (min-width: 768px) and (max-width: 1600px) {
1383
+ .tablepress{
1384
+ overflow-x: none;
1385
+ }
1386
+ }
1387
+ @media (min-width: 320px) and (max-width: 767px) {
1388
+ .tablepress{
1389
+ display: inline-block;
1390
+ overflow-x: scroll;
1391
+ }
1392
+ }
1393
+
1394
+ <?php } ?>
1395
+
1396
  /* Custom Style Code */
1397
  <?php echo $redux_builder_amp['css_editor'];
1398
  } ?>
templates/features.php CHANGED
@@ -276,24 +276,25 @@
276
  function ampforwp_register_additional_scripts() {
277
  global $redux_builder_amp;
278
  if( is_page() ) { ?>
279
- <script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
280
  <?php } ?>
281
- <script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>
282
  <?php if($redux_builder_amp['amp-enable-notifications'] == true) { ?>
283
- <script async custom-element="amp-user-notification" src="https://cdn.ampproject.org/v0/amp-user-notification-0.1.js"></script>
284
  <?php } ?>
285
  <?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) { ?>
286
  <?php if( is_singular() ) { ?>
287
- <script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
288
  <?php }
289
  } ?>
290
  <?php if($redux_builder_amp['amp-frontpage-select-option'] == 1) { ?>
291
- <?php if( is_home() ) { ?>
292
- <script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
293
- <?php }
294
  } ?>
295
- <script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script><?php
296
- }
 
297
  // 6.1 Adding Analytics Scripts
298
  add_action('amp_post_template_head','ampforwp_register_analytics_script', 20);
299
  function ampforwp_register_analytics_script(){ ?>
@@ -917,6 +918,12 @@ function ampforwp_remove_schema_data() {
917
  remove_filter('the_content','sfsi_plus_beforaftereposts');
918
  remove_filter('the_content','sfsi_plus_beforeafterblogposts');
919
 
 
 
 
 
 
 
920
  }
921
 
922
  // 22. Removing author links from comments Issue #180
@@ -979,15 +986,10 @@ function ampforwp_sticky_social_icons(){
979
  // if ( $ampforwp_social_icons_enabled == true ) {
980
  //
981
  // }
982
-
983
  // add_action('amp_post_template_head','ampforwp_register_social_sharing_script');
984
-
985
- function ampforwp_register_social_sharing_script() {
986
-
987
-
988
- ?>
989
- <script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script> <?php
990
- }
991
 
992
  // 25. Yoast meta Support
993
  function ampforwp_custom_yoast_meta(){
@@ -1011,7 +1013,63 @@ function ampforwp_custom_yoast_meta(){
1011
  }
1012
  }
1013
 
1014
- add_action( 'amp_post_template_head', 'ampforwp_custom_yoast_meta' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1015
 
1016
 
1017
  //26. Extending Title Tagand De-Hooking the Standard one from AMP
@@ -1188,7 +1246,7 @@ function ampforwp_add_disqus_support() {
1188
 
1189
  global $post; $post_slug=$post->post_name;
1190
 
1191
- $disqus_script_host_url = "https://ampforwp.com/goto/". AMPFORWP_DISQUS_URL;
1192
 
1193
  if( $redux_builder_amp['ampforwp-disqus-host-position'] == 0 ) {
1194
  $disqus_script_host_url = esc_url( $redux_builder_amp['ampforwp-disqus-host-file'] );
@@ -1212,8 +1270,11 @@ function ampforwp_add_disqus_support() {
1212
 
1213
  add_filter( 'amp_post_template_data', 'ampforwp_add_disqus_scripts' );
1214
  function ampforwp_add_disqus_scripts( $data ) {
1215
- if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
1216
- $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
 
 
 
1217
  }
1218
  return $data;
1219
  }
@@ -1303,3 +1364,47 @@ function ampforwp_header_html_output() {
1303
  echo $redux_builder_amp['amp-header-text-area-for-html'] ;
1304
  }
1305
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
  function ampforwp_register_additional_scripts() {
277
  global $redux_builder_amp;
278
  if( is_page() ) { ?>
279
+ <script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
280
  <?php } ?>
281
+ <script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>
282
  <?php if($redux_builder_amp['amp-enable-notifications'] == true) { ?>
283
+ <script async custom-element="amp-user-notification" src="https://cdn.ampproject.org/v0/amp-user-notification-0.1.js"></script>
284
  <?php } ?>
285
  <?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) { ?>
286
  <?php if( is_singular() ) { ?>
287
+ <script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
288
  <?php }
289
  } ?>
290
  <?php if($redux_builder_amp['amp-frontpage-select-option'] == 1) { ?>
291
+ <?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) { if( is_home() ) { ?>
292
+ <script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
293
+ <?php } }
294
  } ?>
295
+ <?php if( $redux_builder_amp['enable-amp-ads-1'] == true || $redux_builder_amp['enable-amp-ads-2'] == true || $redux_builder_amp['enable-amp-ads-3'] == true || $redux_builder_amp['enable-amp-ads-4'] == true ) { ?>
296
+ <script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
297
+ <?php } else { } }
298
  // 6.1 Adding Analytics Scripts
299
  add_action('amp_post_template_head','ampforwp_register_analytics_script', 20);
300
  function ampforwp_register_analytics_script(){ ?>
918
  remove_filter('the_content','sfsi_plus_beforaftereposts');
919
  remove_filter('the_content','sfsi_plus_beforeafterblogposts');
920
 
921
+ // Thrive Content Builder
922
+ $amp_custom_content_enable = get_post_meta( get_the_ID() , 'ampforwp_custom_content_editor_checkbox', true);
923
+ if ($amp_custom_content_enable == 'yes') {
924
+ remove_filter( 'the_content', 'tve_editor_content', 10 );
925
+ }
926
+
927
  }
928
 
929
  // 22. Removing author links from comments Issue #180
986
  // if ( $ampforwp_social_icons_enabled == true ) {
987
  //
988
  // }
 
989
  // add_action('amp_post_template_head','ampforwp_register_social_sharing_script');
990
+ function ampforwp_register_social_sharing_script() { ?>
991
+ <script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
992
+ <?php }
 
 
 
 
993
 
994
  // 25. Yoast meta Support
995
  function ampforwp_custom_yoast_meta(){
1013
  }
1014
  }
1015
 
1016
+ function ampforwp_custom_yoast_meta_homepage(){
1017
+ global $redux_builder_amp;
1018
+ if ($redux_builder_amp['ampforwp-seo-yoast-meta']) {
1019
+ if(! class_exists('YoastSEO_AMP') ) {
1020
+ if ( class_exists('WPSEO_Options')) {
1021
+ $options = WPSEO_Options::get_option( 'wpseo_social' );
1022
+ if ( $options['twitter'] === true ) {
1023
+ WPSEO_Twitter::get_instance();
1024
+ }
1025
+ if ( $options['opengraph'] === true ) {
1026
+ $GLOBALS['wpseo_og'] = new WPSEO_OpenGraph;
1027
+ }
1028
+ }
1029
+ do_action( 'wpseo_opengraph' );
1030
+
1031
+ }//execute only if Glue is deactive
1032
+ echo strip_tags($redux_builder_amp['ampforwp-seo-custom-additional-meta'], '<link><meta>' );
1033
+ }
1034
+ }
1035
+
1036
+ function ampforwp_add_proper_post_meta(){
1037
+ $check_custom_front_page = get_option('show_on_front');
1038
+ if ( $check_custom_front_page == 'page' ) {
1039
+ add_action( 'amp_post_template_head', 'ampforwp_custom_yoast_meta_homepage' );
1040
+
1041
+ add_filter('wpseo_opengraph_title', 'custom_twitter_title_homepage');
1042
+ add_filter('wpseo_twitter_title', 'custom_twitter_title_homepage');
1043
+
1044
+ add_filter('wpseo_opengraph_desc', 'custom_twitter_description_homepage');
1045
+ add_filter('wpseo_twitter_description', 'custom_twitter_description_homepage');
1046
+
1047
+ add_filter('wpseo_opengraph_url', 'custom_og_url_homepage');
1048
+
1049
+ add_filter('wpseo_twitter_image', 'custom_og_image_homepage');
1050
+ add_filter('wpseo_opengraph_image', 'custom_og_image_homepage');
1051
+ } else {
1052
+ add_action( 'amp_post_template_head', 'ampforwp_custom_yoast_meta' );
1053
+ }
1054
+ }
1055
+ add_action('pre_amp_render_post','ampforwp_add_proper_post_meta');
1056
+
1057
+
1058
+ function custom_twitter_title_homepage() {
1059
+ return esc_attr( get_bloginfo( 'name' ) );
1060
+ }
1061
+ function custom_twitter_description_homepage() {
1062
+ return esc_attr( get_bloginfo( 'description' ) );
1063
+ }
1064
+ function custom_og_url_homepage() {
1065
+ return esc_url( get_bloginfo( 'url' ) );
1066
+ }
1067
+ function custom_og_image_homepage() {
1068
+ if ( class_exists('WPSEO_Options') ) {
1069
+ $options = WPSEO_Options::get_option( 'wpseo_social' );
1070
+ return $options['og_default_image'] ;
1071
+ }
1072
+ }
1073
 
1074
 
1075
  //26. Extending Title Tagand De-Hooking the Standard one from AMP
1246
 
1247
  global $post; $post_slug=$post->post_name;
1248
 
1249
+ $disqus_script_host_url = "https://ampforwp.appspot.com/?api=". AMPFORWP_DISQUS_URL;
1250
 
1251
  if( $redux_builder_amp['ampforwp-disqus-host-position'] == 0 ) {
1252
  $disqus_script_host_url = esc_url( $redux_builder_amp['ampforwp-disqus-host-file'] );
1270
 
1271
  add_filter( 'amp_post_template_data', 'ampforwp_add_disqus_scripts' );
1272
  function ampforwp_add_disqus_scripts( $data ) {
1273
+ global $redux_builder_amp;
1274
+ if ( $redux_builder_amp['ampforwp-disqus-comments-support'] ) {
1275
+ if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
1276
+ $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
1277
+ }
1278
  }
1279
  return $data;
1280
  }
1364
  echo $redux_builder_amp['amp-header-text-area-for-html'] ;
1365
  }
1366
  }
1367
+
1368
+
1369
+ //34. meta robots
1370
+ add_action('amp_post_template_head' , 'ampforwp_talking_to_robots');
1371
+ function ampforwp_talking_to_robots() {
1372
+
1373
+ global $redux_builder_amp;
1374
+ $message_to_robots = '<meta name="robots" content="noindex,follow"/>';
1375
+ $talk_to_robots=false;
1376
+
1377
+ //author arhives index/noindex
1378
+ if( is_author() && !$redux_builder_amp['ampforwp-robots-archive-author-pages'] ) {
1379
+ $talk_to_robots = true;
1380
+ }
1381
+
1382
+ //date ke archives index/noindex
1383
+ if( is_date() && !$redux_builder_amp['ampforwp-robots-archive-date-pages'] ) {
1384
+ $talk_to_robots = true;
1385
+ }
1386
+
1387
+ //category and tag index/noindex
1388
+ if( ( is_tag() || is_category() ) && !$redux_builder_amp['ampforwp-robots-archive-taxonomy-pages'] ) {
1389
+ $talk_to_robots = true;
1390
+ }
1391
+
1392
+ if( is_archive() || is_home ) {
1393
+ if ( get_query_var( 'paged' ) ) {
1394
+ $paged = get_query_var('paged');
1395
+ } elseif ( get_query_var( 'page' ) ) {
1396
+ $paged = get_query_var('page');
1397
+ } else {
1398
+ $paged = 1;
1399
+ }
1400
+ //sitewide archives sub pages index/noindex ie page 2 onwards
1401
+ if( $paged >= 2 && !$redux_builder_amp['ampforwp-robots-archive-sub-pages-sitewide'] ) {
1402
+ $talk_to_robots = true;
1403
+ }
1404
+ }
1405
+
1406
+ if( $talk_to_robots ) {
1407
+ echo $message_to_robots;
1408
+ }
1409
+
1410
+ }