AMP for WP – Accelerated Mobile Pages - Version 0.9.45

Version Description

(18 March 2017) = * View more details at https://ampforwp.com/0-9-45-released-compatibility-rtl-53rd-update/ * W3Total cache compatibility added * RTL Support added for Right-to-Left language websites. * Comments Pagination feature added * WP-Rocket Compatibility added * WPML Compatibility added * Quantcast analytics support added * ComScore support added * Custom Yoast title support added #685 * WooCommerce Shortcode: Allows you to display WooCommerce Products. [amp-woocommerce num=6] will display the 6 products from WooCommerce. [amp-woocommerce num=6 link=noamp] will display 6 products but they will go to non-amp website, if you want to link to AMP version of the page then use [amp-woocommerce num=6 link=amp] * Admin area UX improvements * Adding notifications script in the correct way * Comments now display on frontpage as well. * Re-positioned non-amp Header link control to the right section. * ?nonamp=1 only displays when the Mobile redirection is on * Properly adding iFrame js. * Custom Post type incompatibility fixed * Widgets added to the Custom Frontpage. * Stripping shortcodes from excerpts. * Custom content on static frontpage had over riding issue #687 * Option added for controlling number of comments * Welcome page should be shown only if user is administrator #696 * Digg Digg social share compatibility #694 * Removed unnecessary lines from Design 3 * Sanitized Archive Description to amp Compatible #659 * Author box now displays HTML properly #645 * Date added Design-3 in meta #583 * Options link was removed from wp-admin tool bar after a feedback from a user. * Footer sub menus layout compatibility.

Download this release

Release Info

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

Code changes from version 0.9.44 to 0.9.45

Files changed (30) hide show
  1. accelerated-moblie-pages.php +12 -5
  2. includes/options/admin-config.php +65 -22
  3. includes/options/redux-core/assets/css/redux-admin.css +2 -2
  4. readme.txt +36 -2
  5. templates/custom-amp-content.php +2 -2
  6. templates/design-manager/design-1/archive.php +7 -2
  7. templates/design-manager/design-1/elements/comments.php +13 -7
  8. templates/design-manager/design-1/elements/simple-comment-button.php +4 -1
  9. templates/design-manager/design-1/frontpage.php +123 -1
  10. templates/design-manager/design-1/header-bar.php +20 -18
  11. templates/design-manager/design-1/search.php +3 -3
  12. templates/design-manager/design-1/style.php +25 -3
  13. templates/design-manager/design-2/archive.php +7 -2
  14. templates/design-manager/design-2/elements/comments.php +14 -7
  15. templates/design-manager/design-2/elements/simple-comment-button.php +4 -1
  16. templates/design-manager/design-2/frontpage.php +126 -2
  17. templates/design-manager/design-2/header-bar.php +20 -11
  18. templates/design-manager/design-2/search.php +2 -2
  19. templates/design-manager/design-2/style.php +27 -110
  20. templates/design-manager/design-3/archive.php +8 -2
  21. templates/design-manager/design-3/elements/comments.php +14 -7
  22. templates/design-manager/design-3/elements/meta-info.php +7 -1
  23. templates/design-manager/design-3/elements/meta-taxonomy.php +2 -2
  24. templates/design-manager/design-3/elements/simple-comment-button.php +5 -1
  25. templates/design-manager/design-3/frontpage.php +123 -0
  26. templates/design-manager/design-3/header-bar.php +21 -11
  27. templates/design-manager/design-3/index.php +1 -1
  28. templates/design-manager/design-3/search.php +3 -3
  29. templates/design-manager/design-3/style.php +122 -74
  30. templates/features.php +246 -18
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.44
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.44');
20
  // any changes to AMP_QUERY_VAR should be refelected here
21
  define('AMPFORWP_AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) );
22
 
@@ -96,7 +96,7 @@ function ampforwp_rewrite_activation() {
96
  // Flushing rewrite urls ONLY on activation
97
  global $wp_rewrite;
98
  $wp_rewrite->flush_rules();
99
-
100
  // Set transient for Welcome page
101
  set_transient( 'ampforwp_welcome_screen_activation_redirect', true, 30 );
102
 
@@ -111,7 +111,7 @@ function ampforwp_rewrite_deactivate() {
111
  // Remove transient for Welcome page
112
  delete_transient( 'ampforwp_welcome_screen_activation_redirect');
113
  }
114
-
115
  add_action( 'admin_init','ampforwp_parent_plugin_check');
116
  function ampforwp_parent_plugin_check() {
117
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
@@ -136,7 +136,14 @@ function ampforwp_parent_plugin_check() {
136
  * Load Files only in the backend
137
  * As we don't need plugin activation code to run everytime the site loads
138
  */
139
- if ( is_admin() ) {
 
 
 
 
 
 
 
140
 
141
  // Include Welcome page only on Admin pages
142
  require AMPFORWP_PLUGIN_DIR .'/includes/welcome.php';
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.45
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.45');
20
  // any changes to AMP_QUERY_VAR should be refelected here
21
  define('AMPFORWP_AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) );
22
 
96
  // Flushing rewrite urls ONLY on activation
97
  global $wp_rewrite;
98
  $wp_rewrite->flush_rules();
99
+
100
  // Set transient for Welcome page
101
  set_transient( 'ampforwp_welcome_screen_activation_redirect', true, 30 );
102
 
111
  // Remove transient for Welcome page
112
  delete_transient( 'ampforwp_welcome_screen_activation_redirect');
113
  }
114
+
115
  add_action( 'admin_init','ampforwp_parent_plugin_check');
116
  function ampforwp_parent_plugin_check() {
117
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
136
  * Load Files only in the backend
137
  * As we don't need plugin activation code to run everytime the site loads
138
  */
139
+ require ABSPATH .'wp-includes/pluggable.php';
140
+ function ampforwp_get_user_role( $user = null ) {
141
+ $user = $user ? new WP_User( $user ) : wp_get_current_user();
142
+ return $user->roles ? $user->roles[0] : false;
143
+ }
144
+ $user_role = ampforwp_get_user_role();
145
+
146
+ if ( $user_role === 'administrator' ) {
147
 
148
  // Include Welcome page only on Admin pages
149
  require AMPFORWP_PLUGIN_DIR .'/includes/welcome.php';
includes/options/admin-config.php CHANGED
@@ -38,7 +38,7 @@ $args = array(
38
  'save_defaults' => true, // On load save the defaults to DB before user clicks save or not
39
  'default_show' => false, // If true, shows the default value next to each field that is not the default value.
40
  'default_mark' => '', // What to print by the field's title if the value shown is default. Suggested: *
41
- 'admin_bar' => true,
42
  'admin_bar_icon' => 'dashicons-admin-generic',
43
  // CAREFUL -> These options are for advanced use only
44
  'output' => false, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output
@@ -96,7 +96,7 @@ Redux::setArgs( "redux_builder_amp", $args );
96
  margin-top: 38px;"><i class="dashicons dashicons-editor-help" style="
97
  font-size: 36px;
98
  margin-right: 20px;
99
- margin-top: -1px;"></i>Need Help?</h1>
100
  <p style="
101
  font-family: georgia;
102
  font-size: 20px;
@@ -106,8 +106,8 @@ Redux::setArgs( "redux_builder_amp", $args );
106
  margin-top: 11px;
107
  color: #666;">Were bunch of passionate people that are dedicated towards helping our users. We will be happy to help you!</p>
108
 
109
-
110
-
111
  ';
112
  }
113
  return $output ;
@@ -315,6 +315,13 @@ Redux::setArgs( "redux_builder_amp", $args );
315
  array('amp-design-selector','=',3),
316
  array('ampforwp-homepage-posts-image-modify-size','=',1)
317
  )
 
 
 
 
 
 
 
318
  )
319
  )
320
  )
@@ -339,7 +346,9 @@ Redux::setArgs( "redux_builder_amp", $args );
339
  'options' => array(
340
  '1' => __('Google Analytics', 'redux-framework-demo' ),
341
  '2' => __('Segment Analytics', 'redux-framework-demo' ),
342
- '3' => __('Piwik Analytics', 'redux-framework-demo' )
 
 
343
  ),
344
  'required' => array(
345
  array('amp-use-gtm-option', '=' , '0'),
@@ -382,6 +391,32 @@ Redux::setArgs( "redux_builder_amp", $args );
382
  'default' => '#',
383
  ),
384
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
385
  array(
386
  'id' => 'amp-use-gtm-option',
387
  'type' => 'switch',
@@ -418,6 +453,7 @@ Redux::setArgs( "redux_builder_amp", $args );
418
  'required' => array(
419
  array('amp-use-gtm-option', '=' , '1')),
420
  ),
 
421
  )
422
  )
423
  );
@@ -442,8 +478,8 @@ Redux::setArgs( "redux_builder_amp", $args );
442
  function ampforwp_get_element_default_color() {
443
  $default_value = get_option('redux_builder_amp', true);
444
  $default_value = $default_value['amp-opt-color-rgba-colorscheme']['color'];
445
- if ( empty( $default_value ) ) {
446
- $default_value = '#333';
447
  }
448
  return $default_value;
449
  }
@@ -514,7 +550,7 @@ Redux::setArgs( "redux_builder_amp", $args );
514
  array('amp-design-selector', '=' , '3')
515
  )
516
  ),
517
-
518
 
519
  array(
520
  'id' => 'amp-design-3-featured-slider',
@@ -589,7 +625,16 @@ Redux::setArgs( "redux_builder_amp", $args );
589
  ),
590
  'default' => '1'
591
  ),
592
-
 
 
 
 
 
 
 
 
 
593
 
594
  array(
595
  'id' => 'css_editor',
@@ -1604,9 +1649,9 @@ Redux::setArgs( "redux_builder_amp", $args );
1604
  //
1605
 
1606
 
1607
- // Disqus Comments
1608
  Redux::setSection( $opt_name, array(
1609
- 'title' => __( 'Disqus Comments', 'redux-framework-demo' ),
1610
  // 'desc' => '<a href="https://github.com/disqus/disqus-install-examples/tree/master/google-amp"> Link to Official Disqus documentation. </a>',
1611
  'id' => 'disqus-comments',
1612
  'subsection' => true,
@@ -1644,6 +1689,14 @@ Redux::setArgs( "redux_builder_amp", $args );
1644
  'placeholder' => 'https://comments.example.com/disqus.php',
1645
  'required' => array('ampforwp-disqus-host-position', '=' , '0'),
1646
  ),
 
 
 
 
 
 
 
 
1647
  )
1648
  ) );
1649
 
@@ -1663,16 +1716,6 @@ Redux::setSection( $opt_name, array(
1663
  'subtitle' => __('Enable/Disable Home page using this switch.', 'redux-framework-demo'),
1664
  'default' => '1'
1665
  ),*/
1666
- array(
1667
- 'id' =>'amp-on-off-support-for-non-amp-home-page',
1668
- 'type' => 'switch',
1669
- 'title' => __('Non-AMP HomePage link in Header and Logo', 'redux-framework-demo'),
1670
- 'subtitle' => __('If you want users in header to go to non-AMP website from the Header, then you can enable this option', 'redux-framework-demo'),
1671
- 'default' => 0,
1672
- 'required' => array(
1673
- array('ampforwp-homepage-on-off-support','=',1)
1674
- )
1675
- ),
1676
  array(
1677
  'id' => 'ampforwp-archive-support',
1678
  'type' => 'switch',
@@ -1713,7 +1756,7 @@ Redux::setSection( $opt_name, array(
1713
  'type' => 'textarea',
1714
  'title' => __('Enter HTML in Header', 'redux-framework-demo'),
1715
  'subtitle' => __('please enter markup that is AMP validated', 'redux-framework-demo'),
1716
- 'desc' => __('check your markup here (enter markup between BODY tag) : https://validator.ampproject.org/', 'redux-framework-demo'),
1717
  'default' => ''
1718
  ),
1719
  array(
38
  'save_defaults' => true, // On load save the defaults to DB before user clicks save or not
39
  'default_show' => false, // If true, shows the default value next to each field that is not the default value.
40
  'default_mark' => '', // What to print by the field's title if the value shown is default. Suggested: *
41
+ 'admin_bar' => false,
42
  'admin_bar_icon' => 'dashicons-admin-generic',
43
  // CAREFUL -> These options are for advanced use only
44
  'output' => false, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output
96
  margin-top: 38px;"><i class="dashicons dashicons-editor-help" style="
97
  font-size: 36px;
98
  margin-right: 20px;
99
+ margin-top: -1px;"></i>Need Help?</h1>
100
  <p style="
101
  font-family: georgia;
102
  font-size: 20px;
106
  margin-top: 11px;
107
  color: #666;">Were bunch of passionate people that are dedicated towards helping our users. We will be happy to help you!</p>
108
 
109
+
110
+
111
  ';
112
  }
113
  return $output ;
315
  array('amp-design-selector','=',3),
316
  array('ampforwp-homepage-posts-image-modify-size','=',1)
317
  )
318
+ ),
319
+ array(
320
+ 'id' =>'amp-on-off-support-for-non-amp-home-page',
321
+ 'type' => 'switch',
322
+ 'title' => __('Non-AMP HomePage link in Header and Logo', 'redux-framework-demo'),
323
+ 'subtitle' => __('If you want users in header to go to non-AMP website from the Header, then you can enable this option', 'redux-framework-demo'),
324
+ 'default' => 0,
325
  )
326
  )
327
  )
346
  'options' => array(
347
  '1' => __('Google Analytics', 'redux-framework-demo' ),
348
  '2' => __('Segment Analytics', 'redux-framework-demo' ),
349
+ '3' => __('Piwik Analytics', 'redux-framework-demo' ),
350
+ '4' => __('Quantcast Measurement', 'redux-framework-demo' ),
351
+ '5' => __('comScore', 'redux-framework-demo' ),
352
  ),
353
  'required' => array(
354
  array('amp-use-gtm-option', '=' , '0'),
391
  'default' => '#',
392
  ),
393
 
394
+ array(
395
+ 'id' =>'amp-quantcast-analytics-code',
396
+ 'type' => 'text',
397
+ 'title' => __('p-code'),
398
+ 'default' => '',
399
+ 'required' => array(
400
+ array('amp-analytics-select-option', '=' , '4')),
401
+ ),
402
+ array(
403
+ 'id' =>'amp-comscore-analytics-code-c1',
404
+ 'type' => 'text',
405
+ 'title' => __('C1'),
406
+ 'default' => 1,
407
+ 'required' => array(
408
+ array('amp-analytics-select-option', '=' , '5')),
409
+ ),
410
+ array(
411
+ 'id' =>'amp-comscore-analytics-code-c2',
412
+ 'type' => 'text',
413
+ 'title' => __('C2'),
414
+ 'default' => '',
415
+ 'required' => array(
416
+ array('amp-analytics-select-option', '=' , '5')),
417
+ ),
418
+
419
+ //GTM
420
  array(
421
  'id' => 'amp-use-gtm-option',
422
  'type' => 'switch',
453
  'required' => array(
454
  array('amp-use-gtm-option', '=' , '1')),
455
  ),
456
+
457
  )
458
  )
459
  );
478
  function ampforwp_get_element_default_color() {
479
  $default_value = get_option('redux_builder_amp', true);
480
  $default_value = $default_value['amp-opt-color-rgba-colorscheme']['color'];
481
+ if ( empty( $default_value ) ) {
482
+ $default_value = '#333';
483
  }
484
  return $default_value;
485
  }
550
  array('amp-design-selector', '=' , '3')
551
  )
552
  ),
553
+
554
 
555
  array(
556
  'id' => 'amp-design-3-featured-slider',
625
  ),
626
  'default' => '1'
627
  ),
628
+ array(
629
+ 'id' => 'amp-design-3-date-feature',
630
+ 'type' => 'switch',
631
+ 'title' => __( 'Display Date on Single', 'redux-framework-demo' ),
632
+ 'required' => array(
633
+ array('amp-design-selector', '=' , '3')
634
+ ),
635
+ 'desc' => __('Display date along with author and category', 'redux-framework-demo' ),
636
+ 'default' => '0'
637
+ ),
638
 
639
  array(
640
  'id' => 'css_editor',
1649
  //
1650
 
1651
 
1652
+ // Comments
1653
  Redux::setSection( $opt_name, array(
1654
+ 'title' => __( 'Comments', 'redux-framework-demo' ),
1655
  // 'desc' => '<a href="https://github.com/disqus/disqus-install-examples/tree/master/google-amp"> Link to Official Disqus documentation. </a>',
1656
  'id' => 'disqus-comments',
1657
  'subsection' => true,
1689
  'placeholder' => 'https://comments.example.com/disqus.php',
1690
  'required' => array('ampforwp-disqus-host-position', '=' , '0'),
1691
  ),
1692
+ array(
1693
+ 'id' => 'ampforwp-number-of-comments',
1694
+ 'type' => 'text',
1695
+ 'desc' => 'This refers to the normal comments',
1696
+ 'title' => __('No of Comments', 'redux-framework-demo'),
1697
+ 'default' => 10,
1698
+ 'required' => array('ampforwp-disqus-comments-support' , '=' , 0)
1699
+ ),
1700
  )
1701
  ) );
1702
 
1716
  'subtitle' => __('Enable/Disable Home page using this switch.', 'redux-framework-demo'),
1717
  'default' => '1'
1718
  ),*/
 
 
 
 
 
 
 
 
 
 
1719
  array(
1720
  'id' => 'ampforwp-archive-support',
1721
  'type' => 'switch',
1756
  'type' => 'textarea',
1757
  'title' => __('Enter HTML in Header', 'redux-framework-demo'),
1758
  'subtitle' => __('please enter markup that is AMP validated', 'redux-framework-demo'),
1759
+ 'desc' => __('check your markup here (enter markup between HEAD tag) : https://validator.ampproject.org/', 'redux-framework-demo'),
1760
  'default' => ''
1761
  ),
1762
  array(
includes/options/redux-core/assets/css/redux-admin.css CHANGED
@@ -137,7 +137,7 @@
137
  .admin-color-fresh .redux-container-switch .cb-disable, .admin-color-fresh .redux-container-switch .cb-enable, .admin-color-fresh .ui-state-default, .admin-color-fresh .ui-widget-content .ui-state-default, .admin-color-fresh .ui-widget-header .ui-state-default, .wp-customizer .redux-container-switch .cb-disable, .wp-customizer .redux-container-switch .cb-enable, .wp-customizer .ui-state-default, .wp-customizer .ui-widget-content .ui-state-default, .wp-customizer .ui-widget-header .ui-state-default{
138
  border: 0;
139
  background: #f2f2f2 !important;
140
- color: #999;
141
  }
142
  .redux-container-switch .switch-options{
143
  text-transform: uppercase;
@@ -150,7 +150,7 @@
150
  border: 0 !important;
151
  }
152
  .admin-color-fresh .redux-container-switch .cb-disable.selected{
153
- background: #303f9f !important;
154
  color: #fff;
155
  box-shadow: none !important;
156
  border: 0 !important;
137
  .admin-color-fresh .redux-container-switch .cb-disable, .admin-color-fresh .redux-container-switch .cb-enable, .admin-color-fresh .ui-state-default, .admin-color-fresh .ui-widget-content .ui-state-default, .admin-color-fresh .ui-widget-header .ui-state-default, .wp-customizer .redux-container-switch .cb-disable, .wp-customizer .redux-container-switch .cb-enable, .wp-customizer .ui-state-default, .wp-customizer .ui-widget-content .ui-state-default, .wp-customizer .ui-widget-header .ui-state-default{
138
  border: 0;
139
  background: #f2f2f2 !important;
140
+ color: #777;
141
  }
142
  .redux-container-switch .switch-options{
143
  text-transform: uppercase;
150
  border: 0 !important;
151
  }
152
  .admin-color-fresh .redux-container-switch .cb-disable.selected{
153
+ background: #777 !important;
154
  color: #fff;
155
  box-shadow: none !important;
156
  border: 0 !important;
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.44
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -29,12 +29,13 @@ AMP for WP automatically adds Accelerated Mobile Pages (Google AMP Project) func
29
 
30
  = Features: =
31
 
 
32
  * NEW - Native AMP Search functionality.
33
  * NEW - Design 3 [Watch the Video Overview](https://www.youtube.com/watch?v=ub1pwskt3Rc)
34
  * NEW - Disqus Comments Support
35
  * NEW - Google Tag Manager Support
36
  * NEW - Page, Category & Tags Support Added
37
- * NEW - Custom AMP Editor - Which allows you to override your Content that you had written in Post or page, so you can add the different content just for AMP.
38
  * Mobile Redirection - More than 50% of your traffic is from mobile and you aren’t doing anything to improve their user experience, which means you are falling behind on SEO and it can result in lower SERPS. Lightning fast mobile version means faster User experience means more engagement which directly results in the lower bounce rate.
39
  * Custom Post Type Support
40
  * Star Ratings
@@ -74,6 +75,7 @@ AMP for WP automatically adds Accelerated Mobile Pages (Google AMP Project) func
74
  * Piwik & Segment.com Support
75
  * Incontent & DoubleClick Support
76
  * Great Support & Active Development.
 
77
 
78
  **[JOIN CHAT GROUP COMMUNITY](http://ampforwp.com/community/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
79
 
@@ -127,6 +129,38 @@ You can contact me using this url: http://ampforwp.com/contact/
127
 
128
  == Changelog ==
129
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  = 0.9.44 (5 March 2017) =
131
  * View more details at https://ampforwp.com/user-experience-52nd-update/
132
  * Added Welcome Screen for better User experience. [Enhancement]
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.45
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
29
 
30
  = Features: =
31
 
32
+ * NEW - Comments Forms in AMP.
33
  * NEW - Native AMP Search functionality.
34
  * NEW - Design 3 [Watch the Video Overview](https://www.youtube.com/watch?v=ub1pwskt3Rc)
35
  * NEW - Disqus Comments Support
36
  * NEW - Google Tag Manager Support
37
  * NEW - Page, Category & Tags Support Added
38
+ * Custom AMP Editor - Which allows you to override your Content that you had written in Post or page, so you can add the different content just for AMP.
39
  * Mobile Redirection - More than 50% of your traffic is from mobile and you aren’t doing anything to improve their user experience, which means you are falling behind on SEO and it can result in lower SERPS. Lightning fast mobile version means faster User experience means more engagement which directly results in the lower bounce rate.
40
  * Custom Post Type Support
41
  * Star Ratings
75
  * Piwik & Segment.com Support
76
  * Incontent & DoubleClick Support
77
  * Great Support & Active Development.
78
+ * Widgets & WooCommerce
79
 
80
  **[JOIN CHAT GROUP COMMUNITY](http://ampforwp.com/community/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
81
 
129
 
130
  == Changelog ==
131
 
132
+ = 0.9.45 (18 March 2017) =
133
+ * View more details at https://ampforwp.com/0-9-45-released-compatibility-rtl-53rd-update/
134
+ * W3Total cache compatibility added
135
+ * RTL Support added for Right-to-Left language websites.
136
+ * Comments Pagination feature added
137
+ * WP-Rocket Compatibility added
138
+ * WPML Compatibility added
139
+ * Quantcast analytics support added
140
+ * ComScore support added
141
+ * Custom Yoast title support added #685
142
+ * WooCommerce Shortcode: Allows you to display WooCommerce Products. [amp-woocommerce num=6] will display the 6 products from WooCommerce. [amp-woocommerce num=6 link=noamp] will display 6 products but they will go to non-amp website, if you want to link to AMP version of the page then use [amp-woocommerce num=6 link=amp]
143
+ * Admin area UX improvements
144
+ * Adding notifications script in the correct way
145
+ * Comments now display on frontpage as well.
146
+ * Re-positioned non-amp Header link control to the right section.
147
+ * ?nonamp=1 only displays when the Mobile redirection is on
148
+ * Properly adding iFrame js.
149
+ * Custom Post type incompatibility fixed
150
+ * Widgets added to the Custom Frontpage.
151
+ * Stripping shortcodes from excerpts.
152
+ * Custom content on static frontpage had over riding issue #687
153
+ * Option added for controlling number of comments
154
+ * Welcome page should be shown only if user is “administrator” #696
155
+ * Digg Digg social share compatibility #694
156
+ * Removed unnecessary lines from Design 3
157
+ * Sanitized Archive Description to amp Compatible #659
158
+ * Author box now displays HTML properly #645
159
+ * Date added Design-3 in meta #583
160
+ * Options link was removed from wp-admin tool bar after a feedback from a user.
161
+ * Footer sub menus layout compatibility.
162
+
163
+
164
  = 0.9.44 (5 March 2017) =
165
  * View more details at https://ampforwp.com/user-experience-52nd-update/
166
  * Added Welcome Screen for better User experience. [Enhancement]
templates/custom-amp-content.php CHANGED
@@ -12,7 +12,7 @@ function ampforwp_custom_post_content_sanitizer( $data, $post ) {
12
 
13
  global $post;
14
  $amp_current_post_id = get_the_ID() ;
15
- if ( $redux_builder_amp['amp-frontpage-select-option'] ) {
16
  $amp_current_post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
17
  }
18
  $amp_custom_post_content_input = get_post_meta($amp_current_post_id, 'ampforwp_custom_content_editor', true);
@@ -70,7 +70,7 @@ function amp_content_editor_title_callback( $post ) {
70
  global $post;
71
  global $redux_builder_amp;
72
  $amp_current_post_id = $post->ID;
73
- if ( $redux_builder_amp['amp-frontpage-select-option'] ) {
74
  $amp_current_post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
75
  }
76
 
12
 
13
  global $post;
14
  $amp_current_post_id = get_the_ID() ;
15
+ if ( is_home() && $redux_builder_amp['amp-frontpage-select-option'] ) {
16
  $amp_current_post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
17
  }
18
  $amp_custom_post_content_input = get_post_meta($amp_current_post_id, 'ampforwp_custom_content_editor', true);
70
  global $post;
71
  global $redux_builder_amp;
72
  $amp_current_post_id = $post->ID;
73
+ if ( is_home() && $redux_builder_amp['amp-frontpage-select-option'] ) {
74
  $amp_current_post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
75
  }
76
 
templates/design-manager/design-1/archive.php CHANGED
@@ -32,7 +32,12 @@
32
 
33
  <?php if ( is_archive() ) {
34
  the_archive_title( '<h3 class="page-title">', '</h3>' );
35
- the_archive_description( '<div class="taxonomy-description">', '</div>' );
 
 
 
 
 
36
  } ?>
37
 
38
  <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
@@ -79,7 +84,7 @@
79
  }else{
80
  $content = get_the_content();
81
  } ?>
82
- <p><?php echo wp_trim_words( $content , '20'); ?></p>
83
  </div>
84
  </div>
85
  <?php endwhile; ?>
32
 
33
  <?php if ( is_archive() ) {
34
  the_archive_title( '<h3 class="page-title">', '</h3>' );
35
+ $arch_desc = ampforwp_sanitize_archive_description();
36
+ if( $arch_desc ) { ?>
37
+ <div class="amp-wp-content taxonomy-description">
38
+ <?php echo $arch_desc ; ?>
39
+ </div> <?php
40
+ }
41
  } ?>
42
 
43
  <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
84
  }else{
85
  $content = get_the_content();
86
  } ?>
87
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '20'); ?></p>
88
  </div>
89
  </div>
90
  <?php endwhile; ?>
templates/design-manager/design-1/elements/comments.php CHANGED
@@ -60,7 +60,7 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
60
  }// end of ampforwp_custom_translated_comment()
61
 
62
  wp_list_comments( array(
63
- 'per_page' => 10, //Allow comment pagination
64
  'style' => 'li',
65
  'type' => 'comment',
66
  'max_depth' => 5,
@@ -70,16 +70,22 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
70
  ), $comments); ?>
71
  </ul>
72
  </div>
73
- <div class="comment-button-wrapper">
74
- <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
75
- </div>
 
 
 
76
  <?php } else {
77
  global $redux_builder_amp ;
78
  if (!comments_open()) {
79
  return;
80
  } ?>
81
- <div class="comment-button-wrapper">
82
- <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
83
- </div>
 
 
 
84
  <?php } ?>
85
  </div>
60
  }// end of ampforwp_custom_translated_comment()
61
 
62
  wp_list_comments( array(
63
+ 'per_page' => AMPFORWP_COMMENTS_PER_PAGE , //Allow comment pagination
64
  'style' => 'li',
65
  'type' => 'comment',
66
  'max_depth' => 5,
70
  ), $comments); ?>
71
  </ul>
72
  </div>
73
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
74
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
75
+ <div class="comment-button-wrapper">
76
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
77
+ </div>
78
+ <?php } ?>
79
  <?php } else {
80
  global $redux_builder_amp ;
81
  if (!comments_open()) {
82
  return;
83
  } ?>
84
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
85
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
86
+ <div class="comment-button-wrapper">
87
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
88
+ </div>
89
+ <?php } ?>
90
  <?php } ?>
91
  </div>
templates/design-manager/design-1/elements/simple-comment-button.php CHANGED
@@ -3,6 +3,9 @@ global $redux_builder_amp;
3
  if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support']) {
4
  return;
5
  } ?>
 
 
6
  <div class="comment-button-wrapper ampforwp-comment-button">
7
  <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
8
- </div>
 
3
  if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support']) {
4
  return;
5
  } ?>
6
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
7
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
8
  <div class="comment-button-wrapper ampforwp-comment-button">
9
  <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
10
+ </div>
11
+ <?php } ?>
templates/design-manager/design-1/frontpage.php CHANGED
@@ -23,7 +23,7 @@ $template = new AMP_Post_Template( $post_id );?>
23
  </head>
24
  <body class="single-post amp-wp-frontpage design_1_wrapper">
25
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
26
-
27
  <article class="amp-wp-article">
28
 
29
  <?php if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { ?>
@@ -52,6 +52,127 @@ $template = new AMP_Post_Template( $post_id );?>
52
  ?>
53
 
54
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  <div class="amp-wp-content post-pagination-meta">
57
  <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-taxonomy' ) ) ); ?>
@@ -86,6 +207,7 @@ $template = new AMP_Post_Template( $post_id );?>
86
  </div>
87
  <?php } ?>
88
  </article>
 
89
  <?php $this->load_parts( array( 'footer' ) ); ?>
90
  <?php do_action( 'amp_post_template_footer', $this ); ?>
91
  </body>
23
  </head>
24
  <body class="single-post amp-wp-frontpage design_1_wrapper">
25
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
26
+ <?php do_action('ampforwp_frontpage_above_loop') ?>
27
  <article class="amp-wp-article">
28
 
29
  <?php if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { ?>
52
  ?>
53
 
54
  </div>
55
+ <?php $data = get_option( 'ampforwp_design' );
56
+ $enable_comments = false;
57
+
58
+ if ($data['elements'] == '') {
59
+ $data['elements'] = "meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,comments:1,related_posts:1";
60
+ }
61
+ if( isset( $data['elements'] ) || ! empty( $data['elements'] ) ){
62
+ $options = explode( ',', $data['elements'] );
63
+ };
64
+ if ($options): foreach ($options as $key=>$value) {
65
+ switch ($value) {
66
+ case 'comments:1':
67
+ $enable_comments = true;
68
+ break;
69
+ }
70
+ } endif;
71
+ if ( $enable_comments ) { ?>
72
+ <div class="ampforwp-comment-wrapper">
73
+ <?php
74
+ // TODO : Create a separate function and add the comment code that and use DRY method instead of repeating the code. #682
75
+ global $redux_builder_amp;
76
+ // Gather comments for a specific page/post
77
+ $postID = get_the_ID();
78
+ $postID = $redux_builder_amp['amp-frontpage-select-option-pages'];
79
+ $comments = get_comments(array(
80
+ 'post_id' => $postID,
81
+ 'status' => 'approve' //Change this to the type of comments to be displayed
82
+ ));
83
+ if ( $comments ) { ?>
84
+ <div class="amp-wp-content comments_list">
85
+ <h3><?php global $redux_builder_amp; echo $redux_builder_amp['amp-translator-view-comments-text'] ?></h3>
86
+ <ul>
87
+ <?php
88
+ $page = (get_query_var('page')) ? get_query_var('page') : 1;
89
+ $total_comments = get_comments( array(
90
+ 'orderby' => 'post_date' ,
91
+ 'order' => 'DESC',
92
+ 'post_id' => $postID,
93
+ 'status' => 'approve',
94
+ 'parent' =>0 )
95
+ );
96
+ $pages = ceil(count($total_comments)/AMPFORWP_COMMENTS_PER_PAGE);
97
+ $pagination_args = array(
98
+ 'base' => @add_query_arg('page','%#%'),
99
+ 'format' => '?page=%#%',
100
+ 'total' => $pages,
101
+ 'current' => $page,
102
+ 'show_all' => False,
103
+ 'end_size' => 1,
104
+ 'mid_size' => 2,
105
+ 'prev_next' => True,
106
+ 'prev_text' => $redux_builder_amp['amp-translator-previous-text'],
107
+ 'next_text' => $redux_builder_amp['amp-translator-next-text'],
108
+ 'type' => 'plain'
109
+ );
110
+
111
+ // Display the list of comments
112
+ function ampforwp_custom_translated_comment($comment, $args, $depth){
113
+ $GLOBALS['comment'] = $comment;
114
+ global $redux_builder_amp; ?>
115
+ <li id="li-comment-<?php comment_ID() ?>"
116
+ <?php comment_class(); ?> >
117
+ <article id="comment-<?php comment_ID(); ?>" class="comment-body">
118
+ <footer class="comment-meta">
119
+ <div class="comment-author vcard">
120
+ <?php
121
+ printf(__('<b class="fn">%s</b> <span class="says">'.$redux_builder_amp['amp-translator-says-text'].':</span>'), get_comment_author_link()) ?>
122
+ </div>
123
+ <!-- .comment-author -->
124
+ <div class="comment-metadata">
125
+ <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
126
+ <?php
127
+ printf(__('%1$s '.$redux_builder_amp['amp-translator-at-text'].' %2$s'), get_comment_date(), get_comment_time())
128
+ ?>
129
+ </a>
130
+ <?php edit_comment_link(__('('.$redux_builder_amp['amp-translator-Edit-text'].')'),' ','') ?>
131
+ </div>
132
+ <!-- .comment-metadata -->
133
+ </footer>
134
+ <!-- .comment-meta -->
135
+ <div class="comment-content">
136
+ <p><?php
137
+ // $pattern = "~[^a-zA-Z0-9_ !@#$%^&*();\\\/|<>\"'+.,:?=-]~";
138
+ $emoji_content = get_comment_text();
139
+ // $emoji_free_comments = preg_replace($pattern,'',$emoji_content);
140
+ echo $emoji_content; ?>
141
+ </p>
142
+ </div>
143
+ <!-- .comment-content -->
144
+ </article>
145
+ <!-- .comment-body -->
146
+ </li>
147
+ <!-- #comment-## -->
148
+ <?php
149
+ }// end of ampforwp_custom_translated_comment()
150
+ wp_list_comments( array(
151
+ 'per_page' => AMPFORWP_COMMENTS_PER_PAGE, //Allow comment pagination
152
+ 'page' => $page,
153
+ 'style' => 'li',
154
+ 'type' => 'comment',
155
+ 'max_depth' => 5,
156
+ 'avatar_size' => 0,
157
+ 'callback' => 'ampforwp_custom_translated_comment',
158
+ 'reverse_top_level' => false //Show the latest comments at the top of the list
159
+ ), $comments);
160
+ echo paginate_links( $pagination_args );?>
161
+ </ul>
162
+ </div>
163
+ <div class="comment-button-wrapper">
164
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
165
+ </div><?php
166
+ } else {
167
+ if ( !comments_open() ) {
168
+ return;
169
+ } ?>
170
+ <div class="comment-button-wrapper">
171
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
172
+ </div>
173
+ <?php } ?>
174
+ </div> <?php
175
+ } ?>
176
 
177
  <div class="amp-wp-content post-pagination-meta">
178
  <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-taxonomy' ) ) ); ?>
207
  </div>
208
  <?php } ?>
209
  </article>
210
+ <?php do_action('ampforwp_frontpage_below_loop') ?>
211
  <?php $this->load_parts( array( 'footer' ) ); ?>
212
  <?php do_action( 'amp_post_template_footer', $this ); ?>
213
  </body>
templates/design-manager/design-1/header-bar.php CHANGED
@@ -2,21 +2,23 @@
2
  <header id="#top" class="amp-wp-header">
3
  <div class="ampforwp-logo-area" >
4
  <?php
5
- if($redux_builder_amp['amp-on-off-support-for-non-amp-home-page']){
6
- ?>
7
- <a href="<?php echo esc_url( untrailingslashit( $this->get( 'home_url' ) ).'?nonamp=1'); ?>" rel="nofollow">
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' ) ) ) . AMPFORWP_AMP_QUERY_VAR; ?>">
13
-
14
- <?php } else { ?>
15
-
16
- <a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ).'?nonamp=1'); ?>" rel="nofollow">
17
-
18
- <?php }
19
- }?>
 
 
20
 
21
  <?php if (true == ($redux_builder_amp['opt-media']['url'])) { ?>
22
  <?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
@@ -54,7 +56,7 @@
54
  <amp-img src="<?php echo esc_url( $site_icon_url ); ?>" width="32" height="32" class="amp-wp-site-icon"></amp-img>
55
  <?php endif; ?>
56
  </a>
57
-
58
  <div on='tap:sidebar.toggle' role="button" tabindex="0" class="nav_container">
59
  <a href="#" class="toggle-text">
60
  <span></span>
@@ -63,8 +65,8 @@
63
  </a>
64
  </div>
65
  <?php do_action('ampforwp_header_search'); ?>
66
-
67
-
68
 
69
  </div>
70
  </header>
2
  <header id="#top" class="amp-wp-header">
3
  <div class="ampforwp-logo-area" >
4
  <?php
5
+ if( $redux_builder_amp['amp-on-off-support-for-non-amp-home-page'] ) {
6
+ if( $redux_builder_amp['amp-mobile-redirection'] ) { ?>
7
+ <a href="<?php echo esc_url( untrailingslashit( $this->get( 'home_url' ) ).'?nonamp=1'); ?>" rel="nofollow">
8
+ <?php } else { ?>
9
+ <a href="<?php echo esc_url( untrailingslashit( $this->get( 'home_url' ) ) ); ?>">
10
+ <?php }
11
+ } else { ?>
12
+ <?php if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
13
+ <a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ) . AMPFORWP_AMP_QUERY_VAR; ?>">
14
+ <?php } else {
15
+ if( $redux_builder_amp['amp-mobile-redirection'] ) { ?>
16
+ <a href="<?php echo esc_url( untrailingslashit( $this->get( 'home_url' ) ).'?nonamp=1'); ?>" rel="nofollow">
17
+ <?php } else { ?>
18
+ <a href="<?php echo esc_url( untrailingslashit( $this->get( 'home_url' ) ) ); ?>" >
19
+ <?php }
20
+ }
21
+ } ?>
22
 
23
  <?php if (true == ($redux_builder_amp['opt-media']['url'])) { ?>
24
  <?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
56
  <amp-img src="<?php echo esc_url( $site_icon_url ); ?>" width="32" height="32" class="amp-wp-site-icon"></amp-img>
57
  <?php endif; ?>
58
  </a>
59
+
60
  <div on='tap:sidebar.toggle' role="button" tabindex="0" class="nav_container">
61
  <a href="#" class="toggle-text">
62
  <span></span>
65
  </a>
66
  </div>
67
  <?php do_action('ampforwp_header_search'); ?>
68
+
69
+
70
 
71
  </div>
72
  </header>
templates/design-manager/design-1/search.php CHANGED
@@ -86,7 +86,7 @@
86
  }else{
87
  $content = get_the_content();
88
  } ?>
89
- <p><?php echo wp_trim_words( $content , '20'); ?></p>
90
  </div>
91
  </div>
92
  <?php endwhile; ?>
@@ -99,9 +99,9 @@
99
  </div>
100
 
101
  </div>
102
- <?php else: ?>
103
  <div class="amp-wp-content amp-wp-article-header amp-loop-list">
104
- <?php echo $redux_builder_amp['amp-translator-search-no-found']; ?>
105
  <div class="cb"></div>
106
  </div>
107
  <?php endif; ?> <?php wp_reset_postdata(); ?>
86
  }else{
87
  $content = get_the_content();
88
  } ?>
89
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '20'); ?></p>
90
  </div>
91
  </div>
92
  <?php endwhile; ?>
99
  </div>
100
 
101
  </div>
102
+ <?php else: ?>
103
  <div class="amp-wp-content amp-wp-article-header amp-loop-list">
104
+ <?php echo $redux_builder_amp['amp-translator-search-no-found']; ?>
105
  <div class="cb"></div>
106
  </div>
107
  <?php endif; ?> <?php wp_reset_postdata(); ?>
templates/design-manager/design-1/style.php CHANGED
@@ -26,7 +26,7 @@ blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background:
26
  .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 {margin: 0 18px;}.amp-wp-frontpage .the_content {padding: 10px;}.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-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;} .amp-wp-footer {border-top: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;margin: calc(1.5em - 1px) 0 0;padding-bottom:25px;}
27
  .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}
28
  .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;}
29
- .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}.whatsapp-share-icon{width:50px;height:20px;display:inline-block;background:#5cbe4a;padding:4px 0;position:relative;top:-4px;text-align:center}.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 h3{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}.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%}.comments_list ul li p{margin:0;font-size:14px;clear:both;padding-top:5px}.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}.comments_list li li{background:#f7f7f7;box-shadow:none;border:1px solid #eee}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{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:20px;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}
30
  .amp-wp-content-loop{width:100%}
31
 
32
  /* Category 1 */
@@ -184,9 +184,31 @@ table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, le
184
  top:0;
185
  }
186
  .amp-wp-header a, .headerlogo a, [class*=icono-] {color: <?php echo sanitize_hex_color( $header_color ); ?>;text-decoration: none;}
 
187
  <?php if($redux_builder_amp['enable-single-social-icons'] && is_socialshare_or_socialsticky_enabled_in_ampforwp() ){ ?> .amp-wp-footer{padding-bottom: 60px;}<?php } ?>
188
- <?php if( is_rtl() ) { ?>
189
- .amp-wp-header .amp-wp-site-icon,.amp-wp-header .nav_container{float:left;right:initial;left:-11px}.amp-wp-header .amp-wp-site-icon{position:relative;top:-3px}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  <?php } ?>
191
  <?php
192
  if ( class_exists('TablePress') ) { ?>
26
  .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 {margin: 0 18px;}.amp-wp-frontpage .the_content {padding: 10px;}.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-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;} .amp-wp-footer {border-top: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;margin: calc(1.5em - 1px) 0 0;padding-bottom:25px;}
27
  .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}
28
  .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;}
29
+ .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}.whatsapp-share-icon{width:50px;height:20px;display:inline-block;background:#5cbe4a;padding:4px 0;position:relative;top:-4px;text-align:center}.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 h3{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}.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%}.comments_list ul li p{margin:0;font-size:14px;clear:both;padding-top:5px}.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}.comments_list li li{background:#f7f7f7;box-shadow:none;border:1px solid #eee} .page-numbers{ padding: 9px 10px; background: #fff; font-size: 14px; } 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{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:20px;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}
30
  .amp-wp-content-loop{width:100%}
31
 
32
  /* Category 1 */
184
  top:0;
185
  }
186
  .amp-wp-header a, .headerlogo a, [class*=icono-] {color: <?php echo sanitize_hex_color( $header_color ); ?>;text-decoration: none;}
187
+
188
  <?php if($redux_builder_amp['enable-single-social-icons'] && is_socialshare_or_socialsticky_enabled_in_ampforwp() ){ ?> .amp-wp-footer{padding-bottom: 60px;}<?php } ?>
189
+
190
+ <?php if($redux_builder_amp['amp-rtl-select-option'] == true) { ?>
191
+ /* RTL Styling */
192
+ header, amp-sidebar, article, footer{ direction: rtl;}
193
+ .home-post-image{float:left; margin: 0 10px 10px 20px;}
194
+ .amp-wp-header{text-align: right;}
195
+ .toggle-text{left: 40px; right: initial;}
196
+ .amp-wp-header .amp-wp-site-icon, .amp-wp-header .nav_container{right:0px;left: 18px;}
197
+ #pagination .next{float:left}
198
+ .back-to-top{float:left}
199
+ .amp-wp-footer p{margin:0 0 0 15px}
200
+ .amp-wp-article-header .amp-wp-meta:first-of-type{text-align:right}
201
+ .amp-wp-tax-category span{margin-left:5px; margin-right:0px}
202
+ .amp-wp-meta.amp-wp-tax-tag{display:inherit}
203
+ .amp-wp-article-header .amp-wp-meta:last-of-type{text-align:left}
204
+ .related_posts ol li amp-img{float:right; margin-left:15px; margin-right:0px}
205
+ .amp-wp-header .amp-wp-site-icon,.amp-wp-header .nav_container{float:left;right:0;left:18px}.amp-wp-header .amp-wp-site-icon{position:relative;top:-3px}
206
+ .toggle-navigationv2 ul li a{width:100%}
207
+ .searchform{direction:rtl}
208
+ .closebutton{right:0; left:20px;}
209
+ .amp-wp-byline amp-img{ margin:0px 0px 0px 6px;}
210
+ .comment-author{float: right;}
211
+ /* RTL ends */
212
  <?php } ?>
213
  <?php
214
  if ( class_exists('TablePress') ) { ?>
templates/design-manager/design-2/archive.php CHANGED
@@ -34,7 +34,12 @@
34
  <div class="amp-wp-content amp-archive-heading">
35
  <?php
36
  the_archive_title( '<h3 class="page-title">', '</h3>' );
37
- the_archive_description( '<div class="taxonomy-description">', '</div>' ); ?>
 
 
 
 
 
38
  </div>
39
  <?php
40
  } ?>
@@ -76,7 +81,7 @@
76
  $content = get_the_content();
77
  }
78
  ?>
79
- <p><?php echo wp_trim_words( $content , '15' ); ?></p>
80
 
81
  </div>
82
  <div class="cb"></div>
34
  <div class="amp-wp-content amp-archive-heading">
35
  <?php
36
  the_archive_title( '<h3 class="page-title">', '</h3>' );
37
+ $arch_desc = ampforwp_sanitize_archive_description();
38
+ if( $arch_desc ) { ?>
39
+ <div class="amp-wp-content taxonomy-description">
40
+ <?php echo $arch_desc ; ?>
41
+ </div> <?php
42
+ } ?>
43
  </div>
44
  <?php
45
  } ?>
81
  $content = get_the_content();
82
  }
83
  ?>
84
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
85
 
86
  </div>
87
  <div class="cb"></div>
templates/design-manager/design-2/elements/comments.php CHANGED
@@ -60,7 +60,7 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
60
  }// end of ampforwp_custom_translated_comment()
61
 
62
  wp_list_comments( array(
63
- 'per_page' => 10, //Allow comment pagination
64
  'style' => 'li',
65
  'type' => 'comment',
66
  'max_depth' => 5,
@@ -70,16 +70,23 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
70
  ), $comments); ?>
71
  </ul>
72
  </div>
73
- <div class="comment-button-wrapper">
74
- <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
75
- </div><?php
 
 
 
 
76
  } else {
77
  global $redux_builder_amp ;
78
  if (!comments_open()) {
79
  return;
80
  } ?>
81
- <div class="comment-button-wrapper">
82
- <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
83
- </div>
 
 
 
84
  <?php } ?>
85
  </div>
60
  }// end of ampforwp_custom_translated_comment()
61
 
62
  wp_list_comments( array(
63
+ 'per_page' => AMPFORWP_COMMENTS_PER_PAGE , //Allow comment pagination
64
  'style' => 'li',
65
  'type' => 'comment',
66
  'max_depth' => 5,
70
  ), $comments); ?>
71
  </ul>
72
  </div>
73
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
74
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
75
+ <div class="comment-button-wrapper">
76
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
77
+ </div>
78
+ <?php } ?>
79
+ <?php
80
  } else {
81
  global $redux_builder_amp ;
82
  if (!comments_open()) {
83
  return;
84
  } ?>
85
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
86
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
87
+ <div class="comment-button-wrapper">
88
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
89
+ </div>
90
+ <?php } ?>
91
  <?php } ?>
92
  </div>
templates/design-manager/design-2/elements/simple-comment-button.php CHANGED
@@ -3,6 +3,9 @@ global $redux_builder_amp;
3
  if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support']) {
4
  return;
5
  } ?>
 
 
6
  <div class="comment-button-wrapper ampforwp-comment-button">
7
  <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
8
- </div>
 
3
  if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support']) {
4
  return;
5
  } ?>
6
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
7
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
8
  <div class="comment-button-wrapper ampforwp-comment-button">
9
  <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
10
+ </div>
11
+ <?php } ?>
templates/design-manager/design-2/frontpage.php CHANGED
@@ -34,6 +34,7 @@ $template = new AMP_Post_Template( $post_id );?>
34
  <?php } ?>
35
 
36
  <?php do_action( 'ampforwp_after_header', $this ); ?>
 
37
 
38
  <main>
39
  <div class="amp-wp-content the_content"> <?php
@@ -50,6 +51,128 @@ $template = new AMP_Post_Template( $post_id );?>
50
 
51
  </div>
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  <div class="amp-wp-content post-pagination-meta">
54
  <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-taxonomy' ) ) ); ?>
55
  </div>
@@ -59,8 +182,7 @@ $template = new AMP_Post_Template( $post_id );?>
59
  <?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
60
  <amp-social-share type="facebook" width="50" height="28"></amp-social-share>
61
  <?php } ?>
62
- <?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
63
- $data_param_data = $redux_builder_amp['enable-single-twitter-share-handle'];?>
64
  <amp-social-share type="twitter"
65
  width="50"
66
  height="28"
@@ -83,6 +205,8 @@ $template = new AMP_Post_Template( $post_id );?>
83
  </div>
84
  <?php } ?>
85
  </main>
 
 
86
  <?php $this->load_parts( array( 'footer' ) ); ?>
87
  <?php do_action( 'amp_post_template_footer', $this ); ?>
88
 
34
  <?php } ?>
35
 
36
  <?php do_action( 'ampforwp_after_header', $this ); ?>
37
+ <?php do_action('ampforwp_frontpage_above_loop') ?>
38
 
39
  <main>
40
  <div class="amp-wp-content the_content"> <?php
51
 
52
  </div>
53
 
54
+ <?php $data = get_option( 'ampforwp_design' );
55
+ $enable_comments = false;
56
+
57
+ if ($data['elements'] == '') {
58
+ $data['elements'] = "meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,comments:1,related_posts:1";
59
+ }
60
+ if( isset( $data['elements'] ) || ! empty( $data['elements'] ) ){
61
+ $options = explode( ',', $data['elements'] );
62
+ };
63
+ if ($options): foreach ($options as $key=>$value) {
64
+ switch ($value) {
65
+ case 'comments:1':
66
+ $enable_comments = true;
67
+ break;
68
+ }
69
+ } endif;
70
+ if ( $enable_comments ) { ?>
71
+ <div class="ampforwp-comment-wrapper">
72
+ <?php
73
+ // TODO : Create a separate function and add the comment code that and use DRY method instead of repeating the code. #682
74
+ global $redux_builder_amp;
75
+ // Gather comments for a specific page/post
76
+ $postID = get_the_ID();
77
+ $postID = $redux_builder_amp['amp-frontpage-select-option-pages'];
78
+ $comments = get_comments(array(
79
+ 'post_id' => $postID,
80
+ 'status' => 'approve' //Change this to the type of comments to be displayed
81
+ ));
82
+ if ( $comments ) { ?>
83
+ <div class="amp-wp-content comments_list">
84
+ <h3><?php global $redux_builder_amp; echo $redux_builder_amp['amp-translator-view-comments-text'] ?></h3>
85
+ <ul>
86
+ <?php
87
+ $page = (get_query_var('page')) ? get_query_var('page') : 1;
88
+ $total_comments = get_comments( array(
89
+ 'orderby' => 'post_date' ,
90
+ 'order' => 'DESC',
91
+ 'post_id' => $postID,
92
+ 'status' => 'approve',
93
+ 'parent' =>0 )
94
+ );
95
+ $pages = ceil(count($total_comments)/AMPFORWP_COMMENTS_PER_PAGE);
96
+ $pagination_args = array(
97
+ 'base' => @add_query_arg('page','%#%'),
98
+ 'format' => '?page=%#%',
99
+ 'total' => $pages,
100
+ 'current' => $page,
101
+ 'show_all' => False,
102
+ 'end_size' => 1,
103
+ 'mid_size' => 2,
104
+ 'prev_next' => True,
105
+ 'prev_text' => $redux_builder_amp['amp-translator-previous-text'],
106
+ 'next_text' => $redux_builder_amp['amp-translator-next-text'],
107
+ 'type' => 'plain'
108
+ );
109
+
110
+ // Display the list of comments
111
+ function ampforwp_custom_translated_comment($comment, $args, $depth){
112
+ $GLOBALS['comment'] = $comment;
113
+ global $redux_builder_amp; ?>
114
+ <li id="li-comment-<?php comment_ID() ?>"
115
+ <?php comment_class(); ?> >
116
+ <article id="comment-<?php comment_ID(); ?>" class="comment-body">
117
+ <footer class="comment-meta">
118
+ <div class="comment-author vcard">
119
+ <?php
120
+ printf(__('<b class="fn">%s</b> <span class="says">'.$redux_builder_amp['amp-translator-says-text'].':</span>'), get_comment_author_link()) ?>
121
+ </div>
122
+ <!-- .comment-author -->
123
+ <div class="comment-metadata">
124
+ <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
125
+ <?php
126
+ printf(__('%1$s '.$redux_builder_amp['amp-translator-at-text'].' %2$s'), get_comment_date(), get_comment_time())
127
+ ?>
128
+ </a>
129
+ <?php edit_comment_link(__('('.$redux_builder_amp['amp-translator-Edit-text'].')'),' ','') ?>
130
+ </div>
131
+ <!-- .comment-metadata -->
132
+ </footer>
133
+ <!-- .comment-meta -->
134
+ <div class="comment-content">
135
+ <p><?php
136
+ // $pattern = "~[^a-zA-Z0-9_ !@#$%^&*();\\\/|<>\"'+.,:?=-]~";
137
+ $emoji_content = get_comment_text();
138
+ // $emoji_free_comments = preg_replace($pattern,'',$emoji_content);
139
+ echo $emoji_content; ?>
140
+ </p>
141
+ </div>
142
+ <!-- .comment-content -->
143
+ </article>
144
+ <!-- .comment-body -->
145
+ </li>
146
+ <!-- #comment-## -->
147
+ <?php
148
+ }// end of ampforwp_custom_translated_comment()
149
+ wp_list_comments( array(
150
+ 'per_page' => AMPFORWP_COMMENTS_PER_PAGE, //Allow comment pagination
151
+ 'page' => $page,
152
+ 'style' => 'li',
153
+ 'type' => 'comment',
154
+ 'max_depth' => 5,
155
+ 'avatar_size' => 0,
156
+ 'callback' => 'ampforwp_custom_translated_comment',
157
+ 'reverse_top_level' => false //Show the latest comments at the top of the list
158
+ ), $comments);
159
+ echo paginate_links( $pagination_args );?>
160
+ </ul>
161
+ </div>
162
+ <div class="comment-button-wrapper">
163
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
164
+ </div><?php
165
+ } else {
166
+ if ( !comments_open() ) {
167
+ return;
168
+ } ?>
169
+ <div class="comment-button-wrapper">
170
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
171
+ </div>
172
+ <?php } ?>
173
+ </div> <?php
174
+ } ?>
175
+
176
  <div class="amp-wp-content post-pagination-meta">
177
  <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-taxonomy' ) ) ); ?>
178
  </div>
182
  <?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
183
  <amp-social-share type="facebook" width="50" height="28"></amp-social-share>
184
  <?php } ?>
185
+ <?php if($redux_builder_amp['enable-single-twitter-share'] == true) { $data_param_data = $redux_builder_amp['enable-single-twitter-share-handle'];?>
 
186
  <amp-social-share type="twitter"
187
  width="50"
188
  height="28"
205
  </div>
206
  <?php } ?>
207
  </main>
208
+ <?php do_action('ampforwp_frontpage_below_loop') ?>
209
+
210
  <?php $this->load_parts( array( 'footer' ) ); ?>
211
  <?php do_action( 'amp_post_template_footer', $this ); ?>
212
 
templates/design-manager/design-2/header-bar.php CHANGED
@@ -4,17 +4,26 @@
4
 
5
  <?php global $redux_builder_amp;
6
  $set_rel_to_noamp=false;
7
- if ($redux_builder_amp['amp-on-off-support-for-non-amp-home-page']) {
8
- $ampforwp_home_url = untrailingslashit( get_bloginfo('url') ).'?nonamp=1';
9
- $set_rel_to_noamp = true;
10
- }else{ global $redux_builder_amp; if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
11
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR;
12
- } else {
13
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ) .'?nonamp=1';
14
- $set_rel_to_noamp = true;
15
- }
16
- }
17
- ?>
 
 
 
 
 
 
 
 
 
18
 
19
  <?php
20
  if (! empty( $redux_builder_amp['opt-media']['url'] ) ) { ?>
4
 
5
  <?php 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 = untrailingslashit( get_bloginfo('url') ).'?nonamp=1';
11
+ $set_rel_to_noamp = true;
12
+ } else {
13
+ $ampforwp_home_url = untrailingslashit( get_bloginfo('url') );
14
+ }
15
+ } else {
16
+ if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
17
+ $ampforwp_home_url = trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR;
18
+ } else {
19
+ if( $redux_builder_amp['amp-mobile-redirection'] ) {
20
+ $ampforwp_home_url = untrailingslashit( get_bloginfo('url') ).'?nonamp=1';
21
+ $set_rel_to_noamp = true;
22
+ } else {
23
+ $ampforwp_home_url = untrailingslashit( get_bloginfo('url') );
24
+ }
25
+ }
26
+ }?>
27
 
28
  <?php
29
  if (! empty( $redux_builder_amp['opt-media']['url'] ) ) { ?>
templates/design-manager/design-2/search.php CHANGED
@@ -69,7 +69,7 @@
69
  }else{
70
  $content = get_the_content();
71
  } ?>
72
- <p><?php echo wp_trim_words( $content , '15' ); ?></p>
73
 
74
  </div>
75
  <div class="cb"></div>
@@ -84,7 +84,7 @@
84
  <div class="clearfix"></div>
85
  </div>
86
  </div>
87
- <?php else: ?>
88
  <div class="amp-wp-content amp-loop-list">
89
  <div class="amp-wp-post-content">
90
  <?php echo $redux_builder_amp['amp-translator-search-no-found']; ?>
69
  }else{
70
  $content = get_the_content();
71
  } ?>
72
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
73
 
74
  </div>
75
  <div class="cb"></div>
84
  <div class="clearfix"></div>
85
  </div>
86
  </div>
87
+ <?php else: ?>
88
  <div class="amp-wp-content amp-loop-list">
89
  <div class="amp-wp-post-content">
90
  <?php echo $redux_builder_amp['amp-translator-search-no-found']; ?>
templates/design-manager/design-2/style.php CHANGED
@@ -597,69 +597,20 @@ main .amp-wp-content.relatedpost {
597
  margin: 16px 18px 20px 19px;
598
  }
599
  /* Comments */
600
- .ampforwp-comment-wrapper{
601
- margin:1.8em 0px 1.5em 0px
602
- }
603
- main .amp-wp-content.comments_list {
604
- background: none;
605
- box-shadow: none;
606
- max-width: 1030px;
607
- padding:0
608
- }
609
- .comments_list div{
610
- display:inline-block;
611
- }
612
- .comments_list ul{
613
- margin:0;
614
- padding:0
615
- }
616
- .comments_list ul.children{
617
- padding-bottom:10px;
618
- margin-left: 4%;
619
- width: 96%;
620
- }
621
- .comments_list ul li p{
622
- margin:0;
623
- font-size:15px;
624
- clear:both;
625
- padding-top:16px;
626
- }
627
- .comments_list ul li{
628
- font-size:13px;
629
- list-style-type:none;
630
- margin-bottom: 12px;
631
- background: #fefefe;
632
- -moz-border-radius: 2px;
633
- -webkit-border-radius: 2px;
634
- border-radius: 2px;
635
- -moz-box-shadow: 0 2px 3px rgba(0,0,0,.05);
636
- -webkit-box-shadow: 0 2px 3px rgba(0,0,0,.05);
637
- box-shadow: 0 2px 3px rgba(0,0,0,.05);
638
- padding: 0px;
639
- max-width: 1000px;
640
- width:96%;
641
- }
642
- .comments_list ul li .comment-body{
643
- padding: 25px;
644
- width: 91%;
645
- }
646
- .comments_list ul li .comment-body .comment-author{
647
- margin-right:5px
648
- }
649
  .comment-author{ float:left }
650
- .single-post footer.comment-meta{
651
- /* float:right */
652
- padding-bottom: 0;
653
- }
654
- .comments_list li li{
655
- margin: 20px 20px 10px 20px;
656
- background: #f7f7f7;
657
- box-shadow: none;
658
- border: 1px solid #eee;
659
- }
660
- .comments_list li li li{
661
- margin:20px 20px 10px 20px
662
- }
663
  /* ADS */
664
  .amp_home_body .amp_ad_1{
665
  margin-top: 10px;
@@ -825,33 +776,19 @@ table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, le
825
  h2.amp-wp-title a{ font-size: 17px; line-height: 26px;}
826
  }
827
  <?php if($redux_builder_amp['amp-rtl-select-option'] == true) { ?>
828
- /* RTL Start */
829
- .amp-wp-meta{ padding-right: 0; }
830
- .nav_container, .toggle-navigationv2, .amp-loop-list, #pagination, #footer, .amp-wp-meta, .amp-wp-title, .single-post .the_content, .amp-wp-tax-tag, .sticky_social{
831
- direction:rtl
832
- }
833
- main .amp-loop-list {
834
- padding-right:20px
835
- }
836
- .amp-loop-list .home-post_image{
837
- float:left;
838
- margin-left:0;
839
- margin-right:15px;
840
- }
841
- #pagination{
842
- display:inline-block
843
- }
844
- #pagination .next{
845
- float:left
846
- }
847
- #pagination .prev,
848
- .amp-wp-tax-tag{
849
- float:right
850
- }
851
- .toggle-text:before{
852
- padding-left:5px;
853
- }
854
- /* RTL End */
855
  <?php } ?>
856
 
857
  /* Style Modifer */
@@ -916,27 +853,7 @@ amp-user-notification button {
916
  max-width: 100%;
917
  }
918
 
919
- <?php //style for RTL
920
- if( is_rtl() ) { ?>
921
- /* stlye for RTL languages */
922
- .amp-wp-header .amp-wp-site-icon{
923
- position: relative;
924
- float: left;
925
- }
926
-
927
- .amp-wp-header .nav_container{
928
- float: left;
929
- right: initial;
930
- left: -11px;
931
- }
932
-
933
- .amp-wp-header .amp-wp-site-icon{
934
- top: -3px;
935
- right: initial;
936
- left: -11px;
937
- }
938
- <?php } ?>
939
-
940
  <?php
941
  // Table press support
942
  if ( class_exists('TablePress') ) { ?>
597
  margin: 16px 18px 20px 19px;
598
  }
599
  /* Comments */
600
+ .page-numbers{padding: 9px 10px;background: #fff;font-size: 14px}
601
+ .ampforwp-comment-wrapper{margin:1.8em 0px 1.5em 0px}
602
+ main .amp-wp-content.comments_list {background: none;box-shadow: none;max-width: 1030px;padding:0}
603
+ .comments_list div{display:inline-block;}
604
+ .comments_list ul{margin:0;padding:0}
605
+ .comments_list ul.children{padding-bottom:10px;margin-left: 4%;width: 96%;}
606
+ .comments_list ul li p{margin:0;font-size:15px;clear:both;padding-top:16px;}
607
+ .comments_list ul li{ font-size:13px;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: 0px;max-width: 1000px;width:100%;}
608
+ .comments_list ul li .comment-body{padding: 25px;width: 91%;}
609
+ .comments_list ul li .comment-body .comment-author{margin-right:5px}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
610
  .comment-author{ float:left }
611
+ .single-post footer.comment-meta{padding-bottom: 0;}
612
+ .comments_list li li{margin: 20px 20px 10px 20px;background: #f7f7f7;box-shadow: none;border: 1px solid #eee;}
613
+ .comments_list li li li{margin:20px 20px 10px 20px}
 
 
 
 
 
 
 
 
 
 
614
  /* ADS */
615
  .amp_home_body .amp_ad_1{
616
  margin-top: 10px;
776
  h2.amp-wp-title a{ font-size: 17px; line-height: 26px;}
777
  }
778
  <?php if($redux_builder_amp['amp-rtl-select-option'] == true) { ?>
779
+ header, amp-sidebar, article, footer, main{direction: rtl;}
780
+ .amp-wp-header .amp-wp-site-icon{position: relative;float: left; }
781
+ .amp-wp-header .nav_container{float: left;right: initial;left: -11px;}
782
+ .amp-wp-header .amp-wp-site-icon{top: -3px;right: initial;left: -11px;}
783
+ .amp-wp-byline, .amp-wp-posted-on{float:right}
784
+ .amp-wp-tax-category{float:left}
785
+ .related_posts ol li amp-img{float:right; margin-right:0px; margin-left:15px}
786
+ main .amp-archive-heading{direction:rtl}
787
+ .searchform{direction:rtl}
788
+ .closebutton{right:0; left:20px}
789
+ .amp-meta-wrapper{padding-right:0}
790
+ .comment-author{float:right; margin-left:5px; }
791
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
792
  <?php } ?>
793
 
794
  /* Style Modifer */
853
  max-width: 100%;
854
  }
855
 
856
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
857
  <?php
858
  // Table press support
859
  if ( class_exists('TablePress') ) { ?>
templates/design-manager/design-3/archive.php CHANGED
@@ -55,7 +55,13 @@ if ( get_query_var( 'paged' ) ) {
55
 
56
  <?php if ( is_archive() ) {
57
  the_archive_title( '<h3 class="amp-wp-content page-title">', '</h3>' );
58
- the_archive_description( '<div class="amp-wp-content taxonomy-description">', '</div>' );
 
 
 
 
 
 
59
  } ?>
60
 
61
  <?php if ( have_posts() ) : while ( have_posts() ) : the_post();
@@ -96,7 +102,7 @@ if ( get_query_var( 'paged' ) ) {
96
  $content = get_the_content();
97
  }
98
  ?>
99
- <p><?php echo wp_trim_words( $content , '15' ); ?></p>
100
  <div class="featured_time">
101
  <?php
102
  printf( _x( '%1$s '. $redux_builder_amp['amp-translator-ago-date-text'], '%2$s = human-readable time difference', 'wpdocs_textdomain' ),
55
 
56
  <?php if ( is_archive() ) {
57
  the_archive_title( '<h3 class="amp-wp-content page-title">', '</h3>' );
58
+
59
+ $arch_desc = ampforwp_sanitize_archive_description();
60
+ if( $arch_desc ) { ?>
61
+ <div class="amp-wp-content taxonomy-description">
62
+ <?php echo $arch_desc ; ?>
63
+ </div> <?php
64
+ }
65
  } ?>
66
 
67
  <?php if ( have_posts() ) : while ( have_posts() ) : the_post();
102
  $content = get_the_content();
103
  }
104
  ?>
105
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
106
  <div class="featured_time">
107
  <?php
108
  printf( _x( '%1$s '. $redux_builder_amp['amp-translator-ago-date-text'], '%2$s = human-readable time difference', 'wpdocs_textdomain' ),
templates/design-manager/design-3/elements/comments.php CHANGED
@@ -60,7 +60,7 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
60
  }// end of ampforwp_custom_translated_comment()
61
 
62
  wp_list_comments( array(
63
- 'per_page' => 10, //Allow comment pagination
64
  'style' => 'li',
65
  'type' => 'comment',
66
  'max_depth' => 5,
@@ -70,16 +70,23 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
70
  ), $comments); ?>
71
  </ul>
72
  </div>
73
- <div class="comment-button-wrapper">
74
- <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
75
- </div><?php
 
 
 
 
76
  } else {
77
  global $redux_builder_amp ;
78
  if (!comments_open()) {
79
  return;
80
  } ?>
81
- <div class="comment-button-wrapper">
82
- <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
83
- </div>
 
 
 
84
  <?php } ?>
85
  </div>
60
  }// end of ampforwp_custom_translated_comment()
61
 
62
  wp_list_comments( array(
63
+ 'per_page' => AMPFORWP_COMMENTS_PER_PAGE , //Allow comment pagination
64
  'style' => 'li',
65
  'type' => 'comment',
66
  'max_depth' => 5,
70
  ), $comments); ?>
71
  </ul>
72
  </div>
73
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
74
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
75
+ <div class="comment-button-wrapper">
76
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
77
+ </div>
78
+ <?php } ?>
79
+ <?php
80
  } else {
81
  global $redux_builder_amp ;
82
  if (!comments_open()) {
83
  return;
84
  } ?>
85
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
86
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
87
+ <div class="comment-button-wrapper">
88
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
89
+ </div>
90
+ <?php } ?>
91
  <?php } ?>
92
  </div>
templates/design-manager/design-3/elements/meta-info.php CHANGED
@@ -1,3 +1,5 @@
 
 
1
  <div class="amp-wp-content amp-wp-article-header ampforwp-meta-info">
2
  <div class="amp-wp-content post-title-meta">
3
 
@@ -11,7 +13,7 @@
11
  <?php $ampforwp_categories = get_the_terms( $this->ID, 'category' );
12
  if ( $ampforwp_categories ) : ?>
13
  <span class="amp-wp-meta amp-wp-tax-category ampforwp-tax-category">
14
- <?php global $redux_builder_amp;
15
  //if RTL is OFF
16
  if(!$redux_builder_amp['amp-rtl-select-option']) {
17
  global $redux_builder_amp; printf( __($redux_builder_amp['amp-translator-in-designthree'] .' ', 'amp' )); } ?>
@@ -28,6 +30,10 @@
28
  </span>
29
  <?php endif; ?>
30
 
 
 
 
 
31
  </div>
32
  <?php endif; ?>
33
 
1
+ <?php global $redux_builder_amp; ?>
2
+
3
  <div class="amp-wp-content amp-wp-article-header ampforwp-meta-info">
4
  <div class="amp-wp-content post-title-meta">
5
 
13
  <?php $ampforwp_categories = get_the_terms( $this->ID, 'category' );
14
  if ( $ampforwp_categories ) : ?>
15
  <span class="amp-wp-meta amp-wp-tax-category ampforwp-tax-category">
16
+ <?php
17
  //if RTL is OFF
18
  if(!$redux_builder_amp['amp-rtl-select-option']) {
19
  global $redux_builder_amp; printf( __($redux_builder_amp['amp-translator-in-designthree'] .' ', 'amp' )); } ?>
30
  </span>
31
  <?php endif; ?>
32
 
33
+ <?php if ( $redux_builder_amp['amp-design-3-date-feature'] ) : ?>
34
+ <span class="ampforwp-design3-single-date"><?php global $redux_builder_amp; _e($redux_builder_amp['amp-translator-on-text']." ",'ampforwp'); the_time( get_option( 'date_format' ) ) ?></span>
35
+ <?php endif; ?>
36
+
37
  </div>
38
  <?php endif; ?>
39
 
templates/design-manager/design-3/elements/meta-taxonomy.php CHANGED
@@ -25,8 +25,8 @@
25
  <amp-img src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
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>
25
  <amp-img src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
26
  <?php
27
  } ?>
28
+ <strong><?php echo esc_html( $post_author->display_name ); ?></strong>: <?php echo $post_author->description ; ?>
29
+
30
  <?php } ?>
31
  </div>
32
  </div>
templates/design-manager/design-3/elements/simple-comment-button.php CHANGED
@@ -3,6 +3,10 @@ global $redux_builder_amp;
3
  if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support']) {
4
  return;
5
  } ?>
 
 
 
6
  <div class="comment-button-wrapper ampforwp-comment-button">
7
  <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
8
- </div>
 
3
  if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support']) {
4
  return;
5
  } ?>
6
+
7
+ <?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
8
+ if( ! is_plugin_active( 'amp-comments/amp-comments.php' ) ) { ?>
9
  <div class="comment-button-wrapper ampforwp-comment-button">
10
  <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
11
+ </div>
12
+ <?php } ?>
templates/design-manager/design-3/frontpage.php CHANGED
@@ -38,6 +38,7 @@ $template = new AMP_Post_Template( $post_id );?>
38
  </header>
39
 
40
  <?php do_action( 'ampforwp_after_header', $this ); ?>
 
41
 
42
  <main>
43
  <div class="amp-wp-content the_content"> <?php
@@ -53,6 +54,127 @@ $template = new AMP_Post_Template( $post_id );?>
53
  do_action( 'ampforwp_after_post_content', $this ); ?>
54
 
55
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  <div class="amp-wp-content post-pagination-meta">
58
  <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-taxonomy' ) ) ); ?>
@@ -81,6 +203,7 @@ $template = new AMP_Post_Template( $post_id );?>
81
  </div>
82
  <?php } ?>
83
  </main>
 
84
  <?php do_action( 'amp_post_template_above_footer', $this ); ?>
85
  <?php $this->load_parts( array( 'footer' ) ); ?>
86
  <?php do_action( 'amp_post_template_footer', $this ); ?>
38
  </header>
39
 
40
  <?php do_action( 'ampforwp_after_header', $this ); ?>
41
+ <?php do_action('ampforwp_frontpage_above_loop') ?>
42
 
43
  <main>
44
  <div class="amp-wp-content the_content"> <?php
54
  do_action( 'ampforwp_after_post_content', $this ); ?>
55
 
56
  </div>
57
+ <?php $data = get_option( 'ampforwp_design' );
58
+ $enable_comments = false;
59
+
60
+ if ($data['elements'] == '') {
61
+ $data['elements'] = "meta_info:1,title:1,featured_image:1,content:1,meta_taxonomy:1,social_icons:1,comments:1,related_posts:1";
62
+ }
63
+ if( isset( $data['elements'] ) || ! empty( $data['elements'] ) ){
64
+ $options = explode( ',', $data['elements'] );
65
+ };
66
+ if ($options): foreach ($options as $key=>$value) {
67
+ switch ($value) {
68
+ case 'comments:1':
69
+ $enable_comments = true;
70
+ break;
71
+ }
72
+ } endif;
73
+ if ( $enable_comments ) { ?>
74
+ <div class="ampforwp-comment-wrapper">
75
+ <?php
76
+ // TODO : Create a separate function and add the comment code that and use DRY method instead of repeating the code. #682
77
+ global $redux_builder_amp;
78
+ // Gather comments for a specific page/post
79
+ $postID = get_the_ID();
80
+ $postID = $redux_builder_amp['amp-frontpage-select-option-pages'];
81
+ $comments = get_comments(array(
82
+ 'post_id' => $postID,
83
+ 'status' => 'approve' //Change this to the type of comments to be displayed
84
+ ));
85
+ if ( $comments ) { ?>
86
+ <div class="amp-wp-content comments_list">
87
+ <h3><?php global $redux_builder_amp; echo $redux_builder_amp['amp-translator-view-comments-text'] ?></h3>
88
+ <ul>
89
+ <?php
90
+ $page = (get_query_var('page')) ? get_query_var('page') : 1;
91
+ $total_comments = get_comments( array(
92
+ 'orderby' => 'post_date' ,
93
+ 'order' => 'DESC',
94
+ 'post_id' => $postID,
95
+ 'status' => 'approve',
96
+ 'parent' =>0 )
97
+ );
98
+ $pages = ceil(count($total_comments)/AMPFORWP_COMMENTS_PER_PAGE);
99
+ $pagination_args = array(
100
+ 'base' => @add_query_arg('page','%#%'),
101
+ 'format' => '?page=%#%',
102
+ 'total' => $pages,
103
+ 'current' => $page,
104
+ 'show_all' => False,
105
+ 'end_size' => 1,
106
+ 'mid_size' => 2,
107
+ 'prev_next' => True,
108
+ 'prev_text' => $redux_builder_amp['amp-translator-previous-text'],
109
+ 'next_text' => $redux_builder_amp['amp-translator-next-text'],
110
+ 'type' => 'plain'
111
+ );
112
+
113
+ // Display the list of comments
114
+ function ampforwp_custom_translated_comment($comment, $args, $depth){
115
+ $GLOBALS['comment'] = $comment;
116
+ global $redux_builder_amp; ?>
117
+ <li id="li-comment-<?php comment_ID() ?>"
118
+ <?php comment_class(); ?> >
119
+ <article id="comment-<?php comment_ID(); ?>" class="comment-body">
120
+ <footer class="comment-meta">
121
+ <div class="comment-author vcard">
122
+ <?php
123
+ printf(__('<b class="fn">%s</b> <span class="says">'.$redux_builder_amp['amp-translator-says-text'].':</span>'), get_comment_author_link()) ?>
124
+ </div>
125
+ <!-- .comment-author -->
126
+ <div class="comment-metadata">
127
+ <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
128
+ <?php
129
+ printf(__('%1$s '.$redux_builder_amp['amp-translator-at-text'].' %2$s'), get_comment_date(), get_comment_time())
130
+ ?>
131
+ </a>
132
+ <?php edit_comment_link(__('('.$redux_builder_amp['amp-translator-Edit-text'].')'),' ','') ?>
133
+ </div>
134
+ <!-- .comment-metadata -->
135
+ </footer>
136
+ <!-- .comment-meta -->
137
+ <div class="comment-content">
138
+ <p><?php
139
+ // $pattern = "~[^a-zA-Z0-9_ !@#$%^&*();\\\/|<>\"'+.,:?=-]~";
140
+ $emoji_content = get_comment_text();
141
+ // $emoji_free_comments = preg_replace($pattern,'',$emoji_content);
142
+ echo $emoji_content; ?>
143
+ </p>
144
+ </div>
145
+ <!-- .comment-content -->
146
+ </article>
147
+ <!-- .comment-body -->
148
+ </li>
149
+ <!-- #comment-## -->
150
+ <?php
151
+ }// end of ampforwp_custom_translated_comment()
152
+ wp_list_comments( array(
153
+ 'per_page' => AMPFORWP_COMMENTS_PER_PAGE, //Allow comment pagination
154
+ 'page' => $page,
155
+ 'style' => 'li',
156
+ 'type' => 'comment',
157
+ 'max_depth' => 5,
158
+ 'avatar_size' => 0,
159
+ 'callback' => 'ampforwp_custom_translated_comment',
160
+ 'reverse_top_level' => false //Show the latest comments at the top of the list
161
+ ), $comments);
162
+ echo paginate_links( $pagination_args );?>
163
+ </ul>
164
+ </div>
165
+ <div class="comment-button-wrapper">
166
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
167
+ </div><?php
168
+ } else {
169
+ if ( !comments_open() ) {
170
+ return;
171
+ } ?>
172
+ <div class="comment-button-wrapper">
173
+ <a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
174
+ </div>
175
+ <?php } ?>
176
+ </div> <?php
177
+ } ?>
178
 
179
  <div class="amp-wp-content post-pagination-meta">
180
  <?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-taxonomy' ) ) ); ?>
203
  </div>
204
  <?php } ?>
205
  </main>
206
+ <?php do_action('ampforwp_frontpage_below_loop') ?>
207
  <?php do_action( 'amp_post_template_above_footer', $this ); ?>
208
  <?php $this->load_parts( array( 'footer' ) ); ?>
209
  <?php do_action( 'amp_post_template_footer', $this ); ?>
templates/design-manager/design-3/header-bar.php CHANGED
@@ -88,17 +88,27 @@
88
  <div class="headerlogo">
89
  <?php global $redux_builder_amp;
90
  $set_rel_to_noamp=false;
91
- if ($redux_builder_amp['amp-on-off-support-for-non-amp-home-page']) {
92
- $ampforwp_home_url = untrailingslashit( get_bloginfo('url') ).'?nonamp=1';
93
- $set_rel_to_noamp=true;
94
- }else{ global $redux_builder_amp; if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
95
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR;
96
- } else {
97
- $ampforwp_home_url = trailingslashit( get_bloginfo('url') ) .'?nonamp=1';
98
- $set_rel_to_noamp=true;
99
- }
100
- }
101
- ?>
 
 
 
 
 
 
 
 
 
 
102
  <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) { ?>
103
  <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
104
 
88
  <div class="headerlogo">
89
  <?php global $redux_builder_amp;
90
  $set_rel_to_noamp=false;
91
+
92
+ if( $redux_builder_amp['amp-on-off-support-for-non-amp-home-page'] ) {
93
+ if( $redux_builder_amp['amp-mobile-redirection'] ) {
94
+ $ampforwp_home_url = untrailingslashit( get_bloginfo('url') ).'?nonamp=1';
95
+ $set_rel_to_noamp = true;
96
+ } else {
97
+ $ampforwp_home_url = untrailingslashit( get_bloginfo('url') );
98
+ }
99
+ } else {
100
+ if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
101
+ $ampforwp_home_url = trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR;
102
+ } else {
103
+ if( $redux_builder_amp['amp-mobile-redirection'] ) {
104
+ $ampforwp_home_url = untrailingslashit( get_bloginfo('url') ).'?nonamp=1';
105
+ $set_rel_to_noamp = true;
106
+ } else {
107
+ $ampforwp_home_url = untrailingslashit( get_bloginfo('url') );
108
+ }
109
+ }
110
+ }?>
111
+
112
  <?php if ( true == ($redux_builder_amp['opt-media']['url']) ) { ?>
113
  <a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
114
 
templates/design-manager/design-3/index.php CHANGED
@@ -145,7 +145,7 @@ if ( get_query_var( 'paged' ) ) {
145
  $content = get_the_content();
146
  }
147
  ?>
148
- <p><?php echo wp_trim_words( $content , '15' ); ?></p>
149
  <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>
150
 
151
  </div>
145
  $content = get_the_content();
146
  }
147
  ?>
148
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
149
  <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>
150
 
151
  </div>
templates/design-manager/design-3/search.php CHANGED
@@ -57,7 +57,7 @@
57
 
58
  <?php global $redux_builder_amp; ?>
59
  <h3 class="amp-wp-content page-title"><?php echo $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();?> </h3>
60
-
61
  <?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
62
  $ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
63
 
@@ -87,7 +87,7 @@
87
  $content = get_the_content();
88
  }
89
  ?>
90
- <p><?php echo wp_trim_words( $content , '15' ); ?></p>
91
  <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>
92
 
93
  </div>
@@ -109,7 +109,7 @@
109
  </div>
110
  <?php else : ?>
111
  <div class="amp-wp-content">
112
- <?php echo $redux_builder_amp['amp-translator-search-no-found']; ?>
113
  </div>
114
 
115
  <?php endif; ?>
57
 
58
  <?php global $redux_builder_amp; ?>
59
  <h3 class="amp-wp-content page-title"><?php echo $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();?> </h3>
60
+
61
  <?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
62
  $ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
63
 
87
  $content = get_the_content();
88
  }
89
  ?>
90
+ <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
91
  <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>
92
 
93
  </div>
109
  </div>
110
  <?php else : ?>
111
  <div class="amp-wp-content">
112
+ <?php echo $redux_builder_amp['amp-translator-search-no-found']; ?>
113
  </div>
114
 
115
  <?php endif; ?>
templates/design-manager/design-3/style.php CHANGED
@@ -4,13 +4,12 @@ function ampforwp_additional_style_input_2( $amp_template ) {
4
  global $redux_builder_amp;
5
  $get_customizer = new AMP_Post_Template( $post_id );
6
  // Get content width
 
 
 
 
7
  $content_max_width = absint( $get_customizer->get( 'content_max_width' ) );
8
  // Get template colors
9
- $theme_color = $get_customizer->get_customizer_setting( 'theme_color' );
10
- $text_color = $get_customizer->get_customizer_setting( 'text_color' );
11
- $muted_text_color = $get_customizer->get_customizer_setting( 'muted_text_color' );
12
- $border_color = $get_customizer->get_customizer_setting( 'border_color' );
13
- $link_color = $get_customizer->get_customizer_setting( 'link_color' );
14
  $header_background_color = $get_customizer->get_customizer_setting( 'header_background_color' );
15
  $header_color = $get_customizer->get_customizer_setting( 'header_color' );
16
  ?>
@@ -36,12 +35,7 @@ a {
36
  }
37
 
38
  /* Slide Navigation code */
39
- .nav_container{
40
- padding: 18px 15px;
41
- background: #312C7E;
42
- color: #fff;
43
- text-align: center
44
- }
45
  amp-sidebar {
46
  width: 280px;
47
  background: #131313;
@@ -188,7 +182,6 @@ amp-accordion>section[expanded] li a:before{
188
  position: relative;
189
  padding-right: 10px;
190
  }
191
- .nav_container:hover + .toggle-navigation,
192
  .toggle-navigation:hover,
193
  .toggle-navigation:active,
194
  .toggle-navigation:focus{
@@ -388,6 +381,7 @@ color:#666
388
  .footer_menu ul li:last-child{
389
  margin-right:0
390
  }
 
391
  /* Single */
392
  .single-post main{
393
  margin: 20px 17px 17px 17px;
@@ -588,6 +582,11 @@ main .amp-wp-content.relatedpost {
588
  margin: 16px 18px 20px 19px;
589
  }
590
  /* Comments */
 
 
 
 
 
591
  .comment-body .comment-content{
592
  font-family:'PT Serif', serif;
593
  margin-top: 2px;
@@ -764,7 +763,7 @@ pre {
764
  text-align: center;
765
  font-size: 12px;
766
  text-transform: uppercase;
767
- color: #666;
768
  }
769
  .amp-category-block ul, .category-widget-wrapper{
770
  max-width: 1000px;
@@ -1195,68 +1194,122 @@ table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, le
1195
 
1196
  <?php if($redux_builder_amp['amp-rtl-select-option'] == true) { ?>
1197
  /* RTL Start */
1198
- /* RTL End */
1199
- <?php } ?>
 
 
 
 
 
 
 
 
1200
 
1201
- /* Style Modifer */
1202
- <?php $color = $redux_builder_amp['opt-color-rgba']['color']; ?>
1203
- a {
1204
- color: <?php echo sanitize_hex_color( $header_background_color ); ?>;;
1205
- }
1206
- .amp-wp-content blockquote{
1207
- border-color:<?php echo sanitize_hex_color( $header_background_color ); ?>;;
1208
- }
1209
- .nav_container, .comment-button-wrapper a {
1210
- background: <?php echo sanitize_hex_color( $header_background_color ); ?>;;
1211
- }
1212
- .nav_container a{
1213
- color:<?php echo sanitize_hex_color( $header_color ); ?>
1214
- }
1215
- amp-user-notification {
1216
- border-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;;
1217
- }
1218
- amp-user-notification button {
1219
- background-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;;
1220
- }
1221
- <?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
1222
- .single-post footer {
1223
- padding-bottom: 41px;
1224
- }
1225
- <?php } ?>
1226
- /**/
1227
- .single-post amp-img.alignleft{
1228
- margin-right: 15px;
1229
- margin-bottom:5px;
1230
- float: left;
1231
- }
1232
- .single-post amp-img.alignright{
1233
- float:right;
1234
- margin-left: 15px;
1235
- margin-bottom:5px;
1236
- }
1237
- .single-post amp-img.aligncenter{
1238
- text-align:center;
1239
- margin: 0 auto
1240
- }
1241
- .amp-wp-author:before{
1242
- content: " <?php global $redux_builder_amp; echo $redux_builder_amp['amp-translator-published-by']; ?> ";
1243
- }
1244
- .ampforwp-tax-category span:last-child:after {
1245
- content: ' ';
1246
- }
1247
- .ampforwp-tax-category span:after{
1248
- content: ', ';
1249
- }
1250
 
1251
- .amp-wp-article-content img {
1252
- max-width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1253
  }
1254
 
1255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1256
 
 
1257
 
 
 
 
 
1258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1260
  /* Social icons */
1261
  @font-face {
1262
  font-family: 'icomoon';
@@ -1347,7 +1400,7 @@ amp-user-notification button {
1347
  }
1348
  #ampsomething { display: none; }
1349
  #header, .headerlogo a{ background:<?php echo $redux_builder_amp['amp-opt-color-rgba-headercolor']['color']; ?> }
1350
- .nav_container, .comment-button-wrapper a , #pagination .next a, #pagination .prev a{
1351
  background: <?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']; ?> ;
1352
  }
1353
  .toast:after, .toast:before, .toast span{
@@ -1358,14 +1411,9 @@ amp-user-notification button {
1358
  color: <?php echo $redux_builder_amp['amp-opt-color-rgba-font']['color']; ?> ;
1359
  }
1360
  <?php if( !has_nav_menu( 'amp-menu' ) ) { ?>
1361
- .toggle-navigationv2 .social_icons {
1362
- border-top: 0px;
1363
- }
1364
- .toggle-navigationv2 a {
1365
- color:#fff;
1366
- }
1367
  <?php } ?>
1368
-
1369
  <?php
1370
  // Table press support
1371
  if ( class_exists('TablePress') ) { ?>
4
  global $redux_builder_amp;
5
  $get_customizer = new AMP_Post_Template( $post_id );
6
  // Get content width
7
+ $colorscheme = $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color'];
8
+ $headercolor = $redux_builder_amp['amp-opt-color-rgba-headercolor']['color'];
9
+ $font_color = $redux_builder_amp['amp-opt-color-rgba-font']['color'];
10
+ $headerelements = $redux_builder_amp['amp-opt-color-rgba-headerelements']['color'];
11
  $content_max_width = absint( $get_customizer->get( 'content_max_width' ) );
12
  // Get template colors
 
 
 
 
 
13
  $header_background_color = $get_customizer->get_customizer_setting( 'header_background_color' );
14
  $header_color = $get_customizer->get_customizer_setting( 'header_color' );
15
  ?>
35
  }
36
 
37
  /* Slide Navigation code */
38
+
 
 
 
 
 
39
  amp-sidebar {
40
  width: 280px;
41
  background: #131313;
182
  position: relative;
183
  padding-right: 10px;
184
  }
 
185
  .toggle-navigation:hover,
186
  .toggle-navigation:active,
187
  .toggle-navigation:focus{
381
  .footer_menu ul li:last-child{
382
  margin-right:0
383
  }
384
+ .footer_menu ul ul{ display:none }
385
  /* Single */
386
  .single-post main{
387
  margin: 20px 17px 17px 17px;
582
  margin: 16px 18px 20px 19px;
583
  }
584
  /* Comments */
585
+ .page-numbers{
586
+ padding: 9px 10px;
587
+ background: #fff;
588
+ font-size: 14px;
589
+ }
590
  .comment-body .comment-content{
591
  font-family:'PT Serif', serif;
592
  margin-top: 2px;
763
  text-align: center;
764
  font-size: 12px;
765
  text-transform: uppercase;
766
+ color: #666;
767
  }
768
  .amp-category-block ul, .category-widget-wrapper{
769
  max-width: 1000px;
1194
 
1195
  <?php if($redux_builder_amp['amp-rtl-select-option'] == true) { ?>
1196
  /* RTL Start */
1197
+ .amp-carousel-slide h1{
1198
+ direction: rtl;
1199
+ }
1200
+ .featured_time{
1201
+ text-align: right;
1202
+ padding-right: 20px;
1203
+ }
1204
+ main .amp-wp-content{
1205
+ direction: rtl;
1206
+ }
1207
 
1208
+ .home-post_image {
1209
+ float: right;
1210
+ padding-right: 0%;
1211
+ padding-left: 2%;
1212
+ margin-right: 0%;
1213
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1214
 
1215
+ .searchmenu {
1216
+ margin-right: 15px;
1217
+ margin-top: 11px;
1218
+ position: absolute;
1219
+ top: 0;
1220
+ right: inherit;
1221
+ }
1222
+
1223
+ .searchform label{
1224
+
1225
+ text-align: right;
1226
+ right: -30px;
1227
+ position: relative;
1228
+
1229
+ }
1230
+
1231
+ .searchform input{
1232
+
1233
+ text-align: right;
1234
+ padding: 15px;
1235
+
1236
+ }
1237
+
1238
+ .closebutton{
1239
+ left:20px;
1240
+ }
1241
+
1242
+ .hamburgermenu {
1243
+ float: right;
1244
+ }
1245
+ .toast {
1246
+ display: block;
1247
+ position: relative;
1248
+ height: 50px;
1249
+ padding-left: 20px;
1250
+ padding-right: 15px;
1251
+ width: 60px;
1252
+ background: none;
1253
+ border: 0;
1254
  }
1255
 
1256
 
1257
+ /* RTL single */
1258
+
1259
+ .related_posts ol li amp-img{
1260
+
1261
+ float: right;
1262
+ margin-left: 15px;
1263
+ }
1264
+ .single-post .amp_author_area amp-img {
1265
+
1266
+ float: right;
1267
+ margin-left: 12px;
1268
+ }
1269
+
1270
+ .amp-wp-article, .footer_wrapper container {
1271
+
1272
+ direction: rtl;
1273
+ }
1274
 
1275
+ .single-post .post-pagination-meta span{
1276
 
1277
+ float: right;
1278
+ }
1279
+
1280
+ .amp-wp-article-tags span {
1281
 
1282
+ background: #eeeeee;
1283
+ margin-right: 10px;
1284
+ padding: 5px 12px 5px 12px;
1285
+ border-radius: 3px;
1286
+ display: inline-block;
1287
+ margin: 5px;
1288
+ }
1289
+ .amp_author_area_wrapper strong{
1290
+
1291
+ float: right;
1292
+ }
1293
+
1294
+ /* RTL End */
1295
+ <?php } ?>
1296
 
1297
+ /* Style Modifer */
1298
+ <?php $color = $redux_builder_amp['opt-color-rgba']['color']; ?>
1299
+ a { color: <?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']; ?> }
1300
+ .amp-wp-content blockquote { border-color: <?php echo sanitize_hex_color( $header_background_color ); ?>; }
1301
+ amp-user-notification { border-color: <?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']; ?>;}
1302
+ amp-user-notification button { background-color: <?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']; ?>;}
1303
+ <?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
1304
+ .single-post footer { padding-bottom: 41px;}
1305
+ <?php } ?>
1306
+ .single-post amp-img.alignleft{ margin-right: 15px; margin-bottom:5px; float: left;}
1307
+ .single-post amp-img.alignright{ float:right; margin-left: 15px; margin-bottom:5px;}
1308
+ .single-post amp-img.aligncenter{ text-align:center; margin: 0 auto}
1309
+ .amp-wp-author:before{ content: " <?php global $redux_builder_amp; echo $redux_builder_amp['amp-translator-published-by'];?> ";}
1310
+ .ampforwp-tax-category span:last-child:after { content: ' ';}
1311
+ .ampforwp-tax-category span:after{ content: ', ';}
1312
+ .amp-wp-article-content img { max-width: 100%;}
1313
  /* Social icons */
1314
  @font-face {
1315
  font-family: 'icomoon';
1400
  }
1401
  #ampsomething { display: none; }
1402
  #header, .headerlogo a{ background:<?php echo $redux_builder_amp['amp-opt-color-rgba-headercolor']['color']; ?> }
1403
+ .comment-button-wrapper a, #pagination .next a, #pagination .prev a{
1404
  background: <?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']; ?> ;
1405
  }
1406
  .toast:after, .toast:before, .toast span{
1411
  color: <?php echo $redux_builder_amp['amp-opt-color-rgba-font']['color']; ?> ;
1412
  }
1413
  <?php if( !has_nav_menu( 'amp-menu' ) ) { ?>
1414
+ .toggle-navigationv2 .social_icons { border-top: 0px; }
1415
+ .toggle-navigationv2 a { color:#fff; }
 
 
 
 
1416
  <?php } ?>
 
1417
  <?php
1418
  // Table press support
1419
  if ( class_exists('TablePress') ) { ?>
templates/features.php CHANGED
@@ -18,6 +18,8 @@
18
  10.1 Analytics Support added for Google Analytics
19
  10.2 Analytics Support added for segment.com
20
  10.3 Analytics Support added for Piwik
 
 
21
  11. Strip unwanted codes and tags from the_content
22
  12. Add Logo URL in the structured metadata
23
  13. Add Custom Placeholder Image for Structured Data.
@@ -57,6 +59,10 @@
57
  47. social js properly adding when required
58
  48. Remove all unwanted scripts on search pages
59
  49. Properly adding ad Script the AMP way
 
 
 
 
60
  */
61
  // Adding AMP-related things to the main theme
62
  global $redux_builder_amp;
@@ -70,6 +76,7 @@
70
 
71
  //0.
72
 
 
73
 
74
  // 1. Add Home REL canonical
75
  // Add AMP rel-canonical for home and archive pages
@@ -129,7 +136,7 @@
129
  $supported_types = array('post','page');
130
 
131
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
132
- if( is_plugin_active( 'AMP-Custom-Post-Type/amp-custom-post-type.php' ) ) {
133
  if ( $redux_builder_amp['ampforwp-custom-type'] ) {
134
  foreach($redux_builder_amp['ampforwp-custom-type'] as $custom_post){
135
  $supported_types[] = $custom_post;
@@ -300,9 +307,6 @@
300
  <script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
301
  <?php } ?>
302
 
303
- <?php if($redux_builder_amp['amp-enable-notifications'] == true) { ?>
304
- <script async custom-element="amp-user-notification" src="https://cdn.ampproject.org/v0/amp-user-notification-0.1.js"></script>
305
- <?php } ?>
306
  <?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) { ?>
307
  <?php if( is_singular() ) {
308
  if( is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
@@ -581,6 +585,38 @@
581
  if( $redux_builder_amp['amp-analytics-select-option']=='3' ) { ?>
582
  <amp-pixel src="<?php global $redux_builder_amp; echo $redux_builder_amp['pa-feild']; ?>"></amp-pixel>
583
  <?php }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
584
  }//analytics function ends here
585
 
586
  // 11. Strip unwanted codes and tags from the_content
@@ -794,6 +830,10 @@ function ampforwp_title_custom_meta() {
794
 
795
  foreach ( $post_types as $post_type ) {
796
 
 
 
 
 
797
  if( $post_type !== 'page' ) {
798
  add_meta_box( 'ampforwp_title_meta', __( 'Show AMP for Current Page?' ), 'ampforwp_title_callback', $post_type,'side' );
799
  }
@@ -1153,15 +1193,14 @@ function ampforwp_remove_title_tags(){
1153
  if( is_single() || is_page() ){
1154
  global $post;
1155
  $title = $post->post_title;
1156
- echo $title . ' | ' . get_option( 'blogname' ) ;
1157
  }
1158
  // title for archive pages
1159
  if ( is_archive() && $redux_builder_amp['ampforwp-archive-support'] ) {
1160
- echo strip_tags(get_the_archive_title( '' ));
1161
- echo ' | ';
1162
- echo strip_tags(get_the_archive_description( '' ));
1163
  }
1164
-
1165
  $site_title = get_bloginfo('name') . ' | ' . get_option( 'blogdescription' ) ;
1166
  if ( is_home() ) {
1167
  if ( $redux_builder_amp['amp-frontpage-select-option']== 1) {
@@ -1176,11 +1215,17 @@ function ampforwp_remove_title_tags(){
1176
  $site_title .= ' | Page '.$current_url_in_pieces[$cnt-1];
1177
  }
1178
  }
1179
- echo $site_title ;
1180
  }
1181
-
1182
  if( is_search() ) {
1183
- echo $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();
 
 
 
 
 
 
 
 
1184
  } ?>
1185
  </title>
1186
  <?php
@@ -1262,8 +1307,22 @@ add_filter( 'amp_init', 'ampforwp_lazy_loading_plugins_compatibility' );
1262
  function ampforwp_lazy_loading_plugins_compatibility() {
1263
 
1264
  //WP Rocket
1265
- add_filter( 'do_rocket_lazyload', '__return_false', PHP_INT_MAX );
1266
- add_filter( 'do_rocket_lazyload_iframes', '__return_false', PHP_INT_MAX );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1267
 
1268
  //Lazy Load XT
1269
  global $lazyloadxt;
@@ -1274,7 +1333,22 @@ function ampforwp_lazy_loading_plugins_compatibility() {
1274
 
1275
  // Lazy Load
1276
  add_filter( 'lazyload_is_enabled', '__return_false', PHP_INT_MAX );
 
1277
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1278
  }
1279
 
1280
  //Removing bj loading for amp
@@ -1373,8 +1447,10 @@ add_filter( 'amp_post_template_data', 'ampforwp_add_disqus_scripts' );
1373
  function ampforwp_add_disqus_scripts( $data ) {
1374
  global $redux_builder_amp;
1375
  if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && is_singular() ) {
1376
- if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
1377
- $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
 
 
1378
  }
1379
  }
1380
  // remove direction attribute from the AMP HTMl #541
@@ -1528,11 +1604,13 @@ if (function_exists('register_sidebar')) {
1528
 
1529
  // 43. custom actions for widgets output
1530
  add_action( 'ampforwp_home_above_loop' , 'ampforwp_output_widget_content_above_loop' );
 
1531
  function ampforwp_output_widget_content_above_loop() {
1532
  dynamic_sidebar( 'ampforwp-above-loop' );
1533
  }
1534
 
1535
  add_action( 'ampforwp_home_below_loop' , 'ampforwp_output_widget_content_below_loop' );
 
1536
  function ampforwp_output_widget_content_below_loop() {
1537
  dynamic_sidebar( 'ampforwp-below-loop' );
1538
  }
@@ -1673,7 +1751,7 @@ function ampforwp_add_ads_scripts( $data ) {
1673
  if( !function_exists('ampforwp_checking_any_social_profiles') ) {
1674
  function ampforwp_checking_any_social_profiles() {
1675
  global $redux_builder_amp;
1676
- if(
1677
  $redux_builder_amp['enable-single-twittter-profile'] ||
1678
  $redux_builder_amp['enable-single-facebook-profile'] ||
1679
  $redux_builder_amp['enable-single-pintrest-profile'] ||
@@ -1684,10 +1762,160 @@ if( !function_exists('ampforwp_checking_any_social_profiles') ) {
1684
  $redux_builder_amp['enable-single-VKontakte-profile'] ||
1685
  $redux_builder_amp['enable-single-reddit-profile'] ||
1686
  $redux_builder_amp['enable-single-snapchat-profile'] ||
1687
- $redux_builder_amp['enable-single-Tumblr-profile']
1688
  ) {
1689
  return true;
1690
  }
1691
  return false;
1692
  }
1693
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  10.1 Analytics Support added for Google Analytics
19
  10.2 Analytics Support added for segment.com
20
  10.3 Analytics Support added for Piwik
21
+ 10.4 Analytics Support added for quantcast
22
+ 10.5 Analytics Support added for comscore
23
  11. Strip unwanted codes and tags from the_content
24
  12. Add Logo URL in the structured metadata
25
  13. Add Custom Placeholder Image for Structured Data.
59
  47. social js properly adding when required
60
  48. Remove all unwanted scripts on search pages
61
  49. Properly adding ad Script the AMP way
62
+ 50. Properly adding noditification Scritps the AMP way
63
+ 51. Adding Digg Digg compatibility with AMP
64
+ 52. Adding a generalized sanitizer function for purifiying normal html to amp-html
65
+ 53. Adding the Markup for AMP Woocommerce latest Products
66
  */
67
  // Adding AMP-related things to the main theme
68
  global $redux_builder_amp;
76
 
77
  //0.
78
 
79
+ define('AMPFORWP_COMMENTS_PER_PAGE', $redux_builder_amp['ampforwp-number-of-comments'] );
80
 
81
  // 1. Add Home REL canonical
82
  // Add AMP rel-canonical for home and archive pages
136
  $supported_types = array('post','page');
137
 
138
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
139
+ if( is_plugin_active( 'amp-custom-post-type/amp-custom-post-type.php' ) ) {
140
  if ( $redux_builder_amp['ampforwp-custom-type'] ) {
141
  foreach($redux_builder_amp['ampforwp-custom-type'] as $custom_post){
142
  $supported_types[] = $custom_post;
307
  <script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
308
  <?php } ?>
309
 
 
 
 
310
  <?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) { ?>
311
  <?php if( is_singular() ) {
312
  if( is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
585
  if( $redux_builder_amp['amp-analytics-select-option']=='3' ) { ?>
586
  <amp-pixel src="<?php global $redux_builder_amp; echo $redux_builder_amp['pa-feild']; ?>"></amp-pixel>
587
  <?php }
588
+
589
+ // 10.4 Analytics Support added for quantcast
590
+ if ( $redux_builder_amp['amp-analytics-select-option']=='4' ) { ?>
591
+ <amp-analytics type="quantcast">
592
+ <script type="application/json">
593
+ {
594
+ "vars": {
595
+ "pcode": "<?php echo $redux_builder_amp['amp-quantcast-analytics-code']; ?>",
596
+ "labels": [ "AMPProject" ]
597
+ }
598
+ }
599
+ </script>
600
+ </amp-analytics>
601
+ <?php
602
+ }
603
+
604
+ // 10.5 Analytics Support added for comscore
605
+ if ( $redux_builder_amp['amp-analytics-select-option']=='5' ) { ?>
606
+ <amp-analytics type="comscore">
607
+ <script type="application/json">
608
+ {
609
+ "vars": {
610
+ "c1": "<?php echo $redux_builder_amp['amp-comscore-analytics-code-c1']; ?>",
611
+ "c2": "<?php echo $redux_builder_amp['amp-comscore-analytics-code-c2']; ?>"
612
+ }
613
+ }
614
+ </script>
615
+ </amp-analytics>
616
+ <?php
617
+ }
618
+
619
+
620
  }//analytics function ends here
621
 
622
  // 11. Strip unwanted codes and tags from the_content
830
 
831
  foreach ( $post_types as $post_type ) {
832
 
833
+ if( $post_type == 'amp-cta' ) {
834
+ continue;
835
+ }
836
+
837
  if( $post_type !== 'page' ) {
838
  add_meta_box( 'ampforwp_title_meta', __( 'Show AMP for Current Page?' ), 'ampforwp_title_callback', $post_type,'side' );
839
  }
1193
  if( is_single() || is_page() ){
1194
  global $post;
1195
  $title = $post->post_title;
1196
+ $site_title = $title . ' | ' . get_option( 'blogname' ) ;
1197
  }
1198
  // title for archive pages
1199
  if ( is_archive() && $redux_builder_amp['ampforwp-archive-support'] ) {
1200
+ $site_title = strip_tags(get_the_archive_title( '' ))
1201
+ . ' | ' .
1202
+ strip_tags(get_the_archive_description( '' ));
1203
  }
 
1204
  $site_title = get_bloginfo('name') . ' | ' . get_option( 'blogdescription' ) ;
1205
  if ( is_home() ) {
1206
  if ( $redux_builder_amp['amp-frontpage-select-option']== 1) {
1215
  $site_title .= ' | Page '.$current_url_in_pieces[$cnt-1];
1216
  }
1217
  }
 
1218
  }
 
1219
  if( is_search() ) {
1220
+ $site_title = $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();
1221
+ } ?>
1222
+ <?php
1223
+ if ( class_exists('WPSEO_Frontend') ) {
1224
+ $front = WPSEO_Frontend::get_instance();
1225
+ $title = $front->title($site_title);
1226
+ echo $title;
1227
+ } else {
1228
+ echo $site_title;
1229
  } ?>
1230
  </title>
1231
  <?php
1307
  function ampforwp_lazy_loading_plugins_compatibility() {
1308
 
1309
  //WP Rocket
1310
+ add_filter( 'do_rocket_lazyload', '__return_false', PHP_INT_MAX );
1311
+ add_filter( 'do_rocket_lazyload_iframes', '__return_false', PHP_INT_MAX );
1312
+ if ( ! defined( 'DONOTMINIFYCSS' ) ) {
1313
+ define( 'DONOTMINIFYCSS', TRUE );
1314
+ }
1315
+ if ( ! defined( 'DONOTMINIFYJS' ) ) {
1316
+ define( 'DONOTMINIFYJS', TRUE );
1317
+ }
1318
+ // Disable HTTP protocol removing on script, link, img, srcset and form tags.
1319
+ remove_filter( 'rocket_buffer', '__rocket_protocol_rewrite', PHP_INT_MAX );
1320
+ remove_filter( 'wp_calculate_image_srcset', '__rocket_protocol_rewrite_srcset', PHP_INT_MAX );
1321
+ // Disable Concatenate Google Fonts
1322
+ add_filter( 'get_rocket_option_minify_google_fonts', '__return_false', PHP_INT_MAX );
1323
+ // Disable CSS & JS magnification
1324
+ add_filter( 'get_rocket_option_minify_js', '__return_false', PHP_INT_MAX );
1325
+ add_filter( 'get_rocket_option_minify_css', '__return_false', PHP_INT_MAX );
1326
 
1327
  //Lazy Load XT
1328
  global $lazyloadxt;
1333
 
1334
  // Lazy Load
1335
  add_filter( 'lazyload_is_enabled', '__return_false', PHP_INT_MAX );
1336
+ }
1337
 
1338
+ add_action('amp_init','ampforwp_cache_compatible_activator');
1339
+ function ampforwp_cache_compatible_activator(){
1340
+ add_action('template_redirect','ampforwp_cache_plugin_compatible');
1341
+ }
1342
+ function ampforwp_cache_plugin_compatible(){
1343
+ $ampforwp_is_amp_endpoint = ampforwp_is_amp_endpoint();
1344
+ if ( ! $ampforwp_is_amp_endpoint ) {
1345
+ return;
1346
+ }
1347
+ /**
1348
+ * W3 total cache
1349
+ */
1350
+ add_filter( 'w3tc_minify_js_enable', array( $this, '_return_false' ) );
1351
+ add_filter( 'w3tc_minify_css_enable', array( $this, '_return_false' ) );
1352
  }
1353
 
1354
  //Removing bj loading for amp
1447
  function ampforwp_add_disqus_scripts( $data ) {
1448
  global $redux_builder_amp;
1449
  if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && is_singular() ) {
1450
+ if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
1451
+ if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
1452
+ $data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
1453
+ }
1454
  }
1455
  }
1456
  // remove direction attribute from the AMP HTMl #541
1604
 
1605
  // 43. custom actions for widgets output
1606
  add_action( 'ampforwp_home_above_loop' , 'ampforwp_output_widget_content_above_loop' );
1607
+ add_action( 'ampforwp_frontpage_above_loop' , 'ampforwp_output_widget_content_above_loop' );
1608
  function ampforwp_output_widget_content_above_loop() {
1609
  dynamic_sidebar( 'ampforwp-above-loop' );
1610
  }
1611
 
1612
  add_action( 'ampforwp_home_below_loop' , 'ampforwp_output_widget_content_below_loop' );
1613
+ add_action( 'ampforwp_frontpage_below_loop' , 'ampforwp_output_widget_content_below_loop' );
1614
  function ampforwp_output_widget_content_below_loop() {
1615
  dynamic_sidebar( 'ampforwp-below-loop' );
1616
  }
1751
  if( !function_exists('ampforwp_checking_any_social_profiles') ) {
1752
  function ampforwp_checking_any_social_profiles() {
1753
  global $redux_builder_amp;
1754
+ if(
1755
  $redux_builder_amp['enable-single-twittter-profile'] ||
1756
  $redux_builder_amp['enable-single-facebook-profile'] ||
1757
  $redux_builder_amp['enable-single-pintrest-profile'] ||
1762
  $redux_builder_amp['enable-single-VKontakte-profile'] ||
1763
  $redux_builder_amp['enable-single-reddit-profile'] ||
1764
  $redux_builder_amp['enable-single-snapchat-profile'] ||
1765
+ $redux_builder_amp['enable-single-Tumblr-profile']
1766
  ) {
1767
  return true;
1768
  }
1769
  return false;
1770
  }
1771
  }
1772
+
1773
+ // 50. Properly adding noditification Scritps the AMP way
1774
+ add_filter( 'amp_post_template_data', 'ampforwp_add_notification_scripts' );
1775
+ function ampforwp_add_notification_scripts( $data ) {
1776
+ global $redux_builder_amp;
1777
+
1778
+ if ( $redux_builder_amp['amp-enable-notifications'] == true ) {
1779
+ if ( empty( $data['amp_component_scripts']['amp-user-notification'] ) ) {
1780
+ $data['amp_component_scripts']['amp-user-notification'] = 'https://cdn.ampproject.org/v0/amp-user-notification-0.1.js';
1781
+ }
1782
+ }
1783
+
1784
+ return $data;
1785
+ }
1786
+
1787
+
1788
+ //51. Adding Digg Digg compatibility with AMP
1789
+ function ampforwp_dd_exclude_from_amp() {
1790
+ if(ampforwp_is_amp_endpoint()) {
1791
+ remove_filter('the_excerpt', 'dd_hook_wp_content');
1792
+ remove_filter('the_content', 'dd_hook_wp_content');
1793
+ }
1794
+ }
1795
+ add_action('template_redirect', 'ampforwp_dd_exclude_from_amp');
1796
+
1797
+ //52. Adding a generalized sanitizer function for purifiying normal html to amp-html
1798
+ function ampforwp_sanitize_archive_description() {
1799
+ $amp_custom_post_content_input = get_the_archive_description();
1800
+ if ( !empty( $amp_custom_post_content_input ) ) {
1801
+ $amp_custom_content = new AMP_Content( $amp_custom_post_content_input,
1802
+ apply_filters( 'amp_content_embed_handlers', array(
1803
+ 'AMP_Twitter_Embed_Handler' => array(),
1804
+ 'AMP_YouTube_Embed_Handler' => array(),
1805
+ 'AMP_Instagram_Embed_Handler' => array(),
1806
+ 'AMP_Vine_Embed_Handler' => array(),
1807
+ 'AMP_Facebook_Embed_Handler' => array(),
1808
+ 'AMP_Gallery_Embed_Handler' => array(),
1809
+ ) ),
1810
+ apply_filters( 'amp_content_sanitizers', array(
1811
+ 'AMP_Style_Sanitizer' => array(),
1812
+ 'AMP_Blacklist_Sanitizer' => array(),
1813
+ 'AMP_Img_Sanitizer' => array(),
1814
+ 'AMP_Video_Sanitizer' => array(),
1815
+ 'AMP_Audio_Sanitizer' => array(),
1816
+ 'AMP_Iframe_Sanitizer' => array(
1817
+ 'add_placeholder' => true,
1818
+ ),
1819
+ ) )
1820
+ );
1821
+
1822
+ if ( $amp_custom_content ) {
1823
+ global $data;
1824
+ $data['amp_component_scripts'] = $amp_custom_content->get_amp_scripts();
1825
+ $data['post_amp_styles'] = $amp_custom_content->get_amp_styles();
1826
+ return $amp_custom_content->get_amp_content();
1827
+ }
1828
+ return '';
1829
+ }
1830
+ }
1831
+
1832
+
1833
+ //53. Adding the Markup for AMP Woocommerce latest Products
1834
+ /*******************************
1835
+ Examples:
1836
+
1837
+ [amp-woocommerce num=5]
1838
+ [amp-woocommerce num=5 link=noamp]
1839
+ [amp-woocommerce num=5 link=amp]
1840
+ *******************************/
1841
+ function get_amp_latest_prodcuts_markup( $atts ) {
1842
+ // initializing these to avoid debug errors
1843
+ global $post;
1844
+
1845
+ $atts[] = shortcode_atts( array(
1846
+ 'num' => get_permalink($atts['num']),
1847
+ 'link' => get_permalink($atts['link'])
1848
+ ), $atts );
1849
+
1850
+ $exclude_ids = get_option('ampforwp_exclude_post');
1851
+ $number_of_latest_prcts = $atts['num'] ;
1852
+
1853
+ $q = new WP_Query( array(
1854
+ 'post_type' => 'product',
1855
+ 'orderby' => 'date',
1856
+ 'paged' => esc_attr($paged),
1857
+ 'post__not_in' => $exclude_ids,
1858
+ 'has_password' => false,
1859
+ 'post_status'=> 'publish',
1860
+ 'posts_per_page' => $number_of_latest_prcts
1861
+ ) );
1862
+
1863
+ if ( $q->have_posts() ) : $content .= '<ul class="ampforwp_wc_shortcode">';
1864
+ while ( $q->have_posts() ) : $q->the_post();
1865
+ if( $atts['link'] === 'amp' ) {
1866
+ $ampforwp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ;
1867
+ } else {
1868
+ $ampforwp_post_url = trailingslashit( get_permalink() ) ;
1869
+ }
1870
+ $content .= '<li class="ampforwp_wc_shortcode_child"><a href="'.$ampforwp_post_url.'">';
1871
+ global $redux_builder_amp;
1872
+ // $content .= '<div class="amp-wp-content ampforwp-wc-parent"><div class="amp-wp-content featured-image-content">';
1873
+ if ( has_post_thumbnail() ) {
1874
+ $thumb_id = get_post_thumbnail_id();
1875
+ $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
1876
+ $thumb_url = $thumb_url_array[0];
1877
+
1878
+ $content .= '<amp-img src='.$thumb_url.' width="150" height="150" ></amp-img>' ;
1879
+ }
1880
+ // $content .= '</div>';
1881
+ $content .= '<div class="ampforwp-wc-title">'.get_the_title().'</div>';
1882
+ if ( class_exists( 'WooCommerce' ) ) {
1883
+ // $content .= '<div class="ampforwp-wc-price">';
1884
+ global $woocommerce;
1885
+ $amp_product_price = $woocommerce->product_factory->get_product()->get_price_html();
1886
+ $context = '';
1887
+ $allowed_tags = wp_kses_allowed_html( $context );
1888
+
1889
+ if ( $amp_product_price ) {
1890
+ $content .= '<div class="ampforwp-wc-price">' . wp_kses( $amp_product_price, $allowed_tags ) .'</div>' ;
1891
+ } else {
1892
+ // $content .= "Sorry, this item is not for sale at the moment, please check out more products <a href=" . esc_url( home_url('/shop') ) . "> Here </a> " ;
1893
+ }
1894
+ }
1895
+ $content .= '</a></li>'; ?>
1896
+ <?php endwhile; $content .= '</ul>'; ?>
1897
+ <?php endif; ?>
1898
+ <?php wp_reset_postdata();
1899
+
1900
+ // Add AMP Woocommerce latest Products only on AMP Endpoint
1901
+ $endpoint_check = is_amp_endpoint();
1902
+ if ( $endpoint_check ) {
1903
+ return $content;
1904
+ }
1905
+ }
1906
+
1907
+ // Generating Short code for AMP Woocommerce latest Products
1908
+ function ampforwp_latest_products_register_shortcodes() {
1909
+ add_shortcode('amp-woocommerce', 'get_amp_latest_prodcuts_markup');
1910
+ }
1911
+ add_action( 'amp_init', 'ampforwp_latest_products_register_shortcodes');
1912
+
1913
+ // Adding the styling for AMP Woocommerce latest Products
1914
+ add_action('amp_post_template_css','amp_latest_products_styling',PHP_INT_MAX);
1915
+ function amp_latest_products_styling() { ?>
1916
+ .ampforwp_wc_shortcode{padding:0}
1917
+ .ampforwp_wc_shortcode li{ font-size:12px; line-height: 1; float: left;max-width: 150px;list-style-type: none;margin: 10px;}
1918
+ .single-post .ampforwp_wc_shortcode li amp-img{margin:0}
1919
+ .ampforwp-wc-title{ margin: 10px 0px; }
1920
+ .ampforwp-wc-price{ color:#444 }
1921
+ <?php }