AMP for WP – Accelerated Mobile Pages - Version 0.9.66

Version Description

(29th October 2017) = * View more details on https://ampforwp.com/0-9-66-released-bug-squashing-oct-2017-72nd-update/ * Design 3 & Design 1 are optimised with 90+ Google PageSpeed Score on Mobile and 95+ in desktop performance#1273 * Featured Image from the content for blog and homepage #1295 * Category Module for AMP Page builder added#888 * Don't load unused CSS selectors. All the CSS is conditionally loading, to decrease the number of CSS loaded per page and increased in performance #1292 * Twitter Video embed code support added in AMP #1307 * Video Posting Structured data #1293 * Navigation menus are now Schema compatible for better Structured data integration #1229 * Yoast checking conditions for Structured Data Improved #1293 * Added "back to Top" in design 3 #959 * Proper blog check and author for custom frontpage#1260 (Made some changes to check the blog properly and also added the author details for Custom Frontpage) * AMP not working on password-protected pages #1192 * Debug errors reported by the user #1284and few more we found internally * Inline Style Sanitizer for Comments to avoid any validation issues #1193 * Next/Previous links removed from pages#1268 props@Frenchomatic * WPML Multilingual CMS plugin flags compatibility added #1270 * Image sanitizer added for the Sidebar #1270 * Added AMP Components the correct way. Added amp-gist, amp-social-share.#336 * amp-video script added - Which decreases the non-critical validation issues#991 * Arrows in Design 3 pagination #1000 * Author page links in Single#1282 * Added previous open state of option panel and show again when search clean#1238 * Odnoklassniki Social Sharing Support for AMP (with target blank for better bounce rate)#1230 * GIF or animated images resize problem fixed #1281 * In Design1, Header Background & Link Color have same option #1249 * FB Pixel for AMP added #1231 * Structured Data Type option for AMPed Custom Post types only #1259 * Attribute readability in the tag div removed - this decreases the validation issues#1306 * AMP ThemeFramework Improvements: loop, author, related_post, Add Author support #1311 * Commentator's Avatar in the comments section #1132 * Remove 'Welcome to AMP' from Dashboard sub-menu and moved to the options area to decrease the annoyance and increase the user happiness#902 * Option to Sort the Random Order of Related Posts to increase the audience engagement (Default is 'ID', on enabling the option it will change to 'rand')#1250 * View AMP on Admin Bar for the respected page/post If enable. #1236 * google maps iframe link to larger map #1099 * Comments now jumping due to the slash at the end #1309 * Page Builder causes Incompatibility with the Divi theme (We restructured the Text Module for Page builder for better compatibilityand UX)#1162 * Inline Style Sanitizer for Comments added. Less Critical Validation issues and Better Presentation#1193 * WPML amp-html error fixed #1285 * Radio button not working for Show View more Button" #1018 * Added registered handle for tinymcePointer localize data #1301 * Date in the Design 2 should not be hidden in mobile version #1315 * Page builder not working on homepage(Selected as front page) #1316 * Instant articles number of posts option#1271 (Removed some unused code as well, it will rendered all posts if none is enter in the options) * Auto flush on save for FBIAto improve the UX. * Plain Permalinks Support improved. #1318 * Tables support added to FB Instant Articles #1266 * Demo link added in the Theme selector option #1248 * Remove invalid attributes from multiple tags which reduces critical validation errors and validates pages. * AMP makes a problem in archive page label, when it is active in non-amp version #1304 * placeholder-icon.png is 404 fixed#1310 * Category & Tags switches for Single added. #1055 * Copy Content (Custom AMP Editor) Option Not showing with Page Builder of SiteOrigin issue fixed#1280 * Improving UX with: when AMP support is off for a specific post type then all the AMP related metaboxes should be removed #1289 * Options Panel Options rearranged, labels rewritten, descriptions repositioned for better User interaction [commit]

Download this release

Release Info

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

Code changes from version 0.9.65.2 to 0.9.66

Files changed (85) hide show
  1. accelerated-moblie-pages.php +35 -19
  2. components/author-box/author-box.php +60 -23
  3. components/categories-tags/categories-tags.php +2 -1
  4. components/comments/comments.php +10 -2
  5. components/components-core.php +28 -4
  6. components/loop/loop.php +27 -18
  7. components/related-posts/related-posts.php +26 -10
  8. feeds/instant-article-feed.php +11 -10
  9. images/placeholder-icon.png +0 -0
  10. includes/admin-style.css +27 -1
  11. includes/options/admin-config.php +251 -111
  12. includes/options/redux-core/framework.php +17 -1
  13. includes/options/redux-core/inc/fields/select_image/field_select_image.js +14 -0
  14. includes/options/redux-core/inc/fields/select_image/field_select_image.php +15 -3
  15. includes/redirect.php +5 -1
  16. includes/vendor/amp/includes/class-amp-post-template.php +1 -1
  17. includes/vendor/amp/includes/sanitizers/class-amp-iframe-sanitizer.php +1 -1
  18. includes/vendor/amp/includes/sanitizers/class-amp-video-sanitizer.php +13 -0
  19. includes/vendor/tinymce-widget/includes/class-admin-pointer.php +2 -1
  20. includes/vendor/vendor-changelog.txt +9 -1
  21. includes/welcome.php +16 -11
  22. pagebuilder/amp-page-builder.php +13 -3
  23. pagebuilder/functions.php +28 -12
  24. pagebuilder/inc/admin-amp-page-builder.css +7 -2
  25. pagebuilder/inc/admin-amp-page-builder.js +145 -28
  26. pagebuilder/inc/js-templates.php +0 -1
  27. pagebuilder/modules/contents.php +107 -0
  28. readme.txt +57 -1
  29. templates/category-widget.php +18 -6
  30. templates/custom-amp-content-button.js +5 -1
  31. templates/custom-amp-content.php +10 -6
  32. templates/design-manager/design-1/archive.php +5 -11
  33. templates/design-manager/design-1/elements/comments.php +13 -6
  34. templates/design-manager/design-1/elements/content.php +1 -1
  35. templates/design-manager/design-1/elements/featured-image.php +3 -1
  36. templates/design-manager/design-1/elements/meta-info.php +8 -5
  37. templates/design-manager/design-1/elements/meta-taxonomy.php +17 -10
  38. templates/design-manager/design-1/elements/related-posts.php +24 -19
  39. templates/design-manager/design-1/elements/social-icons.php +7 -0
  40. templates/design-manager/design-1/fonts/Merriweather-Bold.ttf +0 -0
  41. templates/design-manager/design-1/fonts/Merriweather-BoldItalic.ttf +0 -0
  42. templates/design-manager/design-1/fonts/Merriweather-Italic.ttf +0 -0
  43. templates/design-manager/design-1/fonts/Merriweather-Regular.ttf +0 -0
  44. templates/design-manager/design-1/fonts/OFL.txt +93 -0
  45. templates/design-manager/design-1/footer.php +11 -4
  46. templates/design-manager/design-1/header-bar.php +14 -3
  47. templates/design-manager/design-1/index.php +28 -28
  48. templates/design-manager/design-1/search.php +5 -11
  49. templates/design-manager/design-1/style.php +48 -9
  50. templates/design-manager/design-2/archive.php +20 -26
  51. templates/design-manager/design-2/elements/comments.php +10 -4
  52. templates/design-manager/design-2/elements/content.php +1 -1
  53. templates/design-manager/design-2/elements/featured-image.php +5 -0
  54. templates/design-manager/design-2/elements/meta-info.php +6 -5
  55. templates/design-manager/design-2/elements/meta-taxonomy.php +7 -5
  56. templates/design-manager/design-2/elements/related-posts.php +24 -18
  57. templates/design-manager/design-2/elements/social-icons.php +7 -0
  58. templates/design-manager/design-2/footer.php +9 -3
  59. templates/design-manager/design-2/header-bar.php +16 -4
  60. templates/design-manager/design-2/index.php +19 -25
  61. templates/design-manager/design-2/search.php +6 -12
  62. templates/design-manager/design-2/style.php +23 -5
  63. templates/design-manager/design-3/archive.php +20 -25
  64. templates/design-manager/design-3/elements/comments.php +10 -4
  65. templates/design-manager/design-3/elements/content.php +1 -1
  66. templates/design-manager/design-3/elements/featured-image.php +2 -0
  67. templates/design-manager/design-3/elements/meta-info.php +10 -8
  68. templates/design-manager/design-3/elements/meta-taxonomy.php +9 -7
  69. templates/design-manager/design-3/elements/related-posts.php +24 -18
  70. templates/design-manager/design-3/elements/social-icons.php +7 -0
  71. templates/design-manager/design-3/fonts/ptserif/OFL.txt +94 -0
  72. templates/design-manager/design-3/fonts/ptserif/PT_Serif-Web-Bold.ttf +0 -0
  73. templates/design-manager/design-3/fonts/ptserif/PT_Serif-Web-Regular.ttf +0 -0
  74. templates/design-manager/design-3/fonts/robotoslab/LICENSE.txt +202 -0
  75. templates/design-manager/design-3/fonts/robotoslab/RobotoSlab-Bold.ttf +0 -0
  76. templates/design-manager/design-3/fonts/robotoslab/RobotoSlab-Regular.ttf +0 -0
  77. templates/design-manager/design-3/footer.php +15 -3
  78. templates/design-manager/design-3/functions.php +1 -5
  79. templates/design-manager/design-3/header-bar.php +22 -4
  80. templates/design-manager/design-3/index.php +27 -37
  81. templates/design-manager/design-3/search.php +8 -13
  82. templates/design-manager/design-3/style.php +59 -20
  83. templates/features.php +422 -104
  84. templates/instant-articles/instant-article-sanitizer.php +24 -0
  85. templates/structured-data.php +27 -0
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.65.2
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -18,19 +18,21 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
18
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
19
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
20
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
21
- define('AMPFORWP_VERSION','0.9.65.2');
22
 
23
  // any changes to AMP_QUERY_VAR should be refelected here
24
  function ampforwp_generate_endpoint(){
25
  $ampforwp_slug = '';
26
  $get_permalink_structure = '';
27
- $get_permalink_structure = get_option('permalink_structure');
28
 
29
- if(empty( $get_permalink_structure )) {
30
- $ampforwp_slug = '&amp=1';
31
- }else{
32
- $ampforwp_slug = "amp";
33
- }
 
 
34
  return $ampforwp_slug;
35
  }
36
 
@@ -196,11 +198,33 @@ function ampforwp_rewrite_activation() {
196
  global $wp_rewrite;
197
  $wp_rewrite->flush_rules();
198
 
 
 
199
  // Set transient for Welcome page
200
  set_transient( 'ampforwp_welcome_screen_activation_redirect', true, 30 );
201
 
202
  }
203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  register_deactivation_hook( __FILE__, 'ampforwp_rewrite_deactivate', 20 );
205
  function ampforwp_rewrite_deactivate() {
206
  // Flushing rewrite urls ONLY on deactivation
@@ -569,23 +593,15 @@ function ampforwp_update_notice() {
569
  text-decoration: none;
570
  font-size: 16px;
571
  line-height: 23px; font-weight: 300;"> Appreciate it? <br> <span style="font-size: 11px;text-transform: uppercase;" title="Give Us 5 Star">Leave a Review →</span></a>
572
-
573
- </div>
574
- </div>
575
-
576
-
577
- <?php
578
- //update_option( 'AMPforwp_db_version', $ampforWPCurrentVersion );
579
  }
580
-
581
  if(!defined('AMP_FRAMEWORK_COMOPNENT_DIR_PATH')){
582
  define('AMP_FRAMEWORK_COMOPNENT_DIR_PATH', plugin_dir_path( __FILE__ )."/components");
583
  }
584
-
585
  require_once( AMP_FRAMEWORK_COMOPNENT_DIR_PATH . '/components-core.php' );
586
  require_once( AMPFORWP_PLUGIN_DIR. 'pagebuilder/amp-page-builder.php' );
587
  require_once( AMPFORWP_PLUGIN_DIR. 'base_remover/base_remover.php' );
588
  require_once( AMPFORWP_PLUGIN_DIR. 'includes/thirdparty-compatibility.php' );
589
-
590
-
591
  require ( AMPFORWP_PLUGIN_DIR.'/install/index.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.66
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
18
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
19
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
20
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
21
+ define('AMPFORWP_VERSION','0.9.66');
22
 
23
  // any changes to AMP_QUERY_VAR should be refelected here
24
  function ampforwp_generate_endpoint(){
25
  $ampforwp_slug = '';
26
  $get_permalink_structure = '';
27
+ //$get_permalink_structure = get_option('permalink_structure');
28
 
29
+ // if(empty( $get_permalink_structure )) {
30
+ // $ampforwp_slug = '&amp=1';
31
+ // }else{
32
+ // $ampforwp_slug = "amp";
33
+ // }
34
+ $ampforwp_slug = "amp";
35
+
36
  return $ampforwp_slug;
37
  }
38
 
198
  global $wp_rewrite;
199
  $wp_rewrite->flush_rules();
200
 
201
+ delete_option('ampforwp_rewrite_flush_option');
202
+
203
  // Set transient for Welcome page
204
  set_transient( 'ampforwp_welcome_screen_activation_redirect', true, 30 );
205
 
206
  }
207
 
208
+ add_action('init', 'ampforwp_flush_rewrite_by_option', 20);
209
+
210
+ function ampforwp_flush_rewrite_by_option(){
211
+
212
+ global $wp_rewrite;
213
+ $get_current_permalink_settings = "";
214
+
215
+ $get_current_permalink_settings = get_option('ampforwp_rewrite_flush_option');
216
+
217
+ if ( $get_current_permalink_settings ) {
218
+ return;
219
+ }
220
+ // Adding double check to make sure, we are not updating and calling database unnecessarily
221
+ if ( empty( $get_current_permalink_settings )){
222
+ $wp_rewrite->flush_rules();
223
+ update_option('ampforwp_rewrite_flush_option', 'true');
224
+ }
225
+
226
+ }
227
+
228
  register_deactivation_hook( __FILE__, 'ampforwp_rewrite_deactivate', 20 );
229
  function ampforwp_rewrite_deactivate() {
230
  // Flushing rewrite urls ONLY on deactivation
593
  text-decoration: none;
594
  font-size: 16px;
595
  line-height: 23px; font-weight: 300;"> Appreciate it? <br> <span style="font-size: 11px;text-transform: uppercase;" title="Give Us 5 Star">Leave a Review →</span></a>
596
+ </div></div>
597
+ <?php
598
+ //update_option( 'AMPforwp_db_version', $ampforWPCurrentVersion );
 
 
 
 
599
  }
 
600
  if(!defined('AMP_FRAMEWORK_COMOPNENT_DIR_PATH')){
601
  define('AMP_FRAMEWORK_COMOPNENT_DIR_PATH', plugin_dir_path( __FILE__ )."/components");
602
  }
 
603
  require_once( AMP_FRAMEWORK_COMOPNENT_DIR_PATH . '/components-core.php' );
604
  require_once( AMPFORWP_PLUGIN_DIR. 'pagebuilder/amp-page-builder.php' );
605
  require_once( AMPFORWP_PLUGIN_DIR. 'base_remover/base_remover.php' );
606
  require_once( AMPFORWP_PLUGIN_DIR. 'includes/thirdparty-compatibility.php' );
 
 
607
  require ( AMPFORWP_PLUGIN_DIR.'/install/index.php' );
components/author-box/author-box.php CHANGED
@@ -1,31 +1,38 @@
1
  <?php
2
- function ampforwp_framework_get_author_box( $author_url,$args=array()){
3
- global $post, $redux_builder_amp;
4
- $author_avatar_url = $author_url;
5
  $post_author = get_userdata($post->post_author);
6
- if($author_avatar_url == null){
7
- $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 70 ) );
8
  }
9
- $avatar_width = 40;
10
- $avatar_height = 40;
11
- $author_description = true;
12
- if(isset($args['avatar_width'])){
13
- $avatar_width = $args['avatar_width'];
 
 
 
 
 
 
 
 
 
14
  }
15
- if(isset($args['avatar_height'])){
16
- $avatar_height = $args['avatar_height'];
17
  }
18
  if(isset($args['author_description'])){
19
  $author_description = $args['author_description'];
20
  }
21
 
22
 
23
- $author_prefix = $author_wrapper_class = '';
24
- $author_link = '#';
25
  if(isset( $args['author_prefix'])){
26
- $author_prefix = $args['author_prefix'];
27
  }
28
- $suffix = ampforwp_translation($redux_builder_amp['amp-translator-by-text'] , $author_prefix );
 
29
  if(isset( $args['author_link'])){
30
  $author_link = $args['author_link'];
31
  }
@@ -33,14 +40,44 @@ if(isset( $args['author_wrapper_class'])){
33
  $author_wrapper_class = $args['author_wrapper_class'];
34
  }
35
 
 
 
 
 
 
 
 
 
 
 
36
  ?>
37
- <div class="amp-author">
38
- <amp-img src="<?php echo $author_avatar_url; ?>" width="<?php echo $avatar_width; ?>" height="<?php echo $avatar_height; ?>" layout="fixed"></amp-img>
39
-
40
- <?php echo '<span class="'. $author_wrapper_class .'">'.$suffix . '<a href="'. $author_link.'"> ' .esc_html( $post_author->display_name ).'</a></span>'; ?>
41
- <?php if($author_description){
42
- echo $post_author->description;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  } ?>
44
- <span class="posted-time"><?php echo esc_html( get_the_date() ); ?></span>
45
  </div>
46
  <?php }
1
  <?php
2
+ function ampforwp_framework_get_author_box($args=array()){
3
+ global $post, $redux_builder_amp;
 
4
  $post_author = get_userdata($post->post_author);
5
+ if(! is_array($args) ){
6
+ $args = array();
7
  }
8
+
9
+ $avatar = false; //To show author Avater
10
+ $avatar_size = 40;
11
+ $author_description = false;
12
+ $class = $author_prefix = $author_wrapper_class = '';
13
+ $show_date = false;
14
+ $show_time = false;
15
+ $author_link = get_author_posts_url($post_author->ID);
16
+
17
+ if(isset($args['avatar'])){
18
+ $avatar = $args['avatar'];
19
+ }
20
+ if(isset($args['avatar_size'])){
21
+ $avatar_size = $args['avatar_size'];
22
  }
23
+ if(isset($args['class'])){
24
+ $class = $args['class'];
25
  }
26
  if(isset($args['author_description'])){
27
  $author_description = $args['author_description'];
28
  }
29
 
30
 
 
 
31
  if(isset( $args['author_prefix'])){
32
+ $author_prefix = $args['author_prefix'];
33
  }
34
+ //$author_prefix = ampforwp_translation($redux_builder_amp['amp-translator-by-text'] , $author_prefix );
35
+
36
  if(isset( $args['author_link'])){
37
  $author_link = $args['author_link'];
38
  }
40
  $author_wrapper_class = $args['author_wrapper_class'];
41
  }
42
 
43
+ if(isset($args['author_image_wrapper'])){
44
+ $author_image_wrapper = $args['author_image_wrapper'];
45
+ }
46
+ if(isset($args['show_date'])){
47
+ $show_date = $args['show_date'];
48
+ }
49
+ if(isset($args['show_time'])){
50
+ $show_time = $args['show_time'];
51
+ }
52
+
53
  ?>
54
+ <div class="amp-author <?php echo $class; ?>">
55
+ <?php if($avatar){
56
+ $author_avatar_url = get_avatar_url( $post_author->ID, array( 'size' => $avatar_size ) );
57
+ ?>
58
+ <div class="amp-author-image <?php echo $author_image_wrapper; ?>">
59
+ <amp-img src="<?php echo $author_avatar_url; ?>" width="<?php echo $avatar_size; ?>" height="<?php echo $avatar_size; ?>" layout="fixed"></amp-img>
60
+ </div>
61
+ <?php } ?>
62
+ <?php echo '<div class="author-details '. $author_wrapper_class .'">
63
+ <span class="author-name">'
64
+ .$author_prefix . ' <a href="'. $author_link.AMPFORWP_AMP_QUERY_VAR.'"> ' .esc_html( $post_author->display_name ).'</a>
65
+ </span>';
66
+
67
+ //to show date and time
68
+ if($show_date || $show_time){
69
+ echo '<span class="posted-time"> ';
70
+ if($show_date){
71
+ echo esc_html( get_the_date() ) . ' ';
72
+ }
73
+ if($show_time){
74
+ echo esc_html( get_the_time());
75
+ }
76
+ echo '</span>';
77
+ }
78
+ if($author_description){
79
+ echo "<p>".$post_author->description."</p>";
80
  } ?>
81
+ </div>
82
  </div>
83
  <?php }
components/categories-tags/categories-tags.php CHANGED
@@ -5,6 +5,7 @@ TODO: 1: Connect with options panel(archive support and translational panel)
5
  */
6
  global $post;
7
  function ampforwp_framework_get_categories_list(){
 
8
  $ampforwp_categories = get_the_terms( $post->ID, 'category' );
9
  if ( $ampforwp_categories ) : ?>
10
  <div class="amp-category">
@@ -20,7 +21,7 @@ function ampforwp_framework_get_categories_list(){
20
  <?php endif;
21
  }
22
  function ampforwp_framework_get_tags_list(){
23
-
24
  $ampforwp_tags= get_the_terms( $post->ID, 'post_tag' );
25
  if ( $ampforwp_tags && ! is_wp_error( $ampforwp_tags ) ) :?>
26
  <div class="amp-tags">
5
  */
6
  global $post;
7
  function ampforwp_framework_get_categories_list(){
8
+ global $post;
9
  $ampforwp_categories = get_the_terms( $post->ID, 'category' );
10
  if ( $ampforwp_categories ) : ?>
11
  <div class="amp-category">
21
  <?php endif;
22
  }
23
  function ampforwp_framework_get_tags_list(){
24
+ global $post;
25
  $ampforwp_tags= get_the_terms( $post->ID, 'post_tag' );
26
  if ( $ampforwp_tags && ! is_wp_error( $ampforwp_tags ) ) :?>
27
  <div class="amp-tags">
components/comments/comments.php CHANGED
@@ -33,11 +33,17 @@ else {
33
  function ampforwp_custom_translated_comment($comment, $args, $depth){
34
  $GLOBALS['comment'] = $comment;
35
  global $redux_builder_amp;
 
 
 
36
  ?>
37
  <li id="li-comment-<?php comment_ID() ?>"
38
  <?php comment_class(); ?> >
39
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
40
  <footer class="comment-meta">
 
 
 
41
  <div class="comment-author vcard">
42
  <?php
43
  printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
@@ -53,8 +59,10 @@ else {
53
  <?php
54
  $comment_content = get_comment_text();
55
  $comment_content = wpautop( $comment_content );
56
- $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(),
57
- 'AMP_Video_Sanitizer' => array() ) ) );
 
 
58
  $sanitized_comment_content = $sanitizer->get_amp_content();
59
  echo make_clickable( $sanitized_comment_content ); ?>
60
  </div>
33
  function ampforwp_custom_translated_comment($comment, $args, $depth){
34
  $GLOBALS['comment'] = $comment;
35
  global $redux_builder_amp;
36
+ $comment_author_img_url = "";
37
+ $comment_author_img_url = ampforwp_get_comments_gravatar( $comment );
38
+
39
  ?>
40
  <li id="li-comment-<?php comment_ID() ?>"
41
  <?php comment_class(); ?> >
42
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
43
  <footer class="comment-meta">
44
+ <?php if($comment_author_img_url){ ?>
45
+ <amp-img src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
46
+ <?php } ?>
47
  <div class="comment-author vcard">
48
  <?php
49
  printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
59
  <?php
60
  $comment_content = get_comment_text();
61
  $comment_content = wpautop( $comment_content );
62
+ $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array(
63
+ 'AMP_Img_Sanitizer' => array(),
64
+ 'AMP_Video_Sanitizer' => array(),
65
+ 'AMP_Style_Sanitizer' => array() ) ) );
66
  $sanitized_comment_content = $sanitizer->get_amp_content();
67
  echo make_clickable( $sanitized_comment_content ); ?>
68
  </div>
components/components-core.php CHANGED
@@ -93,6 +93,30 @@ function amp_title(){
93
  }
94
  }
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
 
97
  //Menus
98
  function amp_menu(){
@@ -134,10 +158,10 @@ function amp_featured_image( ){
134
  }
135
 
136
  // Author Box
137
- function amp_author_box( $author_url="",$args=array() ){
138
  global $loadComponent;
139
  if(isset($loadComponent['AMP-author-box']) && $loadComponent['AMP-author-box']==true){
140
- ampforwp_framework_get_author_box($author_url, $args);
141
  }
142
  }
143
 
@@ -173,10 +197,10 @@ function amp_post_navigation( ){
173
  }
174
 
175
  // Related Posts
176
- function amp_related_posts( ){
177
  global $loadComponent;
178
  if(isset($loadComponent['AMP-related-posts']) && $loadComponent['AMP-related-posts']==true){
179
- echo ampforwp_framework_get_related_posts( );
180
  }
181
  }
182
 
93
  }
94
  }
95
 
96
+ // Excerpt
97
+ function amp_excerpt(){
98
+ global $redux_builder_amp, $post;
99
+ $ID = '';
100
+ if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1){
101
+ if( $redux_builder_amp['ampforwp-title-on-front-page'] ) {
102
+ $ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
103
+ }
104
+ }
105
+ else
106
+ $ID = $post->ID;
107
+ if( $ID!=null ){ ?>
108
+ <p><?php
109
+ if(has_excerpt()){
110
+ $content = get_the_excerpt();
111
+ }else{
112
+ $content = get_the_content();
113
+ }
114
+ echo wp_trim_words( strip_shortcodes( $content ) , '15' );
115
+ ?></p>
116
+ <?php
117
+ }
118
+ }
119
+
120
 
121
  //Menus
122
  function amp_menu(){
158
  }
159
 
160
  // Author Box
161
+ function amp_author_box($args=array() ){
162
  global $loadComponent;
163
  if(isset($loadComponent['AMP-author-box']) && $loadComponent['AMP-author-box']==true){
164
+ ampforwp_framework_get_author_box($args);
165
  }
166
  }
167
 
197
  }
198
 
199
  // Related Posts
200
+ function amp_related_posts($argsdata = array()){
201
  global $loadComponent;
202
  if(isset($loadComponent['AMP-related-posts']) && $loadComponent['AMP-related-posts']==true){
203
+ echo ampforwp_framework_get_related_posts( $argsdata);
204
  }
205
  }
206
 
components/loop/loop.php CHANGED
@@ -72,6 +72,20 @@ function call_loops_standard($data=array()){
72
  'post_status' => 'publish'
73
  );
74
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  if(isset($data['post_to_show']) && $data['post_to_show']>0){
76
  $args['posts_per_page'] = $data['post_to_show'];
77
  }
@@ -177,13 +191,16 @@ function call_loops_standard($data=array()){
177
  echo '</'.$tag.'>';
178
  }
179
 
180
- function amp_loop_date(){
181
  global $redux_builder_amp;
182
- $post_date = human_time_diff(
 
 
 
183
  get_the_time('U', get_the_ID() ),
184
  current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],
185
  'ago');
186
-
187
  echo '<div class="loop-date">'.$post_date.'</div>';
188
  }
189
 
@@ -254,7 +271,7 @@ function call_loops_standard($data=array()){
254
  echo ' <ul class="loop-category">';
255
  if(count(get_the_category()) > 0){
256
  foreach((get_the_category()) as $category) {
257
- echo '<li class="amp-cat-'. $category->term_id.'">'. $category->cat_name.'</li>';
258
  }
259
  }
260
  echo '</ul>';
@@ -262,20 +279,12 @@ function call_loops_standard($data=array()){
262
  // author
263
  function amp_loop_author($args = array()){
264
  global $redux_builder_amp;
265
- //
266
- $author_prefix = $author_wrapper_class = '';
267
- $author_link = '#';
268
- if(isset( $args['author_prefix'])){
269
- $author_prefix = $args['author_prefix'];
270
- }
271
- $suffix = ampforwp_translation($redux_builder_amp['amp-translator-by-text'] , $author_prefix );
272
- if(isset( $args['author_link'])){
273
- $author_link = $args['author_link'];
274
- }
275
- if(isset( $args['author_wrapper_class'])){
276
- $author_wrapper_class = $args['author_wrapper_class'];
277
- }
278
- echo '<span class="'. $author_wrapper_class .'">'.$suffix . '<a href="'. $author_link.'"> ' .get_the_author().'</a></span>';
279
  }
280
 
281
 
72
  'post_status' => 'publish'
73
  );
74
  }
75
+ if(is_author()){
76
+ $exclude_ids = get_option('ampforwp_exclude_post');
77
+ $author = get_user_by( 'slug', get_query_var( 'author_name' ) );
78
+ $args = array(
79
+ 'author' => $author->ID,
80
+ 'post_type' => 'post',
81
+ 'orderby' => 'date',
82
+ 'ignore_sticky_posts' => 1,
83
+ 'paged' => esc_attr($paged),
84
+ 'post__not_in' => $exclude_ids,
85
+ 'has_password' => false ,
86
+ 'post_status'=> 'publish'
87
+ );
88
+ }
89
  if(isset($data['post_to_show']) && $data['post_to_show']>0){
90
  $args['posts_per_page'] = $data['post_to_show'];
91
  }
191
  echo '</'.$tag.'>';
192
  }
193
 
194
+ function amp_loop_date($args=array()){
195
  global $redux_builder_amp;
196
+ if(isset($args['format']) && $args['format']=='traditional'){
197
+ $post_date = esc_html( get_the_date() ) . ' '.esc_html( get_the_time());
198
+ }else{
199
+ $post_date = human_time_diff(
200
  get_the_time('U', get_the_ID() ),
201
  current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],
202
  'ago');
203
+ }
204
  echo '<div class="loop-date">'.$post_date.'</div>';
205
  }
206
 
271
  echo ' <ul class="loop-category">';
272
  if(count(get_the_category()) > 0){
273
  foreach((get_the_category()) as $category) {
274
+ echo '<li class="amp-cat-'. $category->term_id.'"><a href="'.get_category_link($category->term_id).AMPFORWP_AMP_QUERY_VAR.'">'. $category->cat_name.'</a></li>';
275
  }
276
  }
277
  echo '</ul>';
279
  // author
280
  function amp_loop_author($args = array()){
281
  global $redux_builder_amp;
282
+ if(function_exists('ampforwp_framework_get_author_box')){
283
+ ampforwp_framework_get_author_box($args);
284
+ }else{
285
+ echo "";
286
+ }
287
+
 
 
 
 
 
 
 
 
288
  }
289
 
290
 
components/related-posts/related-posts.php CHANGED
@@ -1,8 +1,13 @@
1
  <?php
2
- function ampforwp_framework_get_related_posts(){
 
 
 
 
3
  global $post, $redux_builder_amp;
4
  do_action('ampforwp_above_related_post',$this); //Above Related Posts
5
- $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts']; $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
 
6
  $args = null;
7
 
8
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
@@ -62,14 +67,25 @@ function ampforwp_framework_get_related_posts(){
62
  </a>
63
  <div class="related_link">
64
  <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
65
- <?php if(has_excerpt()){
66
- $content = get_the_excerpt();
67
- }else{
68
- $content = get_the_content();
69
- }
70
- ?>
71
- <p><?php echo wp_trim_words( strip_shortcodes( $content ) , '15' ); ?></p>
72
- </div>
 
 
 
 
 
 
 
 
 
 
 
73
  </li>
74
  <?php
75
  }
1
  <?php
2
+ /*
3
+ @data parameter have options for
4
+ show_excerpt
5
+ */
6
+ function ampforwp_framework_get_related_posts($argsdata=array()){
7
  global $post, $redux_builder_amp;
8
  do_action('ampforwp_above_related_post',$this); //Above Related Posts
9
+ $string_number_of_related_posts = $redux_builder_amp['ampforwp-number-of-related-posts'];
10
+ $int_number_of_related_posts = round(abs(floatval($string_number_of_related_posts)));
11
  $args = null;
12
 
13
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
67
  </a>
68
  <div class="related_link">
69
  <a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
70
+
71
+ <?php
72
+ $show_excerpt = (isset($argsdata['show_excerpt'])? $argsdata['show_excerpt'] : true);
73
+ if($show_excerpt){
74
+ if(has_excerpt()){
75
+ $content = get_the_excerpt();
76
+ }else{
77
+ $content = get_the_content();
78
+ }
79
+ ?><p><?php
80
+ echo wp_trim_words( strip_shortcodes( $content ) , '15' );
81
+ ?></p><?php
82
+ }
83
+ $show_author = (isset($argsdata['show_author'])? $argsdata['show_author'] : true);
84
+ if($show_author){
85
+ $author_args = isset($argsdata['author_args'])? $argsdata['author_args'] : array();
86
+ ampforwp_framework_get_author_box($author_args);
87
+ }
88
+ ?></div>
89
  </li>
90
  <?php
91
  }
feeds/instant-article-feed.php CHANGED
@@ -14,23 +14,24 @@
14
  <language><?php bloginfo_rss( 'language' ); ?></language>
15
 
16
  <?php
 
 
 
 
 
 
 
 
 
17
  $args = array(
18
- 'meta_query' => $meta_query,
19
  'post_status' => 'publish',
20
- 'ignore_sticky_posts' => 1
 
21
  );
22
  $query = new WP_Query( $args );
23
- $rendered_posts = 0;
24
-
25
  while( $query->have_posts() ) :
26
 
27
  $query->the_post();
28
-
29
- // only show up to 50 rendered posts
30
- $rendered_posts += 1;
31
- if ( $rendered_posts > 50 ) {
32
- break;
33
- }
34
  ?>
35
 
36
  <item>
14
  <language><?php bloginfo_rss( 'language' ); ?></language>
15
 
16
  <?php
17
+ global $redux_builder_amp;
18
+ $number_of_articles = '';
19
+ if( isset( $redux_builder_amp['ampforwp-fb-instant-article-posts'] ) && $redux_builder_amp['ampforwp-fb-instant-article-posts'] ){
20
+ $number_of_articles = $redux_builder_amp['ampforwp-fb-instant-article-posts'];
21
+ $number_of_articles = round( abs( floatval( $number_of_articles ) ) );
22
+ }
23
+ else{
24
+ $number_of_articles = -1;
25
+ }
26
  $args = array(
 
27
  'post_status' => 'publish',
28
+ 'ignore_sticky_posts' => 1,
29
+ 'posts_per_page' => $number_of_articles
30
  );
31
  $query = new WP_Query( $args );
 
 
32
  while( $query->have_posts() ) :
33
 
34
  $query->the_post();
 
 
 
 
 
 
35
  ?>
36
 
37
  <item>
images/placeholder-icon.png ADDED
Binary file
includes/admin-style.css CHANGED
@@ -106,4 +106,30 @@ body #toplevel_page_amp_options .wp-menu-image{
106
  float: right;
107
  margin-top: 0px;
108
  }
109
- .meta-radio-two{margin-right: 8px; top: 3px; position: relative;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  float: right;
107
  margin-top: 0px;
108
  }
109
+ .meta-radio-two{margin-right: 8px; top: 3px; position: relative;}
110
+ #wp-admin-bar-ampforwp-view-amp a, #wp-admin-bar-ampforwp-view-amp:hover a{
111
+ background-size: 18px !important;background-repeat: no-repeat !important;background-position: 4px 7px !important;text-indent: -99999px;width: 12px; background:
112
+ url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjMxNHB4IiBoZWlnaHQ9IjMxNXB4IiB2aWV3Qm94PSIwIDAgMzE0IDMxNSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNDEgKDM1MzI2KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5TaGFwZTwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSIjODI4NzhjIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSIyNjA3MSIgZmlsbD0iIzgyODc4YyI+CiAgICAgICAgICAgIDxnIGlkPSJDYXBhXzEiPgogICAgICAgICAgICAgICAgPGcgaWQ9Il94MzJfNDAuX1Bvd2VyIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTU3LjAwNywwIEM3MC4yOTIsMCAwLDcwLjI5MiAwLDE1Ny4wMDcgQzAsMjQzLjcxNSA3MC4yOTIsMzE0LjAxNCAxNTcuMDA3LDMxNC4wMTQgQzI0My43MTYsMzE0LjAxNCAzMTQuMDE0LDI0My43MTUgMzE0LjAxNCwxNTcuMDA3IEMzMTQuMDE0LDcwLjI5MiAyNDMuNzE2LDAgMTU3LjAwNywwIFogTTE1Ny4wMDcsMjgyLjYxMiBDODcuNjM0LDI4Mi42MTIgMzEuNDAyLDIyNi4zNzIgMzEuNDAyLDE1Ny4wMDcgQzMxLjQwMiw4Ny42MzQgODcuNjM0LDMxLjQwMiAxNTcuMDA3LDMxLjQwMiBDMjI2LjM3MSwzMS40MDIgMjgyLjYxMSw4Ny42MzQgMjgyLjYxMSwxNTcuMDA3IEMyODIuNjEyLDIyNi4zNzIgMjI2LjM3MiwyODIuNjEyIDE1Ny4wMDcsMjgyLjYxMiBaIE0yMDQuMTExLDE0MS4zNjggTDE2My40NzksMTQxLjUzMyBDMTU5LjEzOSwxNDEuNTUzIDE1Ny41NDQsMTM4LjYyMyAxNTkuOTA1LDEzNC45NzkgTDIwMy4zOTcsNjguMTA5IEMyMDguMTI2LDYwLjg0MSAyMDYuOTg0LDU5LjkyMiAyMDAuODYxLDY2LjA1MyBMMTA1LjMwNSwxNjEuNiBDOTkuMTcyLDE2Ny43MzIgMTAxLjIzMiwxNzIuNjc2IDEwOS45MDYsMTcyLjY0MSBMMTQyLjY3OSwxNzIuNTA4IEMxNTEuMzQ3LDE3Mi40NzIgMTU0LjU1MiwxNzguMzM1IDE0OS44MjQsMTg1LjYwNSBMMTA2LjMzNCwyNTIuNDc3IEMxMDMuOTcyLDI1Ni4xMTIgMTA0LjU0MiwyNTYuNTgxIDEwNy42MiwyNTMuNTI3IEwxNzUuOTE1LDE4NS43MTcgQzE3OC45ODgsMTgyLjY1OSAxODMuOTUsMTc3LjY4NiAxODYuOTgzLDE3NC41OTYgTDIwOC43ODgsMTUyLjQ4NSBDMjE0Ljg3NSwxNDYuMzE3IDIxMi43NzUsMTQxLjMzIDIwNC4xMTEsMTQxLjM2OCBaIiBpZD0iU2hhcGUiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+)
113
+ no-repeat
114
+ 4px 7px;
115
+
116
+ }
117
+ .amp-theme-selector-img a{
118
+ background: rgba(0, 0, 0, 0.7);
119
+ text-decoration: none;
120
+ padding: 3px 8px 4px 7px;
121
+ bottom: 16px;
122
+ font-size: 12px;
123
+ border-radius: 100px;
124
+ color: #fff;
125
+ position: relative;
126
+ right: 62px;
127
+ }
128
+ .amp-theme-selector-img:hover a {
129
+ background: #4452a7;
130
+ }
131
+ .amp-theme-selector-img img{
132
+ position: relative;
133
+ visibility: visible;
134
+ cursor:pointer;
135
+ }
includes/options/admin-config.php CHANGED
@@ -457,9 +457,9 @@ Redux::setArgs( "redux_builder_amp", $args );
457
  'id' =>'amp-on-off-for-all-pages',
458
  'type' => 'switch',
459
  'title' => __('Pages', 'accelerated-mobile-pages'),
460
- 'subtitle' => __('Enable AMP Support on Pages', 'accelerated-mobile-pages'),
461
  'default' => 1,
462
- 'desc' => __( 'Re-Save permalink if you make changes in this option, please have a look <a href="https://ampforwp.com/flush-rewrite-urls/">here</a> on how to do it', 'accelerated-mobile-pages' ),
463
  ),
464
  array(
465
  'id' => 'ampforwp-homepage-on-off-support',
@@ -918,7 +918,7 @@ Redux::setArgs( "redux_builder_amp", $args );
918
  'id' => 'ampforwp-robots-archive-sub-pages-sitewide',
919
  'type' => 'switch',
920
  'title' => __('Archive subpages (sitewide)', 'accelerated-mobile-pages'),
921
- 'desc' => __("Such as /page/2 so on and so forth",'accelerated-mobile-pages'),
922
  'default' => 0,
923
  'on' => 'index',
924
  'off' => 'noindex'
@@ -1176,10 +1176,10 @@ Redux::setArgs( "redux_builder_amp", $args );
1176
  'title' => __('Tag Manager ID (Container ID)','accelerated-mobile-pages'),
1177
  'default' => '',
1178
  'desc' => __('Eg: GTM-5XXXXXP (<a href="https://ampforwp.com/tutorials/article/gtm-in-amp/">Getting Started?</a>)','accelerated-mobile-pages'),
1179
- // 'validate' => 'not_empty',
1180
- 'required' => array(
1181
- array('amp-use-gtm-option', '=' , '1')
1182
- ),
1183
  ),
1184
  array(
1185
  'id' =>'amp-gtm-analytics-type',
@@ -1187,10 +1187,10 @@ Redux::setArgs( "redux_builder_amp", $args );
1187
  'title' => __('Analytics Type','accelerated-mobile-pages'),
1188
  'default' => '',
1189
  'desc' => __('Eg: googleanalytics','accelerated-mobile-pages'),
1190
- // 'validate' => 'not_empty',
1191
- 'required' => array(
1192
- array('amp-use-gtm-option', '=' , '1')
1193
- ),
1194
  ),
1195
  array(
1196
  'id' =>'amp-gtm-analytics-code',
@@ -1199,8 +1199,24 @@ Redux::setArgs( "redux_builder_amp", $args );
1199
  'default' => '',
1200
  'desc' => 'Eg: UA-XXXXXX-Y',
1201
  // 'validate' => 'not_empty',
1202
- 'required' => array(
1203
- array('amp-use-gtm-option', '=' , '1')),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1204
  ),
1205
 
1206
  )
@@ -1215,6 +1231,7 @@ Redux::setArgs( "redux_builder_amp", $args );
1215
  'NewsArticle' => 'NewsArticle',
1216
  'Recipe' => 'Recipe',
1217
  'Product' => 'Product',
 
1218
  );
1219
  return $options;
1220
  }
@@ -1228,6 +1245,9 @@ Redux::setArgs( "redux_builder_amp", $args );
1228
  $post_types = get_option('ampforwp_custom_post_types');
1229
  if($post_types){
1230
  foreach ($post_types as $post_type) {
 
 
 
1231
  $custom_fields[] = array(
1232
  'id' => 'ampforwp-sd-type-'. $post_type,
1233
  'type' => 'select',
@@ -1319,6 +1339,14 @@ Redux::setArgs( "redux_builder_amp", $args );
1319
  'subtitle' => __('Please don\'t add "PX" in the image size.','accelerated-mobile-pages'),
1320
  'default' => '550'
1321
  ),
 
 
 
 
 
 
 
 
1322
  )
1323
  )
1324
  ) );
@@ -1423,7 +1451,7 @@ $forms_support[]= array(
1423
  array(
1424
  'id' => 'ampforwp-number-of-comments',
1425
  'type' => 'text',
1426
- 'desc' => __('This refers to the normal comments','accelerated-mobile-pages'),
1427
  'title' => __('No of Comments', 'accelerated-mobile-pages'),
1428
  'default' => 10,
1429
  'required' => array('wordpress-comments-support' , '=' , 1
@@ -1472,7 +1500,7 @@ $forms_support[]= array(
1472
  array(
1473
  'id' => 'ampforwp-number-of-fb-no-of-comments',
1474
  'type' => 'text',
1475
- 'desc' => __('Enter the number of comments','accelerated-mobile-pages'),
1476
  'title' => __('No of Comments', 'accelerated-mobile-pages'),
1477
  'default' => 10,
1478
  'required' => array(
@@ -1484,13 +1512,18 @@ $forms_support[]= array(
1484
  )
1485
  ) );
1486
 
1487
- function fb_instant_article(){
1488
  $feedname = '';
1489
  $fb_instant_article_feed = '';
1490
- $feedname = 'instant_articles';
 
 
1491
  $fb_instant_article_feed = trailingslashit( site_url() ).$feedname ;
1492
- return esc_url( $fb_instant_article_feed );
 
 
1493
  }
 
1494
  // Facebook Instant Articles
1495
  Redux::setSection( $opt_name, array(
1496
  'title' => __( 'Facebook Instant Articles', 'accelerated-mobile-pages' ),
@@ -1513,6 +1546,14 @@ Redux::setSection( $opt_name, array(
1513
  'desc' => fb_instant_article(),
1514
  'title' => __('Facebook Instant Articles Feed URL', 'accelerated-mobile-pages'),
1515
  'required' => array('fb-instant-article-switch', '=', 1)
 
 
 
 
 
 
 
 
1516
  ),
1517
  array(
1518
  'id' => 'fb-instant-article-ads',
@@ -1678,6 +1719,14 @@ Redux::setSection( $opt_name, array(
1678
  'false' => 'false',
1679
  'default' => 0,
1680
  ),
 
 
 
 
 
 
 
 
1681
  // Grab the First Image for Featured Image if there is none
1682
  array(
1683
  'id' => 'ampforwp-featured-image-from-content',
@@ -1698,14 +1747,6 @@ Redux::setSection( $opt_name, array(
1698
  'false' => 'false',
1699
  'default' => 0,
1700
  ),
1701
- array(
1702
- 'id' => 'ampforwp-custom-fields-featured-image',
1703
- 'type' => 'text',
1704
- 'title' => __('Custom Field For Featured Image', 'accelerated-mobile-pages'),
1705
- 'default' => __ ('','accelerated-mobile-pages'),
1706
- 'placeholder'=>__('Write the Custom Field of Featured Image','accelerated-mobile-pages'),
1707
- 'required' => array( 'ampforwp-custom-fields-featured-image-switch', '=' , 1 )
1708
- ),
1709
  array(
1710
  'id' => 'ampforwp-development-mode',
1711
  'type' => 'switch',
@@ -2017,11 +2058,13 @@ Redux::setSection( $opt_name, array(
2017
  //get All design
2018
  function amp_extra_plugin_theme_header($headers){
2019
  $headers['AMP Theme Name'] = "AMP";
 
2020
  return $headers;
2021
  }
2022
  add_filter("extra_plugin_headers","amp_extra_plugin_theme_header");
2023
  $themeDesign = array(
2024
  array(
 
2025
  'upgreade'=>true,
2026
  'title'=>__('Design One', 'accelerated-mobile-pages' ),
2027
  'value'=>1,
@@ -2029,6 +2072,7 @@ Redux::setSection( $opt_name, array(
2029
  'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-1.png',
2030
  ),
2031
  array(
 
2032
  'upgreade'=>true,
2033
  'title'=>__('Design Two', 'accelerated-mobile-pages' ),
2034
  'value'=>2,
@@ -2036,6 +2080,7 @@ Redux::setSection( $opt_name, array(
2036
  'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-2.png',
2037
  ),
2038
  array(
 
2039
  'upgreade'=>true,
2040
  'title'=>__('Design Three', 'accelerated-mobile-pages' ),
2041
  'value'=>3,
@@ -2052,6 +2097,7 @@ Redux::setSection( $opt_name, array(
2052
  $imageUrl = plugins_url($value['TextDomain'].'/screenshot.png');
2053
  }
2054
  $themeDesign[] = array(
 
2055
  'upgreade'=>true,
2056
  'title'=>$plugin['AMP'],
2057
  'value'=>$value['TextDomain'],
@@ -2118,7 +2164,8 @@ Redux::setSection( $opt_name, array(
2118
  'required' => array(
2119
  array('amp-design-selector', '=' , '3')
2120
  )
2121
- ),
 
2122
  array(
2123
  'id' => 'amp-opt-color-rgba-link',
2124
  'type' => 'color_rgba',
@@ -2130,16 +2177,31 @@ Redux::setSection( $opt_name, array(
2130
  array('amp-design-selector', '=' , '3')
2131
  )
2132
  ),
2133
-
2134
- // Call Now button
2135
  array(
2136
- 'id' => 'ampforwp-callnow-button',
2137
- 'type' => 'switch',
2138
- 'title' => __('Call Now Button', 'accelerated-mobile-pages'),
2139
- 'true' => 'true',
2140
- 'false' => 'false',
2141
- 'default' => 0
2142
- ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2143
  array(
2144
  'id' =>'enable-amp-call-numberfield',
2145
  'type' => 'text',
@@ -2159,38 +2221,6 @@ Redux::setSection( $opt_name, array(
2159
  )
2160
  ),
2161
 
2162
- array(
2163
- 'id' => 'amp-design-3-search-feature',
2164
- 'type' => 'switch',
2165
- 'subtitle' => __('HTTPS is mandatory for Search', 'accelerated-mobile-pages'),
2166
- 'title' => __( 'Search', 'accelerated-mobile-pages' ),
2167
- 'required' => array(
2168
- array('amp-design-selector', '=' , '3')
2169
- ),
2170
- 'default' => '0'
2171
- ),
2172
-
2173
- array(
2174
- 'id' => 'amp-design-2-search-feature',
2175
- 'subtitle' => __('HTTPS is mandatory for Search', 'accelerated-mobile-pages'),
2176
- 'type' => 'switch',
2177
- 'title' => __( 'Search', 'accelerated-mobile-pages' ),
2178
- 'required' => array(
2179
- array('amp-design-selector', '=' , '2')
2180
- ),
2181
- 'default' => '0'
2182
- ),
2183
-
2184
- array(
2185
- 'id' => 'amp-design-1-search-feature',
2186
- 'subtitle' => __('HTTPS is mandatory for Search', 'accelerated-mobile-pages'),
2187
- 'type' => 'switch',
2188
- 'title' => __( 'Search', 'accelerated-mobile-pages' ),
2189
- 'required' => array(
2190
- array('amp-design-selector', '=' , '1')
2191
- ),
2192
- 'default' => '0'
2193
- ),
2194
 
2195
  array(
2196
  'id' => 'css_editor',
@@ -2221,25 +2251,58 @@ Redux::setSection( $opt_name, array(
2221
  'id' => 'amp-theme-header-settings',
2222
  'subsection' => true,
2223
  'fields' => array(
2224
-
2225
  array(
2226
- 'id' =>'amp-on-off-support-for-non-amp-home-page',
2227
- 'type' => 'switch',
2228
- 'title' => __('Non-AMP HomePage link in Header and Logo', 'accelerated-mobile-pages'),
2229
- 'subtitle' => __('If you want users in header to go to non-AMP website from the Header, then you can enable this option', 'accelerated-mobile-pages'),
2230
- 'default' => 0,
 
 
 
 
 
 
 
 
 
 
 
 
 
2231
  ),
 
2232
  array(
2233
- 'id' => 'amp-opt-sticky-head',
2234
- 'type' => 'switch',
2235
- 'title' => __('Make Header UnSticky','accelerated-mobile-pages'),
 
2236
  'required' => array(
2237
- array('amp-design-selector', '=' , '3')
 
 
 
 
 
 
 
 
 
 
 
2238
  ),
2239
- 'desc' => __('Turning it ON will remove the sticky head from the design.', 'accelerated-mobile-pages' ),
2240
  'default' => '0'
2241
  ),
 
2242
  array(
 
 
 
 
 
 
 
 
2243
  'id' => 'amp-opt-color-rgba-headercolor',
2244
  'type' => 'color_rgba',
2245
  'title' => __('Header Background Color','accelerated-mobile-pages'),
@@ -2260,17 +2323,25 @@ Redux::setSection( $opt_name, array(
2260
  'required' => array(
2261
  array('amp-design-selector', '=' , '3')
2262
  )
 
 
 
 
 
 
 
2263
  ),
2264
  array(
2265
- 'id' => 'ampforwp-amp-menu',
2266
- 'type' => 'switch',
2267
- 'title' => __('Navigation Menu in AMP', 'accelerated-mobile-pages'),
2268
- 'desc' => __( 'Add Menus to your AMP pages by clicking on this <a href="'.trailingslashit(get_admin_url()).'nav-menus.php?action=locations">link</a>' , 'accelerated-mobile-pages'),
2269
- 'subtitle' => __('The switch to Enable/Disable Menu in all AMP Pages', 'accelerated-mobile-pages'),
2270
- 'true' => 'true',
2271
- 'false' => 'false',
2272
- 'default' => 1
2273
- ),
 
2274
 
2275
  )
2276
  )
@@ -2299,7 +2370,25 @@ Redux::setSection( $opt_name, array(
2299
  'id' => 'amp-theme-homepage-settings',
2300
  'subsection' => true,
2301
  'fields' => array(
2302
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2303
  // Excerpt Length for design1 #1013
2304
  array(
2305
 
@@ -2323,6 +2412,15 @@ Redux::setSection( $opt_name, array(
2323
  'validate' =>'numeric',
2324
  'default' =>'20',
2325
  ),
 
 
 
 
 
 
 
 
 
2326
 
2327
  // Excerpt Length for design2 #1122
2328
  array(
@@ -2448,25 +2546,7 @@ Redux::setSection( $opt_name, array(
2448
  )
2449
  ),
2450
 
2451
- array(
2452
- 'id' => 'amp-design-3-featured-slider',
2453
- 'type' => 'switch',
2454
- 'title' => __( 'Featured Slider', 'accelerated-mobile-pages' ),
2455
- 'required' => array(
2456
- array('amp-design-selector', '=' , '3')
2457
- ),
2458
- 'default' => '1'
2459
- ),
2460
- array(
2461
- 'id' => 'amp-design-3-category-selector',
2462
- 'type' => 'select',
2463
- 'title' => __( 'Featured Slider Category', 'accelerated-mobile-pages' ),
2464
- 'options' => $categories_array,
2465
- 'required' => array(
2466
- array('amp-design-selector', '=' , '3'),
2467
- array('amp-design-3-featured-slider', '=' , '1')
2468
- ),
2469
- ),
2470
 
2471
  )
2472
  ));
@@ -2486,6 +2566,22 @@ Redux::setSection( $opt_name, array(
2486
  'title' => __('Breadcrumb', 'accelerated-mobile-pages'),
2487
  'subtitle' => __('Enable or Disable Breadcrumb'),
2488
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2489
  //Categories and Tags Links
2490
  array(
2491
  'id' => 'ampforwp-cats-tags-links-single',
@@ -2534,6 +2630,13 @@ Redux::setSection( $opt_name, array(
2534
  'title' => __( 'Author Bio', 'accelerated-mobile-pages' ),
2535
  'default' => '1',
2536
  ),
 
 
 
 
 
 
 
2537
  // Date on Single
2538
  array(
2539
  'id' => 'amp-design-3-date-feature',
@@ -2542,7 +2645,7 @@ Redux::setSection( $opt_name, array(
2542
  'required' => array(
2543
  array('amp-design-selector', '=' , '3')
2544
  ),
2545
- 'desc' => __('Display date along with author and category', 'accelerated-mobile-pages' ),
2546
  'default' => '0'
2547
  ),
2548
  // Pagination //#1015
@@ -2557,7 +2660,7 @@ Redux::setSection( $opt_name, array(
2557
  array(
2558
  'id' => 'ampforwp-single-select-type-of-related',
2559
  'type' => 'select',
2560
- 'title' => __('Show Related Post from', 'accelerated-mobile-pages'),
2561
  'data' => 'page',
2562
  'subtitle' => __('select the type of related posts', 'accelerated-mobile-pages'),
2563
  'options' => array(
@@ -2566,6 +2669,13 @@ Redux::setSection( $opt_name, array(
2566
  ),
2567
  'default' => '2',
2568
  ),
 
 
 
 
 
 
 
2569
  array(
2570
  'id' => 'ampforwp-number-of-related-posts',
2571
  'type' => 'text',
@@ -2577,7 +2687,7 @@ Redux::setSection( $opt_name, array(
2577
  array(
2578
  'id' => 'ampforwp-inline-related-posts',
2579
  'type' => 'switch',
2580
- 'title' => __('Inline Related Post', 'accelerated-mobile-pages'),
2581
  'subtitle' => __('Insert Related Posts between the content', 'accelerated-mobile-pages'),
2582
  'default' => 0,
2583
  ),
@@ -2619,6 +2729,29 @@ Redux::setSection( $opt_name, array(
2619
  'default' => 1
2620
  ),
2621
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2622
  array(
2623
  'id' => 'amp-design-3-credit-link',
2624
  'type' => 'switch',
@@ -2752,6 +2885,13 @@ Redux::setSection( $opt_name, array(
2752
  'title' => __('VKontakte', 'accelerated-mobile-pages'),
2753
  'default' => 0,
2754
  ),
 
 
 
 
 
 
 
2755
  array(
2756
  'id' => 'social-media-profiles-subsection',
2757
  'type' => 'section',
457
  'id' =>'amp-on-off-for-all-pages',
458
  'type' => 'switch',
459
  'title' => __('Pages', 'accelerated-mobile-pages'),
460
+ 'subtitle' => __('Enable AMP Support on Pages.', 'accelerated-mobile-pages'),
461
  'default' => 1,
462
+ // 'subtitle' => __( '<a href="https://ampforwp.com/flush-rewrite-urls/">Re-Save permalink</a> if you make changes in this option, please have a look here on how to do it', 'accelerated-mobile-pages' ),
463
  ),
464
  array(
465
  'id' => 'ampforwp-homepage-on-off-support',
918
  'id' => 'ampforwp-robots-archive-sub-pages-sitewide',
919
  'type' => 'switch',
920
  'title' => __('Archive subpages (sitewide)', 'accelerated-mobile-pages'),
921
+ 'subtitle' => __("Such as /page/2 so on and so forth",'accelerated-mobile-pages'),
922
  'default' => 0,
923
  'on' => 'index',
924
  'off' => 'noindex'
1176
  'title' => __('Tag Manager ID (Container ID)','accelerated-mobile-pages'),
1177
  'default' => '',
1178
  'desc' => __('Eg: GTM-5XXXXXP (<a href="https://ampforwp.com/tutorials/article/gtm-in-amp/">Getting Started?</a>)','accelerated-mobile-pages'),
1179
+ // 'validate' => 'not_empty',
1180
+ 'required' => array(
1181
+ array('amp-use-gtm-option', '=' , '1')
1182
+ ),
1183
  ),
1184
  array(
1185
  'id' =>'amp-gtm-analytics-type',
1187
  'title' => __('Analytics Type','accelerated-mobile-pages'),
1188
  'default' => '',
1189
  'desc' => __('Eg: googleanalytics','accelerated-mobile-pages'),
1190
+ // 'validate' => 'not_empty',
1191
+ 'required' => array(
1192
+ array('amp-use-gtm-option', '=' , '1')
1193
+ ),
1194
  ),
1195
  array(
1196
  'id' =>'amp-gtm-analytics-code',
1199
  'default' => '',
1200
  'desc' => 'Eg: UA-XXXXXX-Y',
1201
  // 'validate' => 'not_empty',
1202
+ 'required' => array(
1203
+ array('amp-use-gtm-option', '=' , '1')),
1204
+ ),
1205
+
1206
+ array(
1207
+ 'id' =>'amp-fb-pixel',
1208
+ 'type' => 'switch',
1209
+ 'title' => __('Facebook Pixel','accelerated-mobile-pages'),
1210
+ 'default' => 0,
1211
+ ),
1212
+ array(
1213
+ 'id' =>'amp-fb-pixel-id',
1214
+ 'type' => 'text',
1215
+ 'title' => __('Facebook Pixel ID','accelerated-mobile-pages'),
1216
+ 'default' => '',
1217
+ 'desc' => 'Example: 153246987501548',
1218
+ 'required' => array(
1219
+ array('amp-fb-pixel', '=' , '1')),
1220
  ),
1221
 
1222
  )
1231
  'NewsArticle' => 'NewsArticle',
1232
  'Recipe' => 'Recipe',
1233
  'Product' => 'Product',
1234
+ 'VideoObject' => 'VideoObject'
1235
  );
1236
  return $options;
1237
  }
1245
  $post_types = get_option('ampforwp_custom_post_types');
1246
  if($post_types){
1247
  foreach ($post_types as $post_type) {
1248
+ if( $post_type == 'post' || $post_type == 'page' ) {
1249
+ continue;
1250
+ }
1251
  $custom_fields[] = array(
1252
  'id' => 'ampforwp-sd-type-'. $post_type,
1253
  'type' => 'select',
1339
  'subtitle' => __('Please don\'t add "PX" in the image size.','accelerated-mobile-pages'),
1340
  'default' => '550'
1341
  ),
1342
+ array(
1343
+ 'id' => 'amporwp-structured-data-video-thumb-url',
1344
+ 'type' => 'media',
1345
+ 'url' => true,
1346
+ 'title' => __('Default Thumbnail for VideoObject', 'accelerated-mobile-pages'),
1347
+ 'subtitle' => __('Upload the Thumbnail you want to show as Video Thumbnail.', 'accelerated-mobile-pages'),
1348
+ 'placeholder' => __('When there is no thumbnail set for the video','accelerated-mobile-pages'),
1349
+ ),
1350
  )
1351
  )
1352
  ) );
1451
  array(
1452
  'id' => 'ampforwp-number-of-comments',
1453
  'type' => 'text',
1454
+ 'subtitle' => __('This refers to the normal comments','accelerated-mobile-pages'),
1455
  'title' => __('No of Comments', 'accelerated-mobile-pages'),
1456
  'default' => 10,
1457
  'required' => array('wordpress-comments-support' , '=' , 1
1500
  array(
1501
  'id' => 'ampforwp-number-of-fb-no-of-comments',
1502
  'type' => 'text',
1503
+ 'subtitle' => __('Enter the number of comments','accelerated-mobile-pages'),
1504
  'title' => __('No of Comments', 'accelerated-mobile-pages'),
1505
  'default' => 10,
1506
  'required' => array(
1512
  )
1513
  ) );
1514
 
1515
+ function fb_instant_article() {
1516
  $feedname = '';
1517
  $fb_instant_article_feed = '';
1518
+ $input = '';
1519
+
1520
+ $feedname = 'instant_articles';
1521
  $fb_instant_article_feed = trailingslashit( site_url() ).$feedname ;
1522
+ $input = '<a href=" '. $fb_instant_article_feed . '" target="_blank">' . esc_url( $fb_instant_article_feed ). '</a>' ;
1523
+
1524
+ return strip_tags($input, '<a>');
1525
  }
1526
+
1527
  // Facebook Instant Articles
1528
  Redux::setSection( $opt_name, array(
1529
  'title' => __( 'Facebook Instant Articles', 'accelerated-mobile-pages' ),
1546
  'desc' => fb_instant_article(),
1547
  'title' => __('Facebook Instant Articles Feed URL', 'accelerated-mobile-pages'),
1548
  'required' => array('fb-instant-article-switch', '=', 1)
1549
+ ),
1550
+ array(
1551
+ 'id' => 'ampforwp-fb-instant-article-posts',
1552
+ 'type' => 'text',
1553
+ 'title' => __('Number of Posts', 'accelerated-mobile-pages'),
1554
+ 'subtitle' => __('Enter the number of posts to generate for Instant Articles.', 'accelerated-mobile-pages'),
1555
+ 'desc' => __('Leave this empty to generate All Posts.', 'accelerated-mobile-pages'),
1556
+ 'required' => array('fb-instant-article-switch', '=', 1)
1557
  ),
1558
  array(
1559
  'id' => 'fb-instant-article-ads',
1719
  'false' => 'false',
1720
  'default' => 0,
1721
  ),
1722
+ array(
1723
+ 'id' => 'ampforwp-custom-fields-featured-image',
1724
+ 'type' => 'text',
1725
+ 'title' => __('Custom Field For Featured Image', 'accelerated-mobile-pages'),
1726
+ 'default' => __ ('','accelerated-mobile-pages'),
1727
+ 'placeholder'=>__('Write the Custom Field of Featured Image','accelerated-mobile-pages'),
1728
+ 'required' => array( 'ampforwp-custom-fields-featured-image-switch', '=' , 1 )
1729
+ ),
1730
  // Grab the First Image for Featured Image if there is none
1731
  array(
1732
  'id' => 'ampforwp-featured-image-from-content',
1747
  'false' => 'false',
1748
  'default' => 0,
1749
  ),
 
 
 
 
 
 
 
 
1750
  array(
1751
  'id' => 'ampforwp-development-mode',
1752
  'type' => 'switch',
2058
  //get All design
2059
  function amp_extra_plugin_theme_header($headers){
2060
  $headers['AMP Theme Name'] = "AMP";
2061
+ $headers['AMP Theme Demo'] = "AMP Demo";
2062
  return $headers;
2063
  }
2064
  add_filter("extra_plugin_headers","amp_extra_plugin_theme_header");
2065
  $themeDesign = array(
2066
  array(
2067
+ 'demo_link' => 'https://ampforwp.com/demo/#one',
2068
  'upgreade'=>true,
2069
  'title'=>__('Design One', 'accelerated-mobile-pages' ),
2070
  'value'=>1,
2072
  'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-1.png',
2073
  ),
2074
  array(
2075
+ 'demo_link' => 'https://ampforwp.com/demo/#two',
2076
  'upgreade'=>true,
2077
  'title'=>__('Design Two', 'accelerated-mobile-pages' ),
2078
  'value'=>2,
2080
  'img'=>AMPFORWP_PLUGIN_DIR_URI.'/images/design-2.png',
2081
  ),
2082
  array(
2083
+ 'demo_link' => 'https://ampforwp.com/demo/#three',
2084
  'upgreade'=>true,
2085
  'title'=>__('Design Three', 'accelerated-mobile-pages' ),
2086
  'value'=>3,
2097
  $imageUrl = plugins_url($value['TextDomain'].'/screenshot.png');
2098
  }
2099
  $themeDesign[] = array(
2100
+ 'demo_link' => $plugin['AMP Demo'],
2101
  'upgreade'=>true,
2102
  'title'=>$plugin['AMP'],
2103
  'value'=>$value['TextDomain'],
2164
  'required' => array(
2165
  array('amp-design-selector', '=' , '3')
2166
  )
2167
+ ),
2168
+ // Design 3
2169
  array(
2170
  'id' => 'amp-opt-color-rgba-link',
2171
  'type' => 'color_rgba',
2177
  array('amp-design-selector', '=' , '3')
2178
  )
2179
  ),
2180
+ // Design 2
 
2181
  array(
2182
+ 'id' => 'amp-opt-color-rgba-link-design2',
2183
+ 'type' => 'color_rgba',
2184
+ 'title' => __('Anchor Link Color','accelerated-mobile-pages'),
2185
+ 'default' => array(
2186
+ 'color' => '#0a89c0',
2187
+ ),
2188
+ 'required' => array(
2189
+ array('amp-design-selector', '=' , '2')
2190
+ )
2191
+ ),
2192
+ // Design 1
2193
+ array(
2194
+ 'id' => 'amp-opt-color-rgba-link-design1',
2195
+ 'type' => 'color_rgba',
2196
+ 'title' => __('Anchor Link Color','accelerated-mobile-pages'),
2197
+ 'default' => array(
2198
+ 'color' => '#0a89c0',
2199
+ ),
2200
+ 'required' => array(
2201
+ array('amp-design-selector', '=' , '1')
2202
+ )
2203
+ ),
2204
+
2205
  array(
2206
  'id' =>'enable-amp-call-numberfield',
2207
  'type' => 'text',
2221
  )
2222
  ),
2223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2224
 
2225
  array(
2226
  'id' => 'css_editor',
2251
  'id' => 'amp-theme-header-settings',
2252
  'subsection' => true,
2253
  'fields' => array(
 
2254
  array(
2255
+ 'id' => 'ampforwp-amp-menu',
2256
+ 'type' => 'switch',
2257
+ 'title' => __('Navigation Menu', 'accelerated-mobile-pages'),
2258
+ 'desc' => __( 'Add Menus to your AMP pages by clicking on this <a href="'.trailingslashit(get_admin_url()).'nav-menus.php?action=locations">link</a>' , 'accelerated-mobile-pages'),
2259
+ 'subtitle' => __('Enable/Disable Menu from header', 'accelerated-mobile-pages'),
2260
+ 'true' => 'true',
2261
+ 'false' => 'false',
2262
+ 'default' => 1
2263
+ ),
2264
+ array(
2265
+ 'id' => 'amp-design-3-search-feature',
2266
+ 'type' => 'switch',
2267
+ 'subtitle' => __('HTTPS is recommened for Search', 'accelerated-mobile-pages'),
2268
+ 'title' => __( 'Search', 'accelerated-mobile-pages' ),
2269
+ 'required' => array(
2270
+ array('amp-design-selector', '=' , '3')
2271
+ ),
2272
+ 'default' => '0'
2273
  ),
2274
+
2275
  array(
2276
+ 'id' => 'amp-design-2-search-feature',
2277
+ 'subtitle' => __('HTTPS is recommened for Search', 'accelerated-mobile-pages'),
2278
+ 'type' => 'switch',
2279
+ 'title' => __( 'Search', 'accelerated-mobile-pages' ),
2280
  'required' => array(
2281
+ array('amp-design-selector', '=' , '2')
2282
+ ),
2283
+ 'default' => '0'
2284
+ ),
2285
+
2286
+ array(
2287
+ 'id' => 'amp-design-1-search-feature',
2288
+ 'subtitle' => __('HTTPS is recommened for Search', 'accelerated-mobile-pages'),
2289
+ 'type' => 'switch',
2290
+ 'title' => __( 'Search', 'accelerated-mobile-pages' ),
2291
+ 'required' => array(
2292
+ array('amp-design-selector', '=' , '1')
2293
  ),
 
2294
  'default' => '0'
2295
  ),
2296
+ // Call Now button
2297
  array(
2298
+ 'id' => 'ampforwp-callnow-button',
2299
+ 'type' => 'switch',
2300
+ 'title' => __('Call Now Button', 'accelerated-mobile-pages'),
2301
+ 'true' => 'true',
2302
+ 'false' => 'false',
2303
+ 'default' => 0
2304
+ ),
2305
+ array(
2306
  'id' => 'amp-opt-color-rgba-headercolor',
2307
  'type' => 'color_rgba',
2308
  'title' => __('Header Background Color','accelerated-mobile-pages'),
2323
  'required' => array(
2324
  array('amp-design-selector', '=' , '3')
2325
  )
2326
+ ),
2327
+ array(
2328
+ 'id' =>'amp-on-off-support-for-non-amp-home-page',
2329
+ 'type' => 'switch',
2330
+ 'title' => __('Non-AMP HomePage link in Header and Logo', 'accelerated-mobile-pages'),
2331
+ 'subtitle' => __('If you want users in header to go to non-AMP website from the Header, then you can enable this option', 'accelerated-mobile-pages'),
2332
+ 'default' => 0,
2333
  ),
2334
  array(
2335
+ 'id' => 'amp-opt-sticky-head',
2336
+ 'type' => 'switch',
2337
+ 'title' => __('Make Header UnSticky','accelerated-mobile-pages'),
2338
+ 'required' => array(
2339
+ array('amp-design-selector', '=' , '3')
2340
+ ),
2341
+ 'subtitle' => __('Turning it ON will remove the sticky head from the design.', 'accelerated-mobile-pages' ),
2342
+ 'default' => '0'
2343
+ ),
2344
+
2345
 
2346
  )
2347
  )
2370
  'id' => 'amp-theme-homepage-settings',
2371
  'subsection' => true,
2372
  'fields' => array(
2373
+ array(
2374
+ 'id' => 'amp-design-3-featured-slider',
2375
+ 'type' => 'switch',
2376
+ 'title' => __( 'Featured Slider', 'accelerated-mobile-pages' ),
2377
+ 'required' => array(
2378
+ array('amp-design-selector', '=' , '3')
2379
+ ),
2380
+ 'default' => '1'
2381
+ ),
2382
+ array(
2383
+ 'id' => 'amp-design-3-category-selector',
2384
+ 'type' => 'select',
2385
+ 'title' => __( 'Featured Slider Category', 'accelerated-mobile-pages' ),
2386
+ 'options' => $categories_array,
2387
+ 'required' => array(
2388
+ array('amp-design-selector', '=' , '3'),
2389
+ array('amp-design-3-featured-slider', '=' , '1')
2390
+ ),
2391
+ ),
2392
  // Excerpt Length for design1 #1013
2393
  array(
2394
 
2412
  'validate' =>'numeric',
2413
  'default' =>'20',
2414
  ),
2415
+ array(
2416
+ 'id' => 'ampforwp-design1-cats-home',
2417
+ 'type' => 'switch',
2418
+ 'title' => __('Category label', 'accelerated-mobile-pages'),
2419
+ 'default' => '0',
2420
+ 'required' => array(
2421
+ array('amp-design-selector', '=' , '1'),
2422
+ )
2423
+ ),
2424
 
2425
  // Excerpt Length for design2 #1122
2426
  array(
2546
  )
2547
  ),
2548
 
2549
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2550
 
2551
  )
2552
  ));
2566
  'title' => __('Breadcrumb', 'accelerated-mobile-pages'),
2567
  'subtitle' => __('Enable or Disable Breadcrumb'),
2568
  ),
2569
+ //Categories ON/OFF
2570
+ array(
2571
+ 'id' => 'ampforwp-cats-single',
2572
+ 'type' => 'switch',
2573
+ 'default' => '1',
2574
+ 'title' => __('Categories', 'accelerated-mobile-pages'),
2575
+ 'subtitle' => __('Enable or Disable Categories in Single', 'accelerated-mobile-pages'),
2576
+ ),
2577
+ //Tags ON/OFF
2578
+ array(
2579
+ 'id' => 'ampforwp-tags-single',
2580
+ 'type' => 'switch',
2581
+ 'default' => '1',
2582
+ 'title' => __('Tags', 'accelerated-mobile-pages'),
2583
+ 'subtitle' => __('Enable or Disable Tags in Single', 'accelerated-mobile-pages'),
2584
+ ),
2585
  //Categories and Tags Links
2586
  array(
2587
  'id' => 'ampforwp-cats-tags-links-single',
2630
  'title' => __( 'Author Bio', 'accelerated-mobile-pages' ),
2631
  'default' => '1',
2632
  ),
2633
+ // Author Pages
2634
+ array(
2635
+ 'id' => 'ampforwp-author-page-url',
2636
+ 'type' => 'switch',
2637
+ 'title' => __( 'Link to Author Pages', 'accelerated-mobile-pages' ),
2638
+ 'default' => '0',
2639
+ ),
2640
  // Date on Single
2641
  array(
2642
  'id' => 'amp-design-3-date-feature',
2645
  'required' => array(
2646
  array('amp-design-selector', '=' , '3')
2647
  ),
2648
+ 'subtitle' => __('Display date along with author and category', 'accelerated-mobile-pages' ),
2649
  'default' => '0'
2650
  ),
2651
  // Pagination //#1015
2660
  array(
2661
  'id' => 'ampforwp-single-select-type-of-related',
2662
  'type' => 'select',
2663
+ 'title' => __('Related Post by', 'accelerated-mobile-pages'),
2664
  'data' => 'page',
2665
  'subtitle' => __('select the type of related posts', 'accelerated-mobile-pages'),
2666
  'options' => array(
2669
  ),
2670
  'default' => '2',
2671
  ),
2672
+ array(
2673
+ 'id' => 'ampforwp-single-order-of-related-posts',
2674
+ 'type' => 'switch',
2675
+ 'title' => __('Sort Related Posts Randomly', 'accelerated-mobile-pages'),
2676
+ 'subtitle' => __('Related posts by random order', 'accelerated-mobile-pages'),
2677
+ 'default' => 0,
2678
+ ),
2679
  array(
2680
  'id' => 'ampforwp-number-of-related-posts',
2681
  'type' => 'text',
2687
  array(
2688
  'id' => 'ampforwp-inline-related-posts',
2689
  'type' => 'switch',
2690
+ 'title' => __('In-Content Related Post', 'accelerated-mobile-pages'),
2691
  'subtitle' => __('Insert Related Posts between the content', 'accelerated-mobile-pages'),
2692
  'default' => 0,
2693
  ),
2729
  'default' => 1
2730
  ),
2731
 
2732
+ array(
2733
+ 'id' => 'ampforwp-footer-top',
2734
+ 'type' => 'switch',
2735
+ 'title' => __('Back to Top link', 'accelerated-mobile-pages'),
2736
+ 'subtitle' => __('Enable / Disable Link to top of the page in the footer', 'accelerated-mobile-pages'),
2737
+ 'true' => 'true',
2738
+ 'false' => 'false',
2739
+ 'default' => 1,
2740
+ 'required' => array(
2741
+ array('amp-design-selector', '!=' , '3')
2742
+ )
2743
+ ),
2744
+ array(
2745
+ 'id' => 'ampforwp-footer-top-design3',
2746
+ 'type' => 'switch',
2747
+ 'title' => __('Back to Top link', 'accelerated-mobile-pages'),
2748
+ 'subtitle' => __('Enable / Disable Link to top of the page in the footer', 'accelerated-mobile-pages'),
2749
+ 'true' => 'true',
2750
+ 'false' => 'false',
2751
+ 'default' => 0,
2752
+ 'required' => array( array( 'amp-design-selector', '=' , '3' ) )
2753
+ ),
2754
+
2755
  array(
2756
  'id' => 'amp-design-3-credit-link',
2757
  'type' => 'switch',
2885
  'title' => __('VKontakte', 'accelerated-mobile-pages'),
2886
  'default' => 0,
2887
  ),
2888
+ // Odnoklassniki
2889
+ array(
2890
+ 'id' => 'enable-single-odnoklassniki-share',
2891
+ 'type' => 'switch',
2892
+ 'title' => __('Odnoklassniki', 'accelerated-mobile-pages'),
2893
+ 'default' => 0,
2894
+ ),
2895
  array(
2896
  'id' => 'social-media-profiles-subsection',
2897
  'type' => 'section',
includes/options/redux-core/framework.php CHANGED
@@ -1432,7 +1432,22 @@
1432
 
1433
  if ( true === $this->args['allow_sub_menu'] ) {
1434
  if ( ! isset ( $section['type'] ) || $section['type'] != 'divide' ) {
1435
- foreach ( $this->sections as $k => $section ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1436
  $canBeSubSection = ( $k > 0 && ( ! isset ( $this->sections[ ( $k ) ]['type'] ) || $this->sections[ ( $k ) ]['type'] != "divide" ) ) ? true : false;
1437
 
1438
  if ( ! isset ( $section['title'] ) || ( $canBeSubSection && ( isset ( $section['subsection'] ) && $section['subsection'] == true ) ) ) {
@@ -1459,6 +1474,7 @@
1459
  call_user_func( 'add_submenu_page', $this->args['page_slug'], $section['title'], $section['title'], $this->args['page_permissions'], $this->args['page_slug'] . '&tab=' . $k,
1460
  //create_function( '$a', "return null;" )
1461
  '__return_null' );
 
1462
  }
1463
 
1464
  // Remove parent submenu item instead of adding null item.
1432
 
1433
  if ( true === $this->args['allow_sub_menu'] ) {
1434
  if ( ! isset ( $section['type'] ) || $section['type'] != 'divide' ) {
1435
+ $new_menu_sections = apply_filters("ampforwp_add_admin_subpages",$this->sections);
1436
+ foreach ( $new_menu_sections as $k => $section ) {
1437
+
1438
+ if(isset($section['custom_amp_menu']) && $section['custom_amp_menu']){
1439
+
1440
+ call_user_func( 'add_submenu_page',
1441
+ $this->args['page_slug'],
1442
+ $section['page_title'],
1443
+ $section['menu_title'],
1444
+ $section['page_permissions'],
1445
+ $section['menu_slug'],
1446
+ $section['callback']
1447
+ );
1448
+ continue;
1449
+ }
1450
+
1451
  $canBeSubSection = ( $k > 0 && ( ! isset ( $this->sections[ ( $k ) ]['type'] ) || $this->sections[ ( $k ) ]['type'] != "divide" ) ) ? true : false;
1452
 
1453
  if ( ! isset ( $section['title'] ) || ( $canBeSubSection && ( isset ( $section['subsection'] ) && $section['subsection'] == true ) ) ) {
1474
  call_user_func( 'add_submenu_page', $this->args['page_slug'], $section['title'], $section['title'], $this->args['page_permissions'], $this->args['page_slug'] . '&tab=' . $k,
1475
  //create_function( '$a', "return null;" )
1476
  '__return_null' );
1477
+
1478
  }
1479
 
1480
  // Remove parent submenu item instead of adding null item.
includes/options/redux-core/inc/fields/select_image/field_select_image.js CHANGED
@@ -54,6 +54,20 @@
54
  'change', function() {
55
  var preview = $( this ).parents( '.redux-field:first' ).find( '.redux-preview-image' );
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  if(typeof $( this ).select2().find(":selected").data("image")!="undefined"){
58
  if($( this ).select2().find(":selected").data("image")===""){
59
  preview.fadeOut(
54
  'change', function() {
55
  var preview = $( this ).parents( '.redux-field:first' ).find( '.redux-preview-image' );
56
 
57
+ if(typeof $( this ).select2().find(":selected").data("demolink")!="undefined"){
58
+ if($( this ).select2().find(":selected").data("demolink")!=""){
59
+ preview.next('#theme-selected-demo-link').remove();
60
+ var demo = $( this ).select2().find(":selected").data("demolink");
61
+ preview.after('<a href="'+demo+'" id="theme-selected-demo-link" target="_blank"> Demo </a>');
62
+
63
+ preview.attr('onclick','return window.open(\''+demo+'\')');
64
+ }
65
+ else {
66
+ preview.attr('onclick','');
67
+ preview.next('#theme-selected-demo-link').remove();
68
+ }
69
+
70
+ }
71
  if(typeof $( this ).select2().find(":selected").data("image")!="undefined"){
72
  if($( this ).select2().find(":selected").data("image")===""){
73
  preview.fadeOut(
includes/options/redux-core/inc/fields/select_image/field_select_image.php CHANGED
@@ -91,8 +91,11 @@ if ( ! class_exists( 'ReduxFramework_select_image' ) ) {
91
  if ( ! isset( $v['alt'] ) ) {
92
  $v['alt'] = $v['title'];
93
  }
 
 
 
94
  // Add the option tag, with values.
95
- echo '<option value="' . $v['value'] . '" ' . $selected . ' data-image="'. $v['img'].'" data-alt="'. $v['alt'] .'">' . $v['title'] . '</option>';
96
  }else{
97
  // No array? No problem!
98
  if ( ! is_array( $v ) ) {
@@ -135,7 +138,7 @@ if ( ! class_exists( 'ReduxFramework_select_image' ) ) {
135
  echo '<br /><br />';
136
 
137
  // Show the preview image.
138
- echo '<div>';
139
 
140
  // just in case. You never know.
141
  if ( ! isset( $arrNum ) ) {
@@ -150,7 +153,16 @@ if ( ! class_exists( 'ReduxFramework_select_image' ) ) {
150
  if ( '' == $this->value ) {
151
  echo '<img src="#" class="redux-preview-image" style="visibility:hidden;" id="image_' . $this->field['id'] . '">';
152
  } else {
153
- echo '<img src=' . $this->field['options'][ $arrNum - 1 ]['img'] . ' class="redux-preview-image" id="image_' . $this->field['id'] . '">';
 
 
 
 
 
 
 
 
 
154
  }
155
 
156
  // Close the <div> tag.
91
  if ( ! isset( $v['alt'] ) ) {
92
  $v['alt'] = $v['title'];
93
  }
94
+ if ( ! isset( $v['demo_link'] ) ) {
95
+ $v['demo_link'] = '';
96
+ }
97
  // Add the option tag, with values.
98
+ echo '<option value="' . $v['value'] . '" ' . $selected . ' data-image="'. $v['img'].'" data-alt="'. $v['alt'] .'" data-demolink="'. $v['demo_link'] .'">' . $v['title'] . '</option>';
99
  }else{
100
  // No array? No problem!
101
  if ( ! is_array( $v ) ) {
138
  echo '<br /><br />';
139
 
140
  // Show the preview image.
141
+ echo '<div class="amp-theme-selector-img">';
142
 
143
  // just in case. You never know.
144
  if ( ! isset( $arrNum ) ) {
153
  if ( '' == $this->value ) {
154
  echo '<img src="#" class="redux-preview-image" style="visibility:hidden;" id="image_' . $this->field['id'] . '">';
155
  } else {
156
+ $demo="#";
157
+ if (isset($this->field['options'][ $arrNum - 1 ]['demo_link'])) {
158
+ $demo = $this->field['options'][ $arrNum - 1 ]['demo_link'];
159
+ }
160
+ echo '<img src=' . $this->field['options'][ $arrNum - 1 ]['img'] . ' class="redux-preview-image" id="image_' . $this->field['id'] . '" onclick="return window.open(\''.$demo.'\')">';
161
+ if (isset($this->field['options'][ $arrNum - 1 ]['demo_link'])) {
162
+ echo '<a href="'. $demo .'" id="theme-selected-demo-link" target="_blank">
163
+ Demo
164
+ </a>';
165
+ }
166
  }
167
 
168
  // Close the <div> tag.
includes/redirect.php CHANGED
@@ -22,7 +22,7 @@ add_action( 'template_redirect', 'ampforwp_check_amp_page_status', 10 );
22
 
23
 
24
  function ampforwp_page_template_redirect() {
25
- global $redux_builder_amp;
26
  $post_type = '';
27
  $supported_types = '';
28
  $supported_amp_post_types = '';
@@ -45,6 +45,10 @@ function ampforwp_page_template_redirect() {
45
  if ( is_feed() ) {
46
  return;
47
  }
 
 
 
 
48
  // Return if some categories are selected as Hide #999
49
  if(is_archive() && $redux_builder_amp['ampforwp-archive-support']){
50
  $selected_cats = array();
22
 
23
 
24
  function ampforwp_page_template_redirect() {
25
+ global $redux_builder_amp, $post;
26
  $post_type = '';
27
  $supported_types = '';
28
  $supported_amp_post_types = '';
45
  if ( is_feed() ) {
46
  return;
47
  }
48
+ // #1192 Password Protected posts exclusion
49
+ if(post_password_required( $post )){
50
+ return;
51
+ }
52
  // Return if some categories are selected as Hide #999
53
  if(is_archive() && $redux_builder_amp['ampforwp-archive-support']){
54
  $selected_cats = array();
includes/vendor/amp/includes/class-amp-post-template.php CHANGED
@@ -55,7 +55,7 @@ class AMP_Post_Template {
55
  'body_class' => '',
56
 
57
  'site_icon_url' => apply_filters( 'amp_site_icon_url', function_exists( 'get_site_icon_url' ) ? get_site_icon_url( self::SITE_ICON_SIZE ) : '' ),
58
- 'placeholder_image_url' => amp_get_asset_url( 'images/placeholder-icon.png' ),
59
 
60
  'featured_image' => false,
61
  'comments_link_url' => false,
55
  'body_class' => '',
56
 
57
  'site_icon_url' => apply_filters( 'amp_site_icon_url', function_exists( 'get_site_icon_url' ) ? get_site_icon_url( self::SITE_ICON_SIZE ) : '' ),
58
+ 'placeholder_image_url' => AMPFORWP_IMAGE_DIR. '/placeholder-icon.png' ,
59
 
60
  'featured_image' => false,
61
  'comments_link_url' => false,
includes/vendor/amp/includes/sanitizers/class-amp-iframe-sanitizer.php CHANGED
@@ -7,7 +7,7 @@ require_once( AMP__DIR__ . '/includes/sanitizers/class-amp-base-sanitizer.php' )
7
  */
8
  class AMP_Iframe_Sanitizer extends AMP_Base_Sanitizer {
9
  const FALLBACK_HEIGHT = 400;
10
- const SANDBOX_DEFAULTS = 'allow-scripts allow-same-origin';
11
 
12
  public static $tag = 'iframe';
13
 
7
  */
8
  class AMP_Iframe_Sanitizer extends AMP_Base_Sanitizer {
9
  const FALLBACK_HEIGHT = 400;
10
+ const SANDBOX_DEFAULTS = 'allow-scripts allow-same-origin allow-popups';
11
 
12
  public static $tag = 'iframe';
13
 
includes/vendor/amp/includes/sanitizers/class-amp-video-sanitizer.php CHANGED
@@ -10,6 +10,17 @@ class AMP_Video_Sanitizer extends AMP_Base_Sanitizer {
10
 
11
  public static $tag = 'video';
12
 
 
 
 
 
 
 
 
 
 
 
 
13
  public function sanitize() {
14
  $nodes = $this->dom->getElementsByTagName( self::$tag );
15
  $num_nodes = $nodes->length;
@@ -50,6 +61,8 @@ class AMP_Video_Sanitizer extends AMP_Base_Sanitizer {
50
  } else {
51
  $node->parentNode->replaceChild( $new_node, $node );
52
  }
 
 
53
  }
54
  }
55
 
10
 
11
  public static $tag = 'video';
12
 
13
+ private static $script_slug = 'amp-video';
14
+ private static $script_src = 'https://cdn.ampproject.org/v0/amp-video-0.1.js';
15
+
16
+ public function get_scripts() {
17
+ if ( ! $this->did_convert_elements ) {
18
+ return array();
19
+ }
20
+
21
+ return array( self::$script_slug => self::$script_src );
22
+ }
23
+
24
  public function sanitize() {
25
  $nodes = $this->dom->getElementsByTagName( self::$tag );
26
  $num_nodes = $nodes->length;
61
  } else {
62
  $node->parentNode->replaceChild( $new_node, $node );
63
  }
64
+
65
+ $this->did_convert_elements = true;
66
  }
67
  }
68
 
includes/vendor/tinymce-widget/includes/class-admin-pointer.php CHANGED
@@ -105,7 +105,8 @@ if ( ! class_exists( 'Black_Studio_TinyMCE_Admin_Pointer' ) ) {
105
  bstw()->get_version(),
106
  true
107
  );
108
- wp_localize_script( 'black-studio-tinymce-widget-pointer', 'bstw_pointers', $pointers );
 
109
  }
110
 
111
  /**
105
  bstw()->get_version(),
106
  true
107
  );
108
+ //wp_localize_script( 'black-studio-tinymce-widget-pointer', 'bstw_pointers', $pointers );
109
+ wp_localize_script( $script, 'bstw_pointers', $pointers );
110
  }
111
 
112
  /**
includes/vendor/vendor-changelog.txt CHANGED
@@ -15,4 +15,12 @@ Reference: #1130 #966
15
 
16
  5. Added a filter called ampforwp_allow_featured_image, so users can show or hide Featured image according to the usage. #1071
17
 
18
- 6. Two Filters added at line number 92 and 124 in amp/includes/embeds/class-amp-gallery-embed.php to add extra parameters for Gallery.
 
 
 
 
 
 
 
 
15
 
16
  5. Added a filter called ampforwp_allow_featured_image, so users can show or hide Featured image according to the usage. #1071
17
 
18
+ 6. Two Filters added at line number 92 and 124 in amp/includes/embeds/class-amp-gallery-embed.php to add extra parameters for Gallery.
19
+
20
+ 7. amp-video script added in amp/includes/sanitizers/class-amp-video-sanitizer.php #991
21
+
22
+ 8. allow-popups added on line number 10 in amp/includes/sanitizers/class-amp-iframe-sanitizer.php #1099
23
+
24
+ 9 Changed placeholder image path from assets folder to image folder
25
+ amp\includes\class-amp-post-template.php, line no: 58, Issue no: 1310
26
+ 'placeholder_image_url' => AMPFORWP_IMAGE_DIR. '/placeholder-icon.png' ,
includes/welcome.php CHANGED
@@ -14,7 +14,7 @@ function ampforwp_welcome_screen_do_activation_redirect() {
14
  }
15
 
16
  // Redirect to welcome page
17
- wp_safe_redirect( add_query_arg( array( 'page' => 'ampforwp-welcome-page' ), admin_url( 'index.php' ) ) );
18
  }
19
 
20
  // add_action( 'admin_init', 'ampforwp_welcome_screen_do_activation_redirect_parent' );
@@ -33,21 +33,26 @@ function ampforwp_welcome_screen_do_activation_redirect_parent() {
33
  }
34
 
35
  // Redirect to welcome page
36
- wp_safe_redirect( add_query_arg( array( 'page' => 'ampforwp-welcome-page' ), admin_url( 'index.php' ) ) );
37
 
38
  update_option( 'ampforwp_parent_plugin_check', true );
39
  }
40
 
41
- add_action('admin_menu', 'ampforwp_welcome_screen_pages');
42
 
43
- function ampforwp_welcome_screen_pages() {
44
- add_dashboard_page(
45
- __('Welcome To AMPforWP plugin','accelerated-mobile-pages'),
46
- __('Welcome to AMP','accelerated-mobile-pages'),
47
- 'manage_options',
48
- 'ampforwp-welcome-page',
49
- 'ampforwp_welcome_screen_content'
50
- );
 
 
 
 
 
 
51
  }
52
 
53
  function ampforwp_welcome_screen_content() {
14
  }
15
 
16
  // Redirect to welcome page
17
+ wp_safe_redirect( add_query_arg( array( 'page' => 'ampforwp-welcome-page' ), admin_url( 'admin.php' ) ) );
18
  }
19
 
20
  // add_action( 'admin_init', 'ampforwp_welcome_screen_do_activation_redirect_parent' );
33
  }
34
 
35
  // Redirect to welcome page
36
+ wp_safe_redirect( add_query_arg( array( 'page' => 'ampforwp-welcome-page' ), admin_url( 'admin.php' ) ) );
37
 
38
  update_option( 'ampforwp_parent_plugin_check', true );
39
  }
40
 
 
41
 
42
+ add_filter('ampforwp_add_admin_subpages', 'ampforwp_add_welcome_pages');
43
+ function ampforwp_add_welcome_pages($sections){
44
+
45
+
46
+ $sections[] = array(
47
+ 'page_title'=> __('Welcome To AMPforWP plugin','accelerated-mobile-pages'),
48
+ 'menu_title'=>__('Welcome to AMP','accelerated-mobile-pages'),
49
+ 'page_permissions'=>'manage_options',
50
+ 'menu_slug' => 'ampforwp-welcome-page',
51
+ 'callback' => 'ampforwp_welcome_screen_content',
52
+ 'custom_amp_menu' => true
53
+ );
54
+ //array_splice($sections,10,0,$newsection);
55
+ return $sections;
56
  }
57
 
58
  function ampforwp_welcome_screen_content() {
pagebuilder/amp-page-builder.php CHANGED
@@ -8,9 +8,19 @@ define( 'AMP_PAGE_BUILDER', plugin_dir_path(__FILE__) );
8
  define( 'AMP_PAGE_BUILDER_URL', plugin_dir_url(__FILE__) );
9
 
10
  add_action('add_meta_boxes','ampforwp_pagebuilder_content_meta_register');
11
- function ampforwp_pagebuilder_content_meta_register(){
12
- $pb_post_type = array('post','page');
13
- add_meta_box( 'pagebilder_content', __( 'AMP Page Builder', 'amp-page-builder' ), 'amp_content_pagebuilder_title_callback', $pb_post_type, 'normal', 'default' );
 
 
 
 
 
 
 
 
 
 
14
  }
15
 
16
  function amp_content_pagebuilder_title_callback( $post ){
8
  define( 'AMP_PAGE_BUILDER_URL', plugin_dir_url(__FILE__) );
9
 
10
  add_action('add_meta_boxes','ampforwp_pagebuilder_content_meta_register');
11
+ function ampforwp_pagebuilder_content_meta_register($post_type){
12
+ global $redux_builder_amp;
13
+
14
+ // Page builder for posts
15
+ if( $redux_builder_amp['amp-on-off-for-all-posts'] && $post_type == 'post' ) {
16
+ add_meta_box( 'pagebilder_content', __( 'AMP Page Builder', 'amp-page-builder' ), 'amp_content_pagebuilder_title_callback', $post_type , 'normal', 'default' );
17
+ }
18
+
19
+ // Page builder for pages
20
+ if ( $redux_builder_amp['amp-on-off-for-all-pages'] && $post_type == 'page' ) {
21
+ add_meta_box( 'pagebilder_content', __( 'AMP Page Builder', 'amp-page-builder' ), 'amp_content_pagebuilder_title_callback', $post_type , 'normal', 'default' );
22
+ }
23
+
24
  }
25
 
26
  function amp_content_pagebuilder_title_callback( $post ){
pagebuilder/functions.php CHANGED
@@ -40,6 +40,8 @@ function amppbbase_admin_scripts( $hook_suffix ){
40
  /* Enqueue CSS & JS For Page Builder */
41
  wp_enqueue_style( 'amppb-admin', AMP_PAGE_BUILDER_URL. 'inc/admin-amp-page-builder.css', array(), '0.0.1' );
42
  wp_enqueue_media();
 
 
43
  wp_enqueue_script( 'amppb-admin', AMP_PAGE_BUILDER_URL. 'inc/admin-amp-page-builder.js', array(
44
  'jquery',
45
  'jquery-ui-resizable',
@@ -114,8 +116,14 @@ function amppb_save_post( $post_id, $post ){
114
 
115
 
116
  add_action("pre_amp_render_post",'amp_pagebuilder_content');
 
 
 
 
 
117
  add_action('amp_post_template_css','amp_pagebuilder_content_styles',100);
118
  function amp_pagebuilder_content_styles(){
 
119
  ?>.amp_pb{display: inline-block;width: 100%;}
120
  .row{display: inline-flex;width: 100%;}
121
  .col-2{width:50%;float:left;}
@@ -124,20 +132,20 @@ function amp_pagebuilder_content_styles(){
124
  .amp_btn{text-align:center}
125
  .amp_btn a{background: #f92c8b;color: #fff;padding: 9px 20px;border-radius: 3px;display: inline-block;box-shadow: 1px 1px 4px #ccc;}
126
  <?php
 
127
  }
128
- function amp_pagebuilder_content(){
129
- add_filter( 'the_content', 'amppb_post_content', 1 ); // Run
130
- }
131
-
132
 
133
 
134
  function amppb_post_content($content){
135
- global $post;
136
- global $containerCommonSettings;
 
 
 
137
 
138
- $previousData = get_post_meta($post->ID,'amp-page-builder');
139
  $previousData = isset($previousData[0])? $previousData[0]: null;
140
- $ampforwp_pagebuilder_enable = get_post_meta($post->ID,'ampforwp_page_builder_enable', true);
141
  if($previousData!="" && $ampforwp_pagebuilder_enable=='yes'){
142
  $html ="";
143
  $previousData = (str_replace("'", "", $previousData));
@@ -195,7 +203,7 @@ function amppb_post_content($content){
195
  }
196
 
197
  function rowData($container,$col){
198
- global $moduleTemplate;
199
  $ampforwp_show_excerpt = true;
200
  $html = '';
201
  if(count($container)>0){
@@ -205,6 +213,10 @@ function rowData($container,$col){
205
  if(count($container)>0){
206
  foreach($container as $contentArray){
207
  $moduleFrontHtml = $moduleTemplate[$contentArray['type']]['front_template'];
 
 
 
 
208
  $moduleName = $moduleTemplate[$contentArray['type']]['name'];
209
  switch($moduleName){
210
  case 'gallery_image':
@@ -225,14 +237,15 @@ function rowData($container,$col){
225
  );
226
  //The Query
227
  $the_query = new WP_Query( $args );
228
- $totalLoopHtml = contentHtml($the_query);
229
- $moduleFrontHtml = str_replace('{{content_title}}', $fieldValues['content_title'], $moduleFrontHtml);
230
  $moduleFrontHtml = str_replace('{{category_selection}}', $totalLoopHtml, $moduleFrontHtml);
231
  /* Restore original Post Data */
232
  wp_reset_postdata();
233
 
234
  break;
235
  default:
 
236
  foreach ($moduleTemplate[$contentArray['type']]['fields'] as $key => $field) {
237
  if(isset($contentArray[$field['name']]) && !empty($contentArray)){
238
  $moduleFrontHtml = str_replace('{{'.$field['name'].'}}', urldecode($contentArray[$field['name']]), $moduleFrontHtml);
@@ -240,6 +253,7 @@ function rowData($container,$col){
240
  $moduleFrontHtml = str_replace('{{'.$field['name'].'}}', "", $moduleFrontHtml);
241
  }
242
  }
 
243
  break;
244
  }
245
  $html .= $moduleFrontHtml;
@@ -255,7 +269,9 @@ function rowData($container,$col){
255
  }
256
  return $html;
257
  }
258
-
 
 
259
  function sortByIndex($contentArray){
260
  $completeSortedArray = array();
261
  if(count($contentArray)>0){
40
  /* Enqueue CSS & JS For Page Builder */
41
  wp_enqueue_style( 'amppb-admin', AMP_PAGE_BUILDER_URL. 'inc/admin-amp-page-builder.css', array(), '0.0.1' );
42
  wp_enqueue_media();
43
+ wp_enqueue_editor();
44
+ wp_enqueue_script( 'text-widgets' );
45
  wp_enqueue_script( 'amppb-admin', AMP_PAGE_BUILDER_URL. 'inc/admin-amp-page-builder.js', array(
46
  'jquery',
47
  'jquery-ui-resizable',
116
 
117
 
118
  add_action("pre_amp_render_post",'amp_pagebuilder_content');
119
+ function amp_pagebuilder_content(){
120
+ add_filter( 'the_content', 'amppb_post_content', 1 ); // Run
121
+ }
122
+
123
+ $ampPagebuilderModuleCss = array();
124
  add_action('amp_post_template_css','amp_pagebuilder_content_styles',100);
125
  function amp_pagebuilder_content_styles(){
126
+ global $ampPagebuilderModuleCss;
127
  ?>.amp_pb{display: inline-block;width: 100%;}
128
  .row{display: inline-flex;width: 100%;}
129
  .col-2{width:50%;float:left;}
132
  .amp_btn{text-align:center}
133
  .amp_btn a{background: #f92c8b;color: #fff;padding: 9px 20px;border-radius: 3px;display: inline-block;box-shadow: 1px 1px 4px #ccc;}
134
  <?php
135
+ echo implode(" ", $ampPagebuilderModuleCss);
136
  }
 
 
 
 
137
 
138
 
139
  function amppb_post_content($content){
140
+ global $post, $redux_builder_amp, $containerCommonSettings;
141
+ $postId = $post->ID;
142
+ if(is_home() && $redux_builder_amp['ampforwp-homepage-on-off-support']==1 && ampforwp_get_blog_details() == false){
143
+ $postId = $redux_builder_amp['amp-frontpage-select-option-pages'];
144
+ }
145
 
146
+ $previousData = get_post_meta($postId,'amp-page-builder');
147
  $previousData = isset($previousData[0])? $previousData[0]: null;
148
+ $ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
149
  if($previousData!="" && $ampforwp_pagebuilder_enable=='yes'){
150
  $html ="";
151
  $previousData = (str_replace("'", "", $previousData));
203
  }
204
 
205
  function rowData($container,$col){
206
+ global $moduleTemplate, $ampPagebuilderModuleCss;
207
  $ampforwp_show_excerpt = true;
208
  $html = '';
209
  if(count($container)>0){
213
  if(count($container)>0){
214
  foreach($container as $contentArray){
215
  $moduleFrontHtml = $moduleTemplate[$contentArray['type']]['front_template'];
216
+ if(isset($moduleTemplate[$contentArray['type']]['front_css'])){
217
+ $ampPagebuilderModuleCss[$contentArray['type']] = $moduleTemplate[$contentArray['type']]['front_css'];
218
+
219
+ }
220
  $moduleName = $moduleTemplate[$contentArray['type']]['name'];
221
  switch($moduleName){
222
  case 'gallery_image':
237
  );
238
  //The Query
239
  $the_query = new WP_Query( $args );
240
+ $totalLoopHtml = contentHtml($the_query,$fieldValues);
241
+ $moduleFrontHtml = str_replace('{{content_title}}', urldecode($fieldValues['content_title']), $moduleFrontHtml);
242
  $moduleFrontHtml = str_replace('{{category_selection}}', $totalLoopHtml, $moduleFrontHtml);
243
  /* Restore original Post Data */
244
  wp_reset_postdata();
245
 
246
  break;
247
  default:
248
+ if(isset($moduleTemplate[$contentArray['type']]['fields']) && count($moduleTemplate[$contentArray['type']]['fields']) > 0) {
249
  foreach ($moduleTemplate[$contentArray['type']]['fields'] as $key => $field) {
250
  if(isset($contentArray[$field['name']]) && !empty($contentArray)){
251
  $moduleFrontHtml = str_replace('{{'.$field['name'].'}}', urldecode($contentArray[$field['name']]), $moduleFrontHtml);
253
  $moduleFrontHtml = str_replace('{{'.$field['name'].'}}', "", $moduleFrontHtml);
254
  }
255
  }
256
+ }
257
  break;
258
  }
259
  $html .= $moduleFrontHtml;
269
  }
270
  return $html;
271
  }
272
+ function ampforwp_pagebuilder_module_style(){
273
+ echo $redux_builder_amp['css_editor'];
274
+ }
275
  function sortByIndex($contentArray){
276
  $completeSortedArray = array();
277
  if(count($contentArray)>0){
pagebuilder/inc/admin-amp-page-builder.css CHANGED
@@ -523,10 +523,15 @@ max-width: 256px;max-height: 256px;background-image: url(data:image/svg+xml;utf8
523
 
524
  .module-button:before, .amppb-module-button:before{
525
  content: "";
526
- max-width: 256px;max-height: 256px; background-image: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+ICAgIDxwYXRoIGQ9Ik0yMSAzSDNjLTEuMSAwLTIgLjktMiAydjE0YzAgMS4xLjkgMiAyIDJoMThjMS4xIDAgMi0uOSAyLTJWNWMwLTEuMS0uOS0yLTItMnptMCAxNkgzdi0zaDE4djN6Ii8+PC9zdmc+);
 
527
 
528
-
 
 
 
529
  }
 
530
  #TB_title{
531
  background: transparent;
532
  border-color: #fff
523
 
524
  .module-button:before, .amppb-module-button:before{
525
  content: "";
526
+ max-width: 256px;max-height: 256px; background-image: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+ICAgIDxwYXRoIGQ9Ik0yMSAzSDNjLTEuMSAwLTIgLjktMiAydjE0YzAgMS4xLjkgMiAyIDJoMThjMS4xIDAgMi0uOSAyLTJWNWMwLTEuMS0uOS0yLTItMnptMCAxNkgzdi0zaDE4djN6Ii8+PC9zdmc+);
527
+ }
528
 
529
+
530
+ .module-contents:before, .amppb-module-contents:before{
531
+ content: "";
532
+ max-width: 256px;max-height: 256px; background-image: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTQgMTRoNHYtNEg0djR6bTAgNWg0di00SDR2NHpNNCA5aDRWNUg0djR6bTUgNWgxMnYtNEg5djR6bTAgNWgxMnYtNEg5djR6TTkgNXY0aDEyVjVIOXoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==);
533
  }
534
+
535
  #TB_title{
536
  background: transparent;
537
  border-color: #fff
pagebuilder/inc/admin-amp-page-builder.js CHANGED
@@ -231,10 +231,10 @@ jQuery( document ).ready( function( $ ){
231
  modData.default = encodeURI($('#'+fieldIdentifier).val());
232
  }else{
233
  modData.default = encodeURI($('#'+fieldIdentifier).val().replace("'","\'"));
234
-
235
  }
236
 
237
  });
 
238
  $('#module-'+containerdetails[1]).find('#selectedModule').val(JSON.stringify(moduleJson))
239
 
240
  /*var fieldValue = [];
@@ -334,34 +334,151 @@ jQuery( document ).ready( function( $ ){
334
  function editorJs(editor){
335
  if(editor.length){
336
  $.each(editor, function(key, value){
337
- if(tinymce.get(value)){
338
- //tinymce.get(value).remove();
339
- console.log(value);
340
- tinymce.get(value).destroy();
 
 
 
 
 
 
 
341
  }
342
- tinymce.init( {
343
- mode : "exact",
344
- elements : value, //'pre-details',
345
- theme: "modern",
346
- skin: "lightgray",
347
- menubar : false,
348
- statusbar : false,
349
- toolbar: [
350
- "bold italic underline strikethrough superscript| alignleft aligncenter alignright | bullist numlist outdent indent | undo redo | headings | link image | removeformat media |wpgallery wpautoresize"
351
- ],
352
- plugins: 'charmap colorpicker compat3x directionality fullscreen hr image lists media paste tabfocus textcolor wordpress wpautoresize wpdialogs wpeditimage wpemoji wpgallery wplink wptextpattern wpview',
353
- /* content_css: [
354
- '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
355
- '//www.tinymce.com/css/codepen.min.css'
356
- ], */
357
- /* plugins : "paste", */
358
- branding: false,
359
- paste_auto_cleanup_on_paste : true,
360
- paste_postprocess : function( pl, o ) {
361
- o.node.innerHTML = o.node.innerHTML.replace( /&nbsp;+/ig, " " );
362
- }
363
- } );
364
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  })
366
 
367
  }
231
  modData.default = encodeURI($('#'+fieldIdentifier).val());
232
  }else{
233
  modData.default = encodeURI($('#'+fieldIdentifier).val().replace("'","\'"));
 
234
  }
235
 
236
  });
237
+ console.log(JSON.stringify(moduleJson));
238
  $('#module-'+containerdetails[1]).find('#selectedModule').val(JSON.stringify(moduleJson))
239
 
240
  /*var fieldValue = [];
334
  function editorJs(editor){
335
  if(editor.length){
336
  $.each(editor, function(key, value){
337
+ var control = $("#"+value).parents('form-control'), restoreTextMode = false,triggerChangeIfDirty,changeDebounceDelay = 1000, needsTextareaChangeTrigger;
338
+ var component = {
339
+ dismissedPointers: []
340
+ };
341
+ var textarea = control.find('textarea');
342
+ var id = value;
343
+ if ( typeof window.tinymce === 'undefined' ) {
344
+ wp.editor.initialize( id, {
345
+ quicktags: true
346
+ });
347
+ return;
348
  }
349
+ // Destroy any existing editor so that it can be re-initialized after a widget-updated event.
350
+ if ( tinymce.get( id ) ) {
351
+ restoreTextMode = tinymce.get( id ).isHidden();
352
+ wp.editor.remove( id );
353
+ }
354
+ wp.editor.initialize( id, {
355
+ tinymce: {
356
+ wpautop: true
357
+ },
358
+ quicktags: true
359
+ });
360
+ triggerChangeIfDirty = function() {
361
+ var updateWidgetBuffer = 300;
362
+ if ( control.editor.isDirty() ) {
363
+ if ( wp.customize && wp.customize.state ) {
364
+ wp.customize.state( 'processing' ).set( wp.customize.state( 'processing' ).get() + 1 );
365
+ _.delay( function() {
366
+ wp.customize.state( 'processing' ).set( wp.customize.state( 'processing' ).get() - 1 );
367
+ }, updateWidgetBuffer );
368
+ }
369
+
370
+ if ( ! control.editor.isHidden() ) {
371
+ control.editor.save();
372
+ }
373
+ }
374
+ // Trigger change on textarea when it is dirty for sake of widgets in the Customizer needing to sync form inputs to setting models.
375
+ if ( needsTextareaChangeTrigger ) {
376
+ textarea.trigger( 'change' );
377
+ needsTextareaChangeTrigger = false;
378
+ }
379
+ };
380
+ control.customHtmlWidgetPointer = control.find( '.wp-pointer.custom-html-widget-pointer' );
381
+ if ( control.customHtmlWidgetPointer.length ) {
382
+ control.customHtmlWidgetPointer.find( '.close' ).on( 'click', function( event ) {
383
+ event.preventDefault();
384
+ control.customHtmlWidgetPointer.hide();
385
+ $( '#' + control.fields.text.attr( 'id' ) + '-html' ).focus();
386
+ control.dismissPointers( [ 'text_widget_custom_html' ] );
387
+ });
388
+ control.customHtmlWidgetPointer.find( '.add-widget' ).on( 'click', function( event ) {
389
+ event.preventDefault();
390
+ control.customHtmlWidgetPointer.hide();
391
+ control.openAvailableWidgetsPanel();
392
+ });
393
+ }
394
+ control.pasteHtmlPointer = control.find( '.wp-pointer.paste-html-pointer' );
395
+ if ( control.pasteHtmlPointer.length ) {
396
+ control.pasteHtmlPointer.find( '.close' ).on( 'click', function( event ) {
397
+ event.preventDefault();
398
+ control.pasteHtmlPointer.hide();
399
+ control.editor.focus();
400
+ control.dismissPointers( [ 'text_widget_custom_html', 'text_widget_paste_html' ] );
401
+ });
402
+ }
403
+ /**
404
+ * Show a pointer, focus on dismiss, and speak the contents for a11y.
405
+ *
406
+ * @param {jQuery} pointerElement Pointer element.
407
+ * @returns {void}
408
+ */
409
+ showPointerElement = function( pointerElement ) {
410
+ pointerElement.show();
411
+ pointerElement.find( '.close' ).focus();
412
+ wp.a11y.speak( pointerElement.find( 'h3, p' ).map( function() {
413
+ return $( this ).text();
414
+ } ).get().join( '\n\n' ) );
415
+ };
416
+
417
+ editor = window.tinymce.get( id );
418
+ if ( ! editor ) {
419
+ throw new Error( 'Failed to initialize editor' );
420
+ }
421
+ onInit = function() {
422
+
423
+ // If a prior mce instance was replaced, and it was in text mode, toggle to text mode.
424
+ if ( restoreTextMode ) {
425
+ switchEditors.go( id, 'html' );
426
+ }
427
+
428
+ // Show the pointer.
429
+ $( '#' + id + '-html' ).on( 'click', function() {
430
+ //control.pasteHtmlPointer.hide(); // Hide the HTML pasting pointer.
431
+
432
+ if ( -1 !== component.dismissedPointers.indexOf( 'text_widget_custom_html' ) ) {
433
+ return;
434
+ }
435
+ showPointerElement( control.customHtmlWidgetPointer );
436
+ });
437
+
438
+ // Hide the pointer when switching tabs.
439
+ $( '#' + id + '-tmce' ).on( 'click', function() {
440
+ control.customHtmlWidgetPointer.hide();
441
+ });
442
+
443
+ // Show pointer when pasting HTML.
444
+ editor.on( 'pastepreprocess', function( event ) {
445
+ var content = event.content;
446
+ if ( -1 !== component.dismissedPointers.indexOf( 'text_widget_paste_html' ) || ! content || ! /&lt;\w+.*?&gt;/.test( content ) ) {
447
+ return;
448
+ }
449
+
450
+ // Show the pointer after a slight delay so the user sees what they pasted.
451
+ _.delay( function() {
452
+ showPointerElement( control.pasteHtmlPointer );
453
+ }, 250 );
454
+ });
455
+ };
456
+
457
+ if ( editor.initialized ) {
458
+ onInit();
459
+ } else {
460
+ editor.on( 'init', onInit );
461
+ }
462
+
463
+ control.editorFocused = false;
464
+
465
+ editor.on( 'focus', function onEditorFocus() {
466
+ control.editorFocused = true;
467
+ });
468
+ editor.on( 'paste', function onEditorPaste() {
469
+ editor.setDirty( true ); // Because pasting doesn't currently set the dirty state.
470
+ triggerChangeIfDirty();
471
+ });
472
+ editor.on( 'NodeChange', function onNodeChange() {
473
+ needsTextareaChangeTrigger = true;
474
+ });
475
+ editor.on( 'NodeChange', _.debounce( triggerChangeIfDirty, changeDebounceDelay ) );
476
+ editor.on( 'blur hide', function onEditorBlur() {
477
+ control.editorFocused = false;
478
+ triggerChangeIfDirty();
479
+ });
480
+ control.editor = editor;
481
+
482
  })
483
 
484
  }
pagebuilder/inc/js-templates.php CHANGED
@@ -56,7 +56,6 @@
56
 
57
 
58
  global $moduleTemplate;
59
- wp_enqueue_script( 'tinymce_js', includes_url( 'js/tinymce/' ) . 'wp-tinymce.php', array( 'jquery' ), false, true );
60
  ?>
61
  <div class="amppb-module-templates hidden">
62
  <?php
56
 
57
 
58
  global $moduleTemplate;
 
59
  ?>
60
  <div class="amppb-module-templates hidden">
61
  <?php
pagebuilder/modules/contents.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $output = '<div class="pb_mod cat_mod"><h4>{{content_title}}</h4>
3
+ <div class="wrap">{{category_selection}}</div>
4
+ </div>';
5
+
6
+
7
+ $frontCss = '.cat_mod_l{float:left;margin-right: 10px;}
8
+ .cat_mod ul{padding:0;list-style-type:none}
9
+ .cat_mod li {display:inline-block;width:100%;margin-bottom:15px;}
10
+ .cat_mod li amp-img{ max-width:100px; width:100px;}
11
+ .cat_mod p{margin-bottom: 0;font-size: 14px;line-height: 1.5;}';
12
+
13
+ $categories = get_categories( array(
14
+ 'orderby' => 'name',
15
+ 'order' => 'ASC'
16
+ ) );
17
+ $categoriesArray = array('recent_option'=>'Recent Posts');
18
+ $options = '<option value="recent_option">Recent Posts</option>';
19
+ foreach($categories as $category){
20
+ $categoriesArray[$category->term_id] = $category->name;
21
+ $options.= '<option value="'.$category->term_id.'">'.$category->name.'</option>';
22
+ }
23
+
24
+
25
+
26
+ return array(
27
+ 'label' =>'Category',
28
+ 'name' => 'contents',
29
+ 'fields' => array(
30
+ array(
31
+ 'type' =>'text',
32
+ 'name' =>"content_title",
33
+ 'label' =>'Category Block Title',
34
+ 'default' =>'Category',
35
+ ),
36
+ array(
37
+ 'type' =>'select',
38
+ 'name'=>"category_selection",
39
+ 'label'=>"Select Category",
40
+ 'default'=>'recent_option',
41
+ 'options' => $options,
42
+ 'options_details'=>$categoriesArray
43
+ ),
44
+ array(
45
+ 'type' =>'text',
46
+ 'name' =>"show_total_posts",
47
+ 'label' =>'Count',
48
+ 'default' =>'3',
49
+ ),
50
+ array(
51
+ 'type' =>'select',
52
+ 'name' =>"ampforwp_show_excerpt",
53
+ 'label' =>"Excerpt",
54
+ 'default' =>'yes',
55
+ 'options' => '<option value="yes">Yes</option><option value="no">No</option>',
56
+ 'options_details'=>array('yes'=>'Yes', 'no'=>'No')
57
+ )
58
+ ),
59
+ 'front_template'=> $output,
60
+ 'front_css'=>$frontCss,
61
+ );
62
+ function contentHtml($the_query,$fieldValues){
63
+ $contenthtml = '';
64
+ $ampforwp_show_excerpt = (isset($fieldValues['ampforwp_show_excerpt'])? $fieldValues['ampforwp_show_excerpt']: 'yes');
65
+ if ( $the_query->have_posts() ) {
66
+ $contenthtml.= '<ul>';
67
+ while ( $the_query->have_posts() ) {
68
+ $the_query->the_post();
69
+ $ampforwp_post_url = get_permalink();
70
+ $contenthtml.='<li>';
71
+ if ( has_post_thumbnail() ) {
72
+ $contenthtml.= '
73
+ <div class="cat_mod_l">
74
+ ';
75
+ $thumb_id = get_post_thumbnail_id();
76
+ $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
77
+ $thumb_url = $thumb_url_array[0];
78
+ $contenthtml.= '<a href="'.trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR .'"><amp-img class="ampforwp_wc_shortcode_img" src="'. $thumb_url.'" width="150" height="150" layout="responsive"></amp-img></a>';
79
+ $contenthtml.= '
80
+ </div>
81
+ ';
82
+ }
83
+ $contenthtml.= '<div class="cat_mod_r">';
84
+ $contenthtml.= '<a href="'. trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR.'">'.get_the_title().'</a>';
85
+
86
+ if( $ampforwp_show_excerpt == 'yes' ) {
87
+ if( has_excerpt() ) {
88
+ $content = get_the_excerpt();
89
+ } else {
90
+ $content = get_the_content();
91
+ }
92
+ $contenthtml.= '
93
+ <p>'.wp_trim_words( strip_tags( strip_shortcodes( $content ) ) , '15' ).'</p>';
94
+ }
95
+ $contenthtml.= '</div>';
96
+
97
+ $contenthtml.= '</li>';
98
+ }
99
+
100
+
101
+ $contenthtml.= '</ul>';
102
+
103
+ }
104
+ /* Restore original Post Data */
105
+ wp_reset_postdata();
106
+ return $contenthtml;
107
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.8.2
7
- Stable tag: 0.9.65.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -149,6 +149,62 @@ You can contact me using this url: http://ampforwp.com/contact/
149
 
150
  == Changelog ==
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  = 0.9.65.2 (25th October 2017) =
153
  * TypeWatch is not a function #1299
154
  * Error with BackupBuddy fixed #1303
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.8.2
7
+ Stable tag: 0.9.66
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
149
 
150
  == Changelog ==
151
 
152
+ = 0.9.66 (29th October 2017) =
153
+ * View more details on https://ampforwp.com/0-9-66-released-bug-squashing-oct-2017-72nd-update/
154
+ * Design 3 & Design 1 are optimised with 90+ Google PageSpeed Score on Mobile and 95+ in desktop performance #1273
155
+ * Featured Image from the content for blog and homepage #1295
156
+ * Category Module for AMP Page builder added #888
157
+ * Don't load unused CSS selectors. All the CSS is conditionally loading, to decrease the number of CSS loaded per page and increased in performance #1292
158
+ * Twitter Video embed code support added in AMP #1307
159
+ * Video Posting Structured data #1293
160
+ * Navigation menus are now Schema compatible for better Structured data integration #1229
161
+ * Yoast checking conditions for Structured Data Improved #1293
162
+ * Added "back to Top" in design 3 #959
163
+ * Proper blog check and author for custom frontpage #1260 (Made some changes to check the blog properly and also added the author details for Custom Frontpage)
164
+ * AMP not working on password-protected pages #1192
165
+ * Debug errors reported by the user #1284 and few more we found internally
166
+ * Inline Style Sanitizer for Comments to avoid any validation issues #1193
167
+ * Next/Previous links removed from pages #1268 props @Frenchomatic
168
+ * WPML Multilingual CMS plugin flags compatibility added #1270
169
+ * Image sanitizer added for the Sidebar #1270
170
+ * Added AMP Components the correct way. Added amp-gist, amp-social-share. #336
171
+ * amp-video script added - Which decreases the non-critical validation issues #991
172
+ * Arrows in Design 3 pagination #1000
173
+ * Author page links in Single #1282
174
+ * Added previous open state of option panel and show again when search clean #1238
175
+ * Odnoklassniki Social Sharing Support for AMP (with target blank for better bounce rate) #1230
176
+ * GIF or animated images resize problem fixed #1281
177
+ * In Design1, Header Background & Link Color have same option #1249
178
+ * FB Pixel for AMP added #1231
179
+ * Structured Data Type option for AMPed Custom Post types only #1259
180
+ * Attribute ‘readability in the tag ‘div’ removed - this decreases the validation issues #1306
181
+ * AMP Theme Framework Improvements: loop, author, related_post, Add Author support #1311
182
+ * Commentator's Avatar in the comments section #1132
183
+ * Remove 'Welcome to AMP' from Dashboard sub-menu and moved to the options area to decrease the annoyance and increase the user happiness #902
184
+ * Option to Sort the Random Order of Related Posts to increase the audience engagement (Default is 'ID', on enabling the option it will change to 'rand') #1250
185
+ *  View AMP on Admin Bar for the respected page/post If enable. #1236
186
+ * google maps iframe – link to larger map #1099
187
+ * Comments now jumping due to the slash at the end #1309
188
+ * Page Builder causes Incompatibility with the Divi theme (We restructured the Text Module for Page builder for better compatibility and UX) #1162
189
+ * Inline Style Sanitizer for Comments added. Less Critical Validation issues and Better Presentation #1193
190
+ * WPML amp-html error fixed #1285
191
+ * Radio button not working for Show View more Button" #1018
192
+ * Added registered handle for tinymcePointer localize data #1301
193
+ * Date in the Design 2 should not be hidden in mobile version #1315
194
+ * Page builder not working on homepage(Selected as front page) #1316
195
+ * Instant articles number of posts option #1271 (Removed some unused code as well, it will rendered all posts if none is enter in the options)
196
+ * Auto flush on save for FBIA to improve the UX.
197
+ * Plain Permalinks Support improved. #1318
198
+ * Tables support added to FB Instant Articles #1266
199
+ * Demo link added in the Theme selector option #1248
200
+ * Remove invalid attributes from multiple tags which reduces critical validation errors and validates pages.
201
+ * AMP makes a problem in archive page label, when it is active in non-amp version #1304
202
+ * placeholder-icon.png is 404 fixed #1310
203
+ * Category & Tags switches for Single added. #1055
204
+ * Copy Content (Custom AMP Editor) Option Not showing with Page Builder of SiteOrigin issue fixed #1280
205
+ * Improving UX with: when AMP support is off for a specific post type then all the AMP related metaboxes should be removed #1289
206
+ * Options Panel Options rearranged, labels rewritten, descriptions repositioned for better User interaction [commit]
207
+
208
  = 0.9.65.2 (25th October 2017) =
209
  * TypeWatch is not a function #1299
210
  * Error with BackupBuddy fixed #1303
templates/category-widget.php CHANGED
@@ -28,6 +28,8 @@ class AMPFORWP_Categories_Widget extends WP_Widget {
28
  $ampforwp_category_link = $instance[ 'showButton' ];
29
  $ampforwp_show_excerpt = $instance[ 'showExcerpt' ];
30
 
 
 
31
  // echo . $args['before_title'] . . $args['after_title']; ?>
32
 
33
  <?php
@@ -77,14 +79,24 @@ class AMPFORWP_Categories_Widget extends WP_Widget {
77
  } ?>
78
 
79
  </li> <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
81
 
82
- //show more
83
- if( $ampforwp_category_link === 'yes' && $ampforwp_category_id !== '' ) {
84
- global $redux_builder_amp;
85
- echo '<a class="amp-category-block-btn" href="'.trailingslashit(get_category_link($ampforwp_category_id)).'amp'.'">'. ampforwp_translation($redux_builder_amp['amp-translator-show-more-text'], 'View More Posts (Widget Button)').'</a>';
86
- }
87
- echo '</ul></div>';
88
 
89
  } else {
90
  // no posts found
28
  $ampforwp_category_link = $instance[ 'showButton' ];
29
  $ampforwp_show_excerpt = $instance[ 'showExcerpt' ];
30
 
31
+ global $redux_builder_amp;
32
+
33
  // echo . $args['before_title'] . . $args['after_title']; ?>
34
 
35
  <?php
79
  } ?>
80
 
81
  </li> <?php
82
+ } ?>
83
+ <div class="cb"></div>
84
+ <?php
85
+
86
+ //show more link
87
+ if( $ampforwp_category_link === 'yes' && ! empty( $ampforwp_category_id ) ) {
88
+
89
+ $category_link = '<a class="amp-category-block-btn" href="'.trailingslashit(get_category_link($ampforwp_category_id)).'amp'.'">'. ampforwp_translation($redux_builder_amp['amp-translator-show-more-text'], 'View More Posts (Widget Button)').'</a>';
90
+ } else {
91
+ $category_link = '<a class="amp-category-block-btn" href="'.user_trailingslashit( home_url() ).'amp'.'">'. ampforwp_translation($redux_builder_amp['amp-translator-show-more-text'], 'View More Posts (Widget Button)').'</a>';
92
+ }
93
+ if( $ampforwp_category_link === 'no' ) {
94
+ $category_link = '';
95
  }
96
 
97
+ echo $category_link ;
98
+
99
+ echo '</ul> <div class="cb"></div> </div>';
 
 
 
100
 
101
  } else {
102
  // no posts found
templates/custom-amp-content-button.js CHANGED
@@ -6,7 +6,11 @@
6
  classes: 'ampforwp-copy-content-button ',
7
  tooltip: 'Visual Editor to AMP Editor',
8
  onclick: function() {
9
- editor.insertContent(tinymce.editors.content.getContent());
 
 
 
 
10
  }
11
  });
12
  });
6
  classes: 'ampforwp-copy-content-button ',
7
  tooltip: 'Visual Editor to AMP Editor',
8
  onclick: function() {
9
+ if(typeof tinymce.editors.content.getContent()!= undefined){
10
+ editor.insertContent(tinymce.editors.content.getContent());
11
+ }else{
12
+ editor.insertContent(document.getElementById('content').value());
13
+ }
14
  }
15
  });
16
  });
templates/custom-amp-content.php CHANGED
@@ -64,10 +64,11 @@ function ampforwp_custom_post_content_sanitizer( $data, $post ) {
64
 
65
 
66
  function ampforwp_custom_content_meta_register() {
67
-
68
- add_meta_box( 'custom_content_editor', __( 'Custom AMP Editor', 'accelerated-mobile-pages' ), 'amp_content_editor_title_callback', 'post','normal', 'default' );
69
-
70
  global $redux_builder_amp;
 
 
 
 
71
  if($redux_builder_amp['amp-on-off-for-all-pages']){
72
  add_meta_box( 'custom_content_editor', __( 'Custom AMP Editor','accelerated-mobile-pages' ), 'amp_content_editor_title_callback', 'page','normal', 'default' );
73
  }
@@ -143,9 +144,12 @@ function amp_content_editor_meta_save ( $post_id ) {
143
  update_post_meta($post_id, 'ampforwp_custom_content_editor', $_POST[ 'ampforwp_custom_content_editor' ] );
144
  }
145
  // Save data of Custom AMP Editor CheckBox
146
- if ( isset( $_POST['ampforwp_custom_content_editor'] ) ) {
147
-
148
- update_post_meta($post_id, 'ampforwp_custom_content_editor_checkbox', $_POST[ 'ampforwp_custom_content_editor_checkbox' ] );
 
 
 
149
 
150
  }
151
 
64
 
65
 
66
  function ampforwp_custom_content_meta_register() {
 
 
 
67
  global $redux_builder_amp;
68
+ if($redux_builder_amp['amp-on-off-for-all-posts']) {
69
+ add_meta_box( 'custom_content_editor', __( 'Custom AMP Editor', 'accelerated-mobile-pages' ), 'amp_content_editor_title_callback', 'post','normal', 'default' );
70
+ }
71
+
72
  if($redux_builder_amp['amp-on-off-for-all-pages']){
73
  add_meta_box( 'custom_content_editor', __( 'Custom AMP Editor','accelerated-mobile-pages' ), 'amp_content_editor_title_callback', 'page','normal', 'default' );
74
  }
144
  update_post_meta($post_id, 'ampforwp_custom_content_editor', $_POST[ 'ampforwp_custom_content_editor' ] );
145
  }
146
  // Save data of Custom AMP Editor CheckBox
147
+ if ( isset( $_POST['ampforwp_custom_content_editor'] ) ) {
148
+ $ampforwp_custom_editor_checkbox = null;
149
+ if(isset($_POST[ 'ampforwp_custom_content_editor_checkbox' ])){
150
+ $ampforwp_custom_editor_checkbox = $_POST[ 'ampforwp_custom_content_editor_checkbox' ];
151
+ }
152
+ update_post_meta($post_id, 'ampforwp_custom_content_editor_checkbox', $ampforwp_custom_editor_checkbox );
153
 
154
  }
155
 
templates/design-manager/design-1/archive.php CHANGED
@@ -89,20 +89,13 @@
89
  </time>
90
  </div>
91
 
92
- <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) {
93
- if ( has_post_thumbnail()) {
94
- $thumb_id = get_post_thumbnail_id();
95
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
96
- $thumb_url = $thumb_url_array[0];
97
- }
98
- else{
99
- $thumb_url = ampforwp_cf_featured_image_src();
100
- }
101
- ?>
102
  <div class="home-post-image">
103
  <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
104
  <amp-img
105
- src=<?php echo $thumb_url ?>
106
  <?php ampforwp_thumbnail_alt(); ?>
107
  <?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
108
  width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
@@ -115,6 +108,7 @@
115
  </a>
116
  </div>
117
  <?php }
 
118
  if( has_excerpt() ){
119
  $content = get_the_excerpt();
120
  }else{
89
  </time>
90
  </div>
91
 
92
+ <?php if (ampforwp_has_post_thumbnail() ) {
93
+ $thumb_url = ampforwp_get_post_thumbnail();
94
+ if($thumb_url){ ?>
 
 
 
 
 
 
 
95
  <div class="home-post-image">
96
  <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
97
  <amp-img
98
+ src=<?php echo esc_url($thumb_url); ?>
99
  <?php ampforwp_thumbnail_alt(); ?>
100
  <?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
101
  width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
108
  </a>
109
  </div>
110
  <?php }
111
+ }
112
  if( has_excerpt() ){
113
  $content = get_the_excerpt();
114
  }else{
templates/design-manager/design-1/elements/comments.php CHANGED
@@ -23,18 +23,22 @@ if (!comments_open() || ( isset($redux_builder_amp['wordpress-comments-support']
23
  function ampforwp_custom_translated_comment($comment, $args, $depth){
24
  $GLOBALS['comment'] = $comment;
25
  global $redux_builder_amp;
26
- ?>
 
27
  <li id="li-comment-<?php comment_ID() ?>"
28
  <?php comment_class(); ?> >
29
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
30
  <footer class="comment-meta">
 
 
 
31
  <div class="comment-author vcard">
32
- <?php
33
  printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
34
  </div>
35
  <!-- .comment-author -->
36
  <div class="comment-metadata">
37
- <a href="<?php echo htmlspecialchars( trailingslashit( get_comment_link( $comment->comment_ID ) ) ) ?>">
38
  <?php printf( ampforwp_translation( ('%1$s '. ampforwp_translation($redux_builder_amp['amp-translator-at-text'],'at').' %2$s'), '%1$s at %2$s') , get_comment_date(), get_comment_time())?>
39
  </a>
40
  <?php edit_comment_link( ampforwp_translation( $redux_builder_amp['amp-translator-Edit-text'], 'Edit' ) ) ?>
@@ -48,8 +52,11 @@ if (!comments_open() || ( isset($redux_builder_amp['wordpress-comments-support']
48
  // Added <p> tag in comments #873
49
  $comment_content = wpautop( $comment_content );
50
 
51
- $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(),
52
- 'AMP_Video_Sanitizer' => array() ) ) );
 
 
 
53
  $sanitized_comment_content = $sanitizer->get_amp_content();
54
  echo make_clickable( $sanitized_comment_content ); ?>
55
 
@@ -92,4 +99,4 @@ if (!comments_open() || ( isset($redux_builder_amp['wordpress-comments-support']
92
  <?php } ?>
93
  <?php } ?>
94
  </div>
95
- <?php do_action('ampforwp_after_comment_hook',$this);
23
  function ampforwp_custom_translated_comment($comment, $args, $depth){
24
  $GLOBALS['comment'] = $comment;
25
  global $redux_builder_amp;
26
+ $comment_author_img_url = "";
27
+ $comment_author_img_url = ampforwp_get_comments_gravatar( $comment ); ?>
28
  <li id="li-comment-<?php comment_ID() ?>"
29
  <?php comment_class(); ?> >
30
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
31
  <footer class="comment-meta">
32
+ <?php if($comment_author_img_url){ ?>
33
+ <amp-img src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
34
+ <?php } ?>
35
  <div class="comment-author vcard">
36
+ <?php
37
  printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
38
  </div>
39
  <!-- .comment-author -->
40
  <div class="comment-metadata">
41
+ <a href="<?php echo htmlspecialchars( untrailingslashit( get_comment_link( $comment->comment_ID ) ) ) ?>">
42
  <?php printf( ampforwp_translation( ('%1$s '. ampforwp_translation($redux_builder_amp['amp-translator-at-text'],'at').' %2$s'), '%1$s at %2$s') , get_comment_date(), get_comment_time())?>
43
  </a>
44
  <?php edit_comment_link( ampforwp_translation( $redux_builder_amp['amp-translator-Edit-text'], 'Edit' ) ) ?>
52
  // Added <p> tag in comments #873
53
  $comment_content = wpautop( $comment_content );
54
 
55
+ $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array(
56
+ 'AMP_Img_Sanitizer' => array(),
57
+ 'AMP_Video_Sanitizer' => array(),
58
+ 'AMP_Style_Sanitizer' => array()
59
+ ) ) );
60
  $sanitized_comment_content = $sanitizer->get_amp_content();
61
  echo make_clickable( $sanitized_comment_content ); ?>
62
 
99
  <?php } ?>
100
  <?php } ?>
101
  </div>
102
+ <?php do_action('ampforwp_after_comment_hook',$this);
templates/design-manager/design-1/elements/content.php CHANGED
@@ -41,7 +41,7 @@ if( array_key_exists( 'enable-excerpt-single' , $redux_builder_amp ) ) {
41
  do_action('ampforwp_after_post_content',$this) ; ?>
42
  <!--Post Next-Previous Links-->
43
  <?php
44
- if($redux_builder_amp['enable-single-next-prev']) { ?>
45
  <!--IF Starts here-->
46
  <div class="amp-wp-content post-pagination-meta">
47
  <div id="pagination">
41
  do_action('ampforwp_after_post_content',$this) ; ?>
42
  <!--Post Next-Previous Links-->
43
  <?php
44
+ if($redux_builder_amp['enable-single-next-prev'] && !is_page() ) { ?>
45
  <!--IF Starts here-->
46
  <div class="amp-wp-content post-pagination-meta">
47
  <div id="pagination">
templates/design-manager/design-1/elements/featured-image.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php do_action('ampforwp_before_featured_image_hook',$this);
2
  global $redux_builder_amp, $post;
3
- $caption = '';
 
 
4
  $featured_image = $this->get( 'featured_image' );
5
  if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || $redux_builder_amp['ampforwp-featured-image-from-content'] == true ){
6
  if ( $featured_image ) {
1
  <?php do_action('ampforwp_before_featured_image_hook',$this);
2
  global $redux_builder_amp, $post;
3
+ $amp_html = "";
4
+ $caption = "";
5
+ $featured_image = "";
6
  $featured_image = $this->get( 'featured_image' );
7
  if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || $redux_builder_amp['ampforwp-featured-image-from-content'] == true ){
8
  if ( $featured_image ) {
templates/design-manager/design-1/elements/meta-info.php CHANGED
@@ -11,12 +11,15 @@
11
  if ( function_exists( 'get_avatar_url' ) && ( $author_image ) ) {
12
  if( is_single()) { ?>
13
  <amp-img src="<?php echo esc_url($author_image); ?>" width="24" height="24" layout="fixed"></amp-img>
14
- <span class="amp-wp-author author vcard"><?php echo esc_html( $post_author->display_name ); ?></span>
15
- <?php }
 
16
  if( is_page() && $redux_builder_amp['meta_page'] ) { ?>
17
  <amp-img src="<?php echo esc_url($author_image); ?>" width="24" height="24" layout="fixed"></amp-img>
18
- <span class="amp-wp-author author vcard"><?php echo esc_html( $post_author->display_name ); ?></span>
19
- <?php } } ?>
 
 
20
  </div>
21
  <?php endif; ?>
22
 
@@ -43,4 +46,4 @@
43
  </div>
44
 
45
  </div>
46
- <?php do_action('ampforwp_after_meta_info_hook',$this);
11
  if ( function_exists( 'get_avatar_url' ) && ( $author_image ) ) {
12
  if( is_single()) { ?>
13
  <amp-img src="<?php echo esc_url($author_image); ?>" width="24" height="24" layout="fixed"></amp-img>
14
+ <?php
15
+ echo ampforwp_get_author_details( $post_author , 'meta-info' );
16
+ }
17
  if( is_page() && $redux_builder_amp['meta_page'] ) { ?>
18
  <amp-img src="<?php echo esc_url($author_image); ?>" width="24" height="24" layout="fixed"></amp-img>
19
+ <?php
20
+ echo ampforwp_get_author_details( $post_author , 'meta-info' );
21
+ }
22
+ } ?>
23
  </div>
24
  <?php endif; ?>
25
 
46
  </div>
47
 
48
  </div>
49
+ <?php do_action('ampforwp_after_meta_info_hook',$this);
templates/design-manager/design-1/elements/meta-taxonomy.php CHANGED
@@ -1,7 +1,11 @@
 
 
1
  <div class="amp-wp-article-header amp-wp-article-category ampforwp-meta-taxonomy ">
2
 
3
- <?php global $redux_builder_amp; ?>
4
- <?php do_action('ampforwp_before_meta_taxonomy_hook',$this); ?>
 
 
5
 
6
  <?php $ampforwp_categories = get_the_terms( $this->ID, 'category' );
7
  if ( $ampforwp_categories ) : ?>
@@ -15,10 +19,13 @@
15
  }
16
  } ?>
17
  </div>
18
- <?php endif; ?>
 
19
 
 
 
20
 
21
- <?php $ampforwp_tags= get_the_terms( $this->ID, 'post_tag' );
22
  if ( $ampforwp_tags && ! is_wp_error( $ampforwp_tags ) ) :?>
23
  <div class="amp-wp-meta amp-wp-tax-tag ampforwp-tax-tag">
24
  <?php if($redux_builder_amp['amp-rtl-select-option']==0) {
@@ -35,9 +42,9 @@
35
  global $redux_builder_amp; printf( ampforwp_translation($redux_builder_amp['amp-translator-tags-text'] .' ', 'accelerated-mobile-pages' ));
36
  }?>
37
  </div>
38
- <?php endif;?>
39
 
40
- </div>
41
 
42
  <?php
43
 
@@ -56,10 +63,10 @@ if( array_key_exists( 'amp-author-description' , $redux_builder_amp ) && is_sing
56
  if ( $author_avatar_url ) { ?>
57
  <amp-img src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
58
  <?php
59
- } ?>
60
- <strong><?php echo esc_html( $post_author->display_name ); ?></strong>: <?php echo $post_author->description ; ?>
61
-
62
- <?php } ?>
63
  </div>
64
  </div> <?php
65
  }
1
+ <?php global $redux_builder_amp;
2
+ if( isset($redux_builder_amp['ampforwp-cats-single']) && $redux_builder_amp['ampforwp-cats-single'] || isset($redux_builder_amp['ampforwp-tags-single']) && $redux_builder_amp['ampforwp-tags-single'] ) { ?>
3
  <div class="amp-wp-article-header amp-wp-article-category ampforwp-meta-taxonomy ">
4
 
5
+
6
+ <?php do_action('ampforwp_before_meta_taxonomy_hook',$this);
7
+
8
+ if( isset($redux_builder_amp['ampforwp-cats-single']) && $redux_builder_amp['ampforwp-cats-single']) { ?>
9
 
10
  <?php $ampforwp_categories = get_the_terms( $this->ID, 'category' );
11
  if ( $ampforwp_categories ) : ?>
19
  }
20
  } ?>
21
  </div>
22
+ <?php endif; } ?>
23
+
24
 
25
+ <?php
26
+ if( isset($redux_builder_amp['ampforwp-tags-single']) && $redux_builder_amp['ampforwp-tags-single']) {
27
 
28
+ $ampforwp_tags= get_the_terms( $this->ID, 'post_tag' );
29
  if ( $ampforwp_tags && ! is_wp_error( $ampforwp_tags ) ) :?>
30
  <div class="amp-wp-meta amp-wp-tax-tag ampforwp-tax-tag">
31
  <?php if($redux_builder_amp['amp-rtl-select-option']==0) {
42
  global $redux_builder_amp; printf( ampforwp_translation($redux_builder_amp['amp-translator-tags-text'] .' ', 'accelerated-mobile-pages' ));
43
  }?>
44
  </div>
45
+ <?php endif; }?>
46
 
47
+ </div> <?php } ?>
48
 
49
  <?php
50
 
63
  if ( $author_avatar_url ) { ?>
64
  <amp-img src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
65
  <?php
66
+ }
67
+ echo ampforwp_get_author_details( $post_author , 'meta-taxonomy' );
68
+ echo $post_author->description ;
69
+ } ?>
70
  </div>
71
  </div> <?php
72
  }
templates/design-manager/design-1/elements/related-posts.php CHANGED
@@ -6,7 +6,11 @@
6
 
7
  // declaring this variable here to prevent debug errors
8
  $args = null;
9
-
 
 
 
 
10
  // Custom Post types
11
  if( $current_post_type = get_post_type( $post )) {
12
  // The query arguments
@@ -15,13 +19,12 @@
15
  $args = array(
16
  'posts_per_page'=> $int_number_of_related_posts,
17
  'order' => 'DESC',
18
- 'orderby' => 'ID',
19
  'post_type' => $current_post_type,
20
  'post__not_in' => array( $post->ID )
21
  );
22
  }
23
  }//end of block for custom Post types
24
-
25
  // code block for categories
26
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2) {
27
  $categories = get_the_category($post->ID);
@@ -29,12 +32,13 @@
29
  $category_ids = array();
30
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
31
  $args=array(
32
- 'category__in' => $category_ids,
33
- 'post__not_in' => array($post->ID),
34
- 'posts_per_page'=> $int_number_of_related_posts,
35
- 'ignore_sticky_posts'=>1,
36
- 'has_password' => false ,
37
- 'post_status'=> 'publish'
 
38
  );
39
  }
40
  } //end of block for categories
@@ -43,16 +47,17 @@
43
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
44
  $ampforwp_tags = get_the_tags($post->ID);
45
  if ($ampforwp_tags) {
46
- $tag_ids = array();
47
- foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
48
- $args=array(
49
- 'tag__in' => $tag_ids,
50
- 'post__not_in' => array($post->ID),
51
- 'posts_per_page'=> $int_number_of_related_posts,
52
- 'ignore_sticky_posts'=>1,
53
- 'has_password' => false ,
54
- 'post_status'=> 'publish'
55
- );
 
56
  }
57
  }//end of block for tags
58
 
6
 
7
  // declaring this variable here to prevent debug errors
8
  $args = null;
9
+ $orderby = 'ID';
10
+ // Check for the order of related posts
11
+ if( isset( $redux_builder_amp['ampforwp-single-order-of-related-posts'] ) && $redux_builder_amp['ampforwp-single-order-of-related-posts'] ){
12
+ $orderby = 'rand';
13
+ }
14
  // Custom Post types
15
  if( $current_post_type = get_post_type( $post )) {
16
  // The query arguments
19
  $args = array(
20
  'posts_per_page'=> $int_number_of_related_posts,
21
  'order' => 'DESC',
22
+ 'orderby' => $orderby,
23
  'post_type' => $current_post_type,
24
  'post__not_in' => array( $post->ID )
25
  );
26
  }
27
  }//end of block for custom Post types
 
28
  // code block for categories
29
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2) {
30
  $categories = get_the_category($post->ID);
32
  $category_ids = array();
33
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
34
  $args=array(
35
+ 'category__in' => $category_ids,
36
+ 'post__not_in' => array($post->ID),
37
+ 'posts_per_page' => $int_number_of_related_posts,
38
+ 'ignore_sticky_posts'=> 1,
39
+ 'has_password' => false ,
40
+ 'post_status' => 'publish',
41
+ 'orderby' => $orderby
42
  );
43
  }
44
  } //end of block for categories
47
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
48
  $ampforwp_tags = get_the_tags($post->ID);
49
  if ($ampforwp_tags) {
50
+ $tag_ids = array();
51
+ foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
52
+ $args=array(
53
+ 'tag__in' => $tag_ids,
54
+ 'post__not_in' => array($post->ID),
55
+ 'posts_per_page' => $int_number_of_related_posts,
56
+ 'ignore_sticky_posts'=> 1,
57
+ 'has_password' => false ,
58
+ 'post_status' => 'publish',
59
+ 'orderby' => $orderby
60
+ );
61
  }
62
  }//end of block for tags
63
 
templates/design-manager/design-1/elements/social-icons.php CHANGED
@@ -54,6 +54,13 @@
54
  </div>
55
  </a>
56
  <?php } ?>
 
 
 
 
 
 
 
57
  </div>
58
  <?php } ?>
59
 
54
  </div>
55
  </a>
56
  <?php } ?>
57
+ <?php if($redux_builder_amp['enable-single-odnoklassniki-share'] == true) { ?>
58
+ <a href="http://ok.ru/dk?st.cmd=WidgetShare&st.shareUrl=<?php echo get_the_permalink(); ?>" target="_blank">
59
+ <div class="custom-amp-socialsharing-icon custom-amp-social-sharing-odnoklassniki">
60
+ <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjRweCIgdmlld0JveD0iMCAwIDk1LjQ4MSA5NS40ODEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDk1LjQ4MSA5NS40ODE7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8Zz4KCQk8cGF0aCBkPSJNNDMuMDQxLDY3LjI1NGMtNy40MDItMC43NzItMTQuMDc2LTIuNTk1LTE5Ljc5LTcuMDY0Yy0wLjcwOS0wLjU1Ni0xLjQ0MS0xLjA5Mi0yLjA4OC0xLjcxMyAgICBjLTIuNTAxLTIuNDAyLTIuNzUzLTUuMTUzLTAuNzc0LTcuOTg4YzEuNjkzLTIuNDI2LDQuNTM1LTMuMDc1LDcuNDg5LTEuNjgyYzAuNTcyLDAuMjcsMS4xMTcsMC42MDcsMS42MzksMC45NjkgICAgYzEwLjY0OSw3LjMxNywyNS4yNzgsNy41MTksMzUuOTY3LDAuMzI5YzEuMDU5LTAuODEyLDIuMTkxLTEuNDc0LDMuNTAzLTEuODEyYzIuNTUxLTAuNjU1LDQuOTMsMC4yODIsNi4yOTksMi41MTQgICAgYzEuNTY0LDIuNTQ5LDEuNTQ0LDUuMDM3LTAuMzgzLDcuMDE2Yy0yLjk1NiwzLjAzNC02LjUxMSw1LjIyOS0xMC40NjEsNi43NjFjLTMuNzM1LDEuNDQ4LTcuODI2LDIuMTc3LTExLjg3NSwyLjY2MSAgICBjMC42MTEsMC42NjUsMC44OTksMC45OTIsMS4yODEsMS4zNzZjNS40OTgsNS41MjQsMTEuMDIsMTEuMDI1LDE2LjUsMTYuNTY2YzEuODY3LDEuODg4LDIuMjU3LDQuMjI5LDEuMjI5LDYuNDI1ICAgIGMtMS4xMjQsMi40LTMuNjQsMy45NzktNi4xMDcsMy44MWMtMS41NjMtMC4xMDgtMi43ODItMC44ODYtMy44NjUtMS45NzdjLTQuMTQ5LTQuMTc1LTguMzc2LTguMjczLTEyLjQ0MS0xMi41MjcgICAgYy0xLjE4My0xLjIzNy0xLjc1Mi0xLjAwMy0yLjc5NiwwLjA3MWMtNC4xNzQsNC4yOTctOC40MTYsOC41MjgtMTIuNjgzLDEyLjczNWMtMS45MTYsMS44ODktNC4xOTYsMi4yMjktNi40MTgsMS4xNSAgICBjLTIuMzYyLTEuMTQ1LTMuODY1LTMuNTU2LTMuNzQ5LTUuOTc5YzAuMDgtMS42MzksMC44ODYtMi44OTEsMi4wMTEtNC4wMTRjNS40NDEtNS40MzMsMTAuODY3LTEwLjg4LDE2LjI5NS0xNi4zMjIgICAgQzQyLjE4Myw2OC4xOTcsNDIuNTE4LDY3LjgxMyw0My4wNDEsNjcuMjU0eiIgZmlsbD0iI0ZGRkZGRiIvPgoJCTxwYXRoIGQ9Ik00Ny41NSw0OC4zMjljLTEzLjIwNS0wLjA0NS0yNC4wMzMtMTAuOTkyLTIzLjk1Ni0yNC4yMThDMjMuNjcsMTAuNzM5LDM0LjUwNS0wLjAzNyw0Ny44NCwwICAgIGMxMy4zNjIsMC4wMzYsMjQuMDg3LDEwLjk2NywyNC4wMiwyNC40NzhDNzEuNzkyLDM3LjY3Nyw2MC44ODksNDguMzc1LDQ3LjU1LDQ4LjMyOXogTTU5LjU1MSwyNC4xNDMgICAgYy0wLjAyMy02LjU2Ny01LjI1My0xMS43OTUtMTEuODA3LTExLjgwMWMtNi42MDktMC4wMDctMTEuODg2LDUuMzE2LTExLjgzNSwxMS45NDNjMC4wNDksNi41NDIsNS4zMjQsMTEuNzMzLDExLjg5NiwxMS43MDkgICAgQzU0LjM1NywzNS45NzEsNTkuNTczLDMwLjcwOSw1OS41NTEsMjQuMTQzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
61
+ </div>
62
+ </a>
63
+ <?php } ?>
64
  </div>
65
  <?php } ?>
66
 
templates/design-manager/design-1/fonts/Merriweather-Bold.ttf ADDED
Binary file
templates/design-manager/design-1/fonts/Merriweather-BoldItalic.ttf ADDED
Binary file
templates/design-manager/design-1/fonts/Merriweather-Italic.ttf ADDED
Binary file
templates/design-manager/design-1/fonts/Merriweather-Regular.ttf ADDED
Binary file
templates/design-manager/design-1/fonts/OFL.txt ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright 2016 The Merriweather Project Authors (sorkintype@gmail.com), with Reserved Font Name "Merriweather".
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
templates/design-manager/design-1/footer.php CHANGED
@@ -4,13 +4,19 @@ wp_reset_postdata(); ?>
4
  <footer class="amp-wp-footer">
5
  <div id="footer">
6
  <?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
7
- <div class="footer_menu"> <?php
8
- $menu = wp_nav_menu( array(
 
 
 
9
  'theme_location' => 'amp-footer-menu',
 
 
10
  'echo' => false
11
  ) );
12
  echo strip_tags( $menu , '<ul><li><a>'); ?>
13
  </div>
 
14
  <?php } ?>
15
  <h2><?php echo esc_html( $this->get( 'blog_name' ) ); ?></h2>
16
  <p class="copyright_txt">
@@ -22,8 +28,9 @@ wp_reset_postdata(); ?>
22
 
23
 
24
  <p class="back-to-top">
25
- <a href="#top"> <?php echo ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top' ); ?>
26
- </a> <?php
 
27
  if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') { ?> | <?php ampforwp_view_nonamp();
28
  } ?>
29
  </p>
4
  <footer class="amp-wp-footer">
5
  <div id="footer">
6
  <?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
7
+ <div class="footer_menu">
8
+ <?php // schema.org/SiteNavigationElement missing from menus #1229 ?>
9
+ <nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
10
+ <?php
11
+ $menu = wp_nav_menu( array(
12
  'theme_location' => 'amp-footer-menu',
13
+ 'link_before' => '<span itemprop="name">',
14
+ 'link_after' => '</span>',
15
  'echo' => false
16
  ) );
17
  echo strip_tags( $menu , '<ul><li><a>'); ?>
18
  </div>
19
+ </nav>
20
  <?php } ?>
21
  <h2><?php echo esc_html( $this->get( 'blog_name' ) ); ?></h2>
22
  <p class="copyright_txt">
28
 
29
 
30
  <p class="back-to-top">
31
+ <?php if($redux_builder_amp['ampforwp-footer-top']=='1') { ?>
32
+ <a href="#top"> <?php echo ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top' ); ?>
33
+ </a> <?php }
34
  if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') { ?> | <?php ampforwp_view_nonamp();
35
  } ?>
36
  </p>
templates/design-manager/design-1/header-bar.php CHANGED
@@ -88,11 +88,22 @@
88
  side="right">
89
  <div class="toggle-navigationv2">
90
  <div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div> <?php
91
- $menu = wp_nav_menu( array(
 
 
 
92
  'theme_location' => 'amp-menu' ,
93
- 'echo' => false) );
94
- echo strip_tags( $menu , '<ul><li><a>'); ?>
 
 
 
 
 
 
 
95
  </div>
 
96
  </amp-sidebar>
97
  <?php }
98
  do_action('ampforwp_design_1_after_header');
88
  side="right">
89
  <div class="toggle-navigationv2">
90
  <div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div> <?php
91
+ // schema.org/SiteNavigationElement missing from menus #1229 ?>
92
+ <nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
93
+ <?php
94
+ $menu_html_content = wp_nav_menu( array(
95
  'theme_location' => 'amp-menu' ,
96
+ 'link_before' => '<span itemprop="name">',
97
+ 'link_after' => '</span>',
98
+ 'echo' => false,
99
+ 'menu_class' => 'menu amp-menu'
100
+ ) );
101
+ $sanitizer_obj = new AMPFORWP_Content( $menu_html_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array() ) ) );
102
+ $sanitized_comment_content = $sanitizer_obj->get_amp_content();
103
+ echo make_clickable( $sanitized_comment_content );
104
+ ?>
105
  </div>
106
+ </nav>
107
  </amp-sidebar>
108
  <?php }
109
  do_action('ampforwp_design_1_after_header');
templates/design-manager/design-1/index.php CHANGED
@@ -65,36 +65,36 @@
65
  $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
66
  $post_date = apply_filters('ampforwp_modify_post_date',$post_date);
67
  echo $post_date ;?>
68
- </time><?php
69
- }?>
 
 
 
 
 
 
70
  </div>
71
 
72
- <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) {
73
- if ( has_post_thumbnail()) {
74
- $thumb_id = get_post_thumbnail_id();
75
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
76
- $thumb_url = $thumb_url_array[0];
77
- }
78
- else{
79
- $thumb_url = ampforwp_cf_featured_image_src();
80
- }
81
- ?>
82
- <div class="home-post-image">
83
- <a href="<?php echo user_trailingslashit( trailingslashit( $ampforwp_post_url ) . AMPFORWP_AMP_QUERY_VAR );?>">
84
- <amp-img
85
- src=<?php echo $thumb_url ?>
86
- <?php ampforwp_thumbnail_alt(); ?>
87
- <?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
88
- width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
89
- height=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-height'] ?>
90
- <?php } else { ?>
91
- width=100
92
- height=75
93
- <?php } ?>
94
- ></amp-img>
95
- </a>
96
- </div>
97
- <?php }
98
 
99
  if(has_excerpt()){
100
  $content = get_the_excerpt();
65
  $post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
66
  $post_date = apply_filters('ampforwp_modify_post_date',$post_date);
67
  echo $post_date ;?>
68
+ </time> <?php
69
+ }
70
+ if( isset($redux_builder_amp['ampforwp-design1-cats-home']) && $redux_builder_amp['ampforwp-design1-cats-home'] ) {
71
+ foreach((get_the_category()) as $category) { ?>
72
+ <ul class="amp-wp-tags">
73
+ <li class="amp-cat-<?php echo $category->term_id;?>"> <?php echo ' ' . $category->cat_name ?> </li> </ul>
74
+ <?php }
75
+ } ?>
76
  </div>
77
 
78
+ <?php if ( ampforwp_has_post_thumbnail() ) {
79
+ $thumb_url = ampforwp_get_post_thumbnail();
80
+ if($thumb_url){ ?>
81
+ <div class="home-post-image">
82
+ <a href="<?php echo user_trailingslashit( trailingslashit( $ampforwp_post_url ) . AMPFORWP_AMP_QUERY_VAR );?>">
83
+ <amp-img
84
+ src=<?php echo esc_url($thumb_url); ?>
85
+ <?php ampforwp_thumbnail_alt(); ?>
86
+ <?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
87
+ width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
88
+ height=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-height'] ?>
89
+ <?php } else { ?>
90
+ width=100
91
+ height=75
92
+ <?php } ?>
93
+ ></amp-img>
94
+ </a>
95
+ </div>
96
+ <?php }
97
+ }
 
 
 
 
 
 
98
 
99
  if(has_excerpt()){
100
  $content = get_the_excerpt();
templates/design-manager/design-1/search.php CHANGED
@@ -71,22 +71,16 @@
71
  </time>
72
  </div>
73
 
74
- <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) {
75
- if ( has_post_thumbnail()) {
76
- $thumb_id = get_post_thumbnail_id();
77
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
78
- $thumb_url = $thumb_url_array[0];
79
- }
80
- else{
81
- $thumb_url = ampforwp_cf_featured_image_src();
82
- }
83
- ?>
84
  <div class="home-post-image">
85
  <a href="<?php echo trailingslashit( trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR );?>">
86
- <amp-img src=<?php echo $thumb_url ?> width=100 height=75></amp-img>
87
  </a>
88
  </div>
89
  <?php }
 
90
  if( has_excerpt() ){
91
  $content = get_the_excerpt();
92
  }else{
71
  </time>
72
  </div>
73
 
74
+ <?php if ( ampforwp_has_post_thumbnail() ) {
75
+ $thumb_url = ampforwp_get_post_thumbnail();
76
+ if($thumb_url){ ?>
 
 
 
 
 
 
 
77
  <div class="home-post-image">
78
  <a href="<?php echo trailingslashit( trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR );?>">
79
+ <amp-img src=<?php echo esc_url($thumb_url); ?> width=100 height=75></amp-img>
80
  </a>
81
  </div>
82
  <?php }
83
+ }
84
  if( has_excerpt() ){
85
  $content = get_the_excerpt();
86
  }else{
templates/design-manager/design-1/style.php CHANGED
@@ -1,4 +1,11 @@
1
- <?php add_action('amp_post_template_css', 'ampforwp_additional_style_input');
 
 
 
 
 
 
 
2
  function ampforwp_additional_style_input( $amp_template ) {
3
  global $redux_builder_amp;
4
  global $post;
@@ -14,7 +21,32 @@ function ampforwp_additional_style_input( $amp_template ) {
14
  $header_background_color = $get_customizer->get_customizer_setting( 'header_background_color' );
15
  $header_color = $get_customizer->get_customizer_setting( 'header_color' );
16
  ?>
17
- #statcounter{width: 1px;height:1px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  .alignright{ float: right; }
19
  .alignleft{ float: left; }
20
  .aligncenter{ display: block; margin-left: auto; margin-right: auto; max-width: 100% }
@@ -23,7 +55,7 @@ function ampforwp_additional_style_input( $amp_template ) {
23
  amp-iframe{ max-width: 100%; margin-bottom : 20px; }
24
  .amp-wp-content,.amp-wp-title-bar div {<?php if ( $content_max_width > 0 ) : ?> margin: 0 auto;max-width: <?php echo sprintf( '%dpx', $content_max_width ); ?>; <?php endif; ?> }
25
  html{background: <?php echo sanitize_hex_color( $header_background_color ); ?>;} body{background: <?php echo sanitize_hex_color( $theme_color ); ?>;color: <?php echo sanitize_hex_color( $text_color ); ?>;font-family: 'Merriweather', 'Times New Roman', Times, Serif;font-weight: 300;line-height: 1.75em;}
26
- p,ol,ul,figure {margin: 0 0 1em;padding: 0;} a,a:visited {color: <?php echo sanitize_hex_color( $link_color ); ?>;}a:hover,a:active,a:focus {color: <?php echo sanitize_hex_color( $text_color ); ?>;} .wp-caption amp-img{max-width: 100%}
27
  blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background: rgba(127,127,127,.125);border-left: 2px solid <?php echo sanitize_hex_color( $link_color ); ?>;margin: 8px 0 24px 0;padding: 16px;} blockquote p:last-child {margin-bottom: 0;}
28
  .amp-wp-meta,.amp-wp-header .ampforwp-logo-area,.amp-wp-title,.wp-caption-text,.amp-wp-tax-category,.amp-wp-tax-tag,.amp-wp-comments-link,.amp-wp-footer p,.back-to-top {font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;}
29
  .amp-wp-header {background-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;}
@@ -32,15 +64,17 @@ blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background:
32
  .amp-wp-title {color: <?php echo sanitize_hex_color( $text_color ); ?>;display: block;flex: 1 0 100%;font-weight: 900;margin: 0;width: 100%;}.amp-wp-meta {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;display: inline-block;flex: 2 1 50%;font-size: .875em;line-height: 1.7em;margin: 0;padding: 0;}.ampforwp-meta-info{margin-top: 0px;}.amp-wp-article-header .amp-wp-meta:last-of-type {text-align: right;}.amp-wp-article-header .amp-wp-meta:first-of-type {text-align: left;}.amp-wp-byline amp-img,.amp-wp-byline .amp-wp-author {display: inline-block;vertical-align: middle;}.amp-wp-byline amp-img {border: 1px solid <?php echo sanitize_hex_color( $link_color ); ?>;border-radius: 50%;position: relative;margin-right: 6px;}.amp-wp-posted-on {text-align: right;}.hide-meta-info{ display: none; }
33
  .amp-wp-article-featured-image {margin: 1.5em 16px 1.5em;}.amp-wp-article-featured-image amp-img {margin: 0 auto;}.amp-wp-article-featured-image.wp-caption .wp-caption-text, .ampforwp-gallery-item .wp-caption-text {margin: 0 18px;}.amp-wp-frontpage .the_content {padding: 10px;}
34
  .ampforwp-gallery-item.amp-carousel-slide { padding-bottom: 20px;}
35
- .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; font-size: 1.17em; } .amp-wp-footer {border-top: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;margin: calc(1.5em - 1px) 0 0;padding-bottom:25px;}
36
  .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}
37
  .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;}
38
  .amp-wp-footer a{text-decoration:none}.copyright_txt{float:left}.back-to-top{float:right}.amp-wp-header .nav_container{float: right;top: 16px;line-height: 1; right: 65px; position: absolute}.toggle-text{position:absolute;right:0;height:22px;width:28px}.toggle-text span{display:block;position:absolute;height:2px;width:25px;background:#fff;border-radius:19px;opacity:1;left:0}.toggle-text span:nth-child(2){top:9px}.toggle-text span:nth-child(3){top:18px}.amp-wp-home .amp-wp-meta{margin:5px 0}.amp-wp-home .amp-wp-content p{display:inline-block;width:100%}.ampforwp-custom-index .amp-wp-title a {text-decoration: none;color: <?php echo sanitize_hex_color( $text_color ); ?>;}.comment-button-wrapper a,.related_posts ol{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.amp-wp-meta{display:flex}.amp-wp-posted-on{display:initial}#pagination .next,#pagination .prev{display:inline-block}.ampforwp-custom-index .amp-wp-content{margin-bottom:30px}.pagination-holder{margin:1.5em 16px}#pagination .next{float:right}.amp-wp-home .amp-wp-content p{display:inline}.home-post-image{float:right;margin:0 0 10px 20px}.amp-wp-article-content amp-img{max-width:100%}.amp-wp-meta.amp-wp-tax-category,.amp-wp-meta.amp-wp-tax-tag{margin:0}.amp-wp-meta.amp-wp-tax-tag{display:initial}.ampforwp-social-icons{margin:1.5em 16px}.custom-amp-socialsharing-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; }
39
  .custom-amp-socialsharing-icon amp-img{ top: 4px; }
40
- .custom-amp-socialsharing-line{background:#00b900}.custom-amp-socialsharing-vk{background:#45668e}.comment-button-wrapper a{border-style:solid;border-color:#c2c2c2;border-width:1px 1px 2px;border-radius:4px;background-color:transparent;color:#0a89c0;cursor:pointer;display:block;font-size:14px;font-weight:600;text-align:center;line-height:18px;margin:0 auto;max-width:200px;padding:11px 16px;text-decoration:none;width:50%;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.close-nav,.comments_list div,.related_posts ol li,.toggle-navigation ul,.toggle-navigationv2 ul li a{display:inline-block}main .amp-wp-content.comments_list,main .amp-wp-content.relatedpost{background:0 0;box-shadow:none;max-width:1030px}.relatedpost{margin:2em 16px}.comments_list h3,.related_posts span{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333} .related_posts span { display: block;} .related_posts ol{list-style-type:none;margin:0;padding:0}.related_posts ol li{width:100%;margin-bottom:12px;padding:0}.related_posts .related_link a{color:#000;font-size:18px}.related_posts ol li amp-img{width:100px;float:left;margin-right:15px}.related_posts ol li p{font-size:12px;color:#999;line-height:1.2;margin:12px 0 0}.no_related_thumbnail{padding:15px 18px}.comments_list{margin:2.5em 16px}.comments_list ul{margin:0;padding:0}.comments_list ul.children{padding-bottom:10px;margin-left:4%;width:96%}
41
  .comments_list ul li p{margin:0;font-size:14px;clear:both;padding-top:5px; word-break:break-word;}
42
- .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; } .comment-content amp-img{max-width: 300px;} amp-sidebar{width:250px}.amp-sidebar-image{line-height:100px;vertical-align:middle}.amp-close-image{top:15px;left:225px;cursor:pointer}.toggle-navigationv2 ul{list-style-type:none;margin:0;font-family:sans-serif;padding:0}.toggle-navigationv2 ul ul li a{padding-left:35px;background:#fff;display:inline-block}.toggle-navigationv2 ul li a{padding:10px 15px 10px 25px;width:88%;text-decoration:none;background:#fafafa;font-size:13px;border-bottom:1px solid #efefef}.close-nav{font-size:12px;font-family:sans-serif;background:rgba(0,0,0,.25);letter-spacing:1px;padding:10px;border-radius:100px;line-height:8px;margin:14px;left:191px;color:#fff}.close-nav:hover{background:rgba(0,0,0,.45)}.toggle-navigation ul{list-style-type:none;margin:0;padding:0;width:100%}.menu-all-pages-container:after{content:"";clear:both}.toggle-navigation ul li{font-size:13px;border-bottom:1px solid rgba(0,0,0,.11);padding:11px 0;width:25%;float:left;text-align:center;margin-top:6px}.toggle-navigation ul ul{display:none}.toggle-navigation ul li a{color:#eee;padding:15px}.toggle-navigation{display:none;background:#444}.nav_container:hover+.toggle-navigation,.toggle-navigation:active,.toggle-navigation:focus,.toggle-navigation:hover{display:inline-block;width:100%}#amp-user-notification1 p{display:inline-block}amp-user-notification{padding:5px;text-align:center;background:#fff;border-top:1px solid} amp-user-notification button {padding: 8px 10px;background: <?php echo sanitize_hex_color( $header_background_color ); ?>;color: <?php echo sanitize_hex_color( $header_color ); ?>;margin-left: 5px;border: 0;}amp-user-notification button:hover {cursor: pointer} .amp-ad-wrapper {text-align: center} <?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_single() ) { ?>body {padding-bottom: 43px;}<?php } ?> .sticky_social a{text-decoration:none}.sticky_social{width:100%;bottom:0;display:block;left:0;box-shadow:0 4px 7px #000;background:#fff;padding:7px 0 0;position:fixed;margin:0;z-index:10;text-align:center}.whatsapp-share-icon{width:50px;height:28px;display:inline-block;background:#5cbe4a;padding:4px 0;position:relative;top:-4px}.amp-wp-tax-category span:first-child:after{content:' '}.amp-wp-tax-category span:after,.amp-wp-tax-tag span:after{content:', '}.amp-wp-tax-category span:last-child:after,.amp-wp-tax-tag span:last-child:after{content:' '}pre{white-space:pre-wrap}.amp-ad-wrapper.amp_ad_1{padding-top:20px}
43
- .amp-wp-content-loop{width:100%} .ampforwp_single_excerpt { margin-bottom:15px; }
 
 
44
  .ampforwp-ad-above-related-post{padding-top:15px;}
45
  .single-post .amp_author_area amp-img{ margin: 0; float: left; margin-right: 12px; border-radius: 60px; }
46
  .single-post .amp_author_area .amp_author_area_wrapper{ display: inline-block; width: 100%; line-height: 1.4; margin-top: 22px; font-size: 13px; color:#333; font-family: sans-serif; }
@@ -58,7 +92,7 @@ blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background:
58
  .category-widget-gutter h4{ margin-bottom: 0px;}
59
  .category-widget-gutter ul{ margin-top: 10px; list-style-type:none; padding:0 }
60
  .amp-category-block ul{ margin: 1.5em 26px 3.5em; }
61
- .amp-category-post{ width: 32%; display:inline-table; }
62
  .amp-category-post a{ color:#555; text-decoration:none}
63
  .amp-category-post amp-img{ margin-bottom:5px; }
64
  .amp-category-block li:nth-child(3){ margin: 0 1%; }
@@ -68,6 +102,7 @@ blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background:
68
  .searchmenu button{ background:transparent; border:none }
69
  .closebutton{ background: transparent; border: 0; color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 30px; width: 32px; height: 32px; font-size: 12px; text-align: center; position: absolute; top: 12px; right: 20px; outline:none }
70
  amp-lightbox{ background: rgba(0, 0, 0,0.85); }
 
71
  /* Tables */
72
  table { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; overflow-x: auto; }
73
  table a:link { color: #666; font-weight: bold; text-decoration: none; }
@@ -86,6 +121,7 @@ table tr:last-child td {border-bottom: 0;}
86
  table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
87
  table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
88
  table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
 
89
  .amp-facebook-comments{margin: 0 0}
90
 
91
  /* CSS3 icon */
@@ -135,7 +171,8 @@ header, amp-sidebar, article, footer{ direction: rtl;}
135
  <?php
136
  if ( class_exists('TablePress') ) { ?>
137
  .tablepress-table-description{clear:both;display:block}.tablepress{border-collapse:collapse;border-spacing:0;width:100%;margin-bottom:1em;border:none}.tablepress td,.tablepress th{padding:8px;border:none;background:0 0;text-align:left}.tablepress tbody td{vertical-align:top}.tablepress tbody td,.tablepress tfoot th{border-top:1px solid #ddd}.tablepress tbody tr:first-child td{border-top:0}.tablepress thead th{border-bottom:1px solid #ddd}.tablepress tfoot th,.tablepress thead th{background-color:#d9edf7;font-weight:700;vertical-align:middle}.tablepress .odd td{background-color:#f9f9f9}.tablepress .even td{background-color:#fff}.tablepress .row-hover tr:hover td{background-color:#f3f3f3}@media (min-width:768px) and (max-width:1600px){.tablepress{overflow-x:none}}@media (min-width:320px) and (max-width:767px){.tablepress{display:inline-block;overflow-x:scroll}}
138
- <?php } ?>
 
139
  .breadcrumb{line-height: 1; margin: 0.1em 16px 1.5em;}
140
  .breadcrumb ul{padding:0; margin:0;}
141
  .breadcrumb ul li{display:inline;}
@@ -143,7 +180,9 @@ if ( class_exists('TablePress') ) { ?>
143
  .breadcrumb ul li a::after {content: "►";display: inline-block;font-size: 8px;padding: 0 6px 0 7px;vertical-align: middle;opacity: 0.5;position:relative;top: -1px;}
144
  .breadcrumb ul li:hover a::after{color:#c3c3c3;}
145
  .breadcrumb ul li:last-child a::after{display:none;}
 
146
  .amp-wp-content.widget-wrapper{max-width:840px}
147
  .amp_widget_above_the_footer {margin:0 10px;}
148
  .widget-wrapper li { list-style-position: inside; }
 
149
  <?php echo $redux_builder_amp['css_editor']; } ?>
1
+ <?php
2
+ add_filter( 'amp_post_template_data', 'ampforwp_add_design1_remove_googlefonts' );
3
+ function ampforwp_add_design1_remove_googlefonts( $data ) {
4
+ unset($data['font_urls']['merriweather']);
5
+ return $data;
6
+ }
7
+
8
+ add_action('amp_post_template_css', 'ampforwp_additional_style_input');
9
  function ampforwp_additional_style_input( $amp_template ) {
10
  global $redux_builder_amp;
11
  global $post;
21
  $header_background_color = $get_customizer->get_customizer_setting( 'header_background_color' );
22
  $header_color = $get_customizer->get_customizer_setting( 'header_color' );
23
  ?>
24
+ #statcounter{width: 1px;height:1px;}
25
+ @font-face {
26
+ font-family: 'Merriweather';
27
+ font-style: normal;
28
+ font-weight: 400;
29
+ src: local('Merriweather'), local('Merriweather-Regular'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Merriweather-Regular.ttf');
30
+ }
31
+ @font-face {
32
+ font-family: 'Merriweather';
33
+ font-style: normal;
34
+ font-weight: 700;
35
+ src: local('Merriweather Bold'), local('Merriweather-Bold'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Merriweather-Bold.ttf');
36
+ }
37
+ @font-face {
38
+ font-family: 'Merriweather';
39
+ font-style: italic;
40
+ font-weight: 400;
41
+ src: local('Merriweather Italic'), local('Merriweather-Italic'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Merriweather-Italic.ttf');
42
+ }
43
+ @font-face {
44
+ font-family: 'Merriweather';
45
+ font-style: italic;
46
+ font-weight: 700;
47
+ src: local('Merriweather Bold Italic'), local('Merriweather-BoldItalic'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Merriweather-BoldItalic.ttf');
48
+ }
49
+ .cb{clear:both}
50
  .alignright{ float: right; }
51
  .alignleft{ float: left; }
52
  .aligncenter{ display: block; margin-left: auto; margin-right: auto; max-width: 100% }
55
  amp-iframe{ max-width: 100%; margin-bottom : 20px; }
56
  .amp-wp-content,.amp-wp-title-bar div {<?php if ( $content_max_width > 0 ) : ?> margin: 0 auto;max-width: <?php echo sprintf( '%dpx', $content_max_width ); ?>; <?php endif; ?> }
57
  html{background: <?php echo sanitize_hex_color( $header_background_color ); ?>;} body{background: <?php echo sanitize_hex_color( $theme_color ); ?>;color: <?php echo sanitize_hex_color( $text_color ); ?>;font-family: 'Merriweather', 'Times New Roman', Times, Serif;font-weight: 300;line-height: 1.75em;}
58
+ p,ol,ul,figure {margin: 0 0 1em;padding: 0;} a,a:visited {color:<?php echo $redux_builder_amp['amp-opt-color-rgba-link-design1']['color']; ?>;}a:hover,a:active,a:focus {color: <?php echo sanitize_hex_color( $text_color ); ?>;} .wp-caption amp-img{max-width: 100%}
59
  blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background: rgba(127,127,127,.125);border-left: 2px solid <?php echo sanitize_hex_color( $link_color ); ?>;margin: 8px 0 24px 0;padding: 16px;} blockquote p:last-child {margin-bottom: 0;}
60
  .amp-wp-meta,.amp-wp-header .ampforwp-logo-area,.amp-wp-title,.wp-caption-text,.amp-wp-tax-category,.amp-wp-tax-tag,.amp-wp-comments-link,.amp-wp-footer p,.back-to-top {font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;}
61
  .amp-wp-header {background-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;}
64
  .amp-wp-title {color: <?php echo sanitize_hex_color( $text_color ); ?>;display: block;flex: 1 0 100%;font-weight: 900;margin: 0;width: 100%;}.amp-wp-meta {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;display: inline-block;flex: 2 1 50%;font-size: .875em;line-height: 1.7em;margin: 0;padding: 0;}.ampforwp-meta-info{margin-top: 0px;}.amp-wp-article-header .amp-wp-meta:last-of-type {text-align: right;}.amp-wp-article-header .amp-wp-meta:first-of-type {text-align: left;}.amp-wp-byline amp-img,.amp-wp-byline .amp-wp-author {display: inline-block;vertical-align: middle;}.amp-wp-byline amp-img {border: 1px solid <?php echo sanitize_hex_color( $link_color ); ?>;border-radius: 50%;position: relative;margin-right: 6px;}.amp-wp-posted-on {text-align: right;}.hide-meta-info{ display: none; }
65
  .amp-wp-article-featured-image {margin: 1.5em 16px 1.5em;}.amp-wp-article-featured-image amp-img {margin: 0 auto;}.amp-wp-article-featured-image.wp-caption .wp-caption-text, .ampforwp-gallery-item .wp-caption-text {margin: 0 18px;}.amp-wp-frontpage .the_content {padding: 10px;}
66
  .ampforwp-gallery-item.amp-carousel-slide { padding-bottom: 20px;}
67
+ .amp-wp-frontpage .ampforwp-title {margin-left:10px;}.amp-wp-article a{text-decoration:none}.amp-wp-article-content {margin: 0 16px;}.amp-wp-article-content ul,.amp-wp-article-content ol {margin-left: 1em;}.amp-wp-article-content amp-img {margin: 0 auto;}.amp-wp-article-content amp-img.alignright {margin: 0 0 1em 16px;}.amp-wp-article-content amp-img.alignleft {margin: 0 16px 1em 0;} .amp-disqus-comments {padding: 15px;}.amp-disqus-comments amp-iframe{background: none;}.wp-caption {padding: 0;}.wp-caption.alignleft {margin-right: 16px;}.wp-caption.alignright { margin-left: 16px;}.wp-caption-text {border-bottom: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;margin: 0;padding: .66em 10px .75em;text-align: center;} amp-carousel {background: <?php echo sanitize_hex_color( $border_color ); ?>;margin: 0 -16px 1.5em;} amp-iframe,amp-youtube,amp-instagram,amp-vine {background: <?php echo sanitize_hex_color( $border_color ); ?>;margin: 0 -16px 1.5em; } .amp-wp-article-content amp-carousel amp-img {border: none;} amp-carousel > amp-img > img {object-fit: contain; } .amp-wp-iframe-placeholder { background: <?php echo sanitize_hex_color( $border_color ); ?> url( <?php echo esc_url( $get_customizer->get( 'placeholder_image_url' ) ); ?> ) no-repeat center 40%;background-size: 48px 48px;min-height: 48px;} .amp-wp-article-footer .amp-wp-meta {display: block;} .amp-wp-tags{ list-style-type: none; padding: 0; margin: 0 0 9px 0; display: inline-flex; } .amp-wp-tags li{display:inline; padding-left: 5px; } .amp-wp-tax-category span{margin-right:5px;} .amp-wp-tax-category, .amp-wp-tax-tag { color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;margin: 1.5em 16px;}.ampforwp-comment-button {margin-bottom:20px;} .amp-wp-comments-link {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;text-align: center;margin: 2.25em 0 1.5em;} .amp-wp-comments-link a { border-style: solid;border-color: <?php echo sanitize_hex_color( $border_color ); ?>;border-width: 1px 1px 2px;border-radius: 4px;background-color: transparent;color: <?php echo sanitize_hex_color( $link_color ); ?>;cursor: pointer; display: block;font-size: 14px;font-weight: 600;line-height: 18px;margin: 0 auto;max-width: 200px;padding: 11px 16px;text-decoration: none;width: 50%;-webkit-transition: background-color 0.2s ease;transition: background-color 0.2s ease;} .page-title {margin: 0 15px; font-size: 1.17em; } .amp-wp-footer {border-top: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;margin: calc(1.5em - 1px) 0 0;padding-bottom:25px;}
68
  .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}
69
  .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;}
70
  .amp-wp-footer a{text-decoration:none}.copyright_txt{float:left}.back-to-top{float:right}.amp-wp-header .nav_container{float: right;top: 16px;line-height: 1; right: 65px; position: absolute}.toggle-text{position:absolute;right:0;height:22px;width:28px}.toggle-text span{display:block;position:absolute;height:2px;width:25px;background:#fff;border-radius:19px;opacity:1;left:0}.toggle-text span:nth-child(2){top:9px}.toggle-text span:nth-child(3){top:18px}.amp-wp-home .amp-wp-meta{margin:5px 0}.amp-wp-home .amp-wp-content p{display:inline-block;width:100%}.ampforwp-custom-index .amp-wp-title a {text-decoration: none;color: <?php echo sanitize_hex_color( $text_color ); ?>;}.comment-button-wrapper a,.related_posts ol{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.amp-wp-meta{display:flex}.amp-wp-posted-on{display:initial}#pagination .next,#pagination .prev{display:inline-block}.ampforwp-custom-index .amp-wp-content{margin-bottom:30px}.pagination-holder{margin:1.5em 16px}#pagination .next{float:right}.amp-wp-home .amp-wp-content p{display:inline}.home-post-image{float:right;margin:0 0 10px 20px}.amp-wp-article-content amp-img{max-width:100%}.amp-wp-meta.amp-wp-tax-category,.amp-wp-meta.amp-wp-tax-tag{margin:0}.amp-wp-meta.amp-wp-tax-tag{display:initial}.ampforwp-social-icons{margin:1.5em 16px}.custom-amp-socialsharing-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; }
71
  .custom-amp-socialsharing-icon amp-img{ top: 4px; }
72
+ .custom-amp-socialsharing-line{background:#00b900}.custom-amp-socialsharing-vk{background:#45668e}.custom-amp-social-sharing-odnoklassniki{background:#ed812b}.comment-button-wrapper a{border-style:solid;border-color:#c2c2c2;border-width:1px 1px 2px;border-radius:4px;background-color:transparent;color:#0a89c0;cursor:pointer;display:block;font-size:14px;font-weight:600;text-align:center;line-height:18px;margin:0 auto;max-width:200px;padding:11px 16px;text-decoration:none;width:50%;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.close-nav,.comments_list div,.related_posts ol li,.toggle-navigation ul,.toggle-navigationv2 ul li a{display:inline-block}main .amp-wp-content.comments_list,main .amp-wp-content.relatedpost{background:0 0;box-shadow:none;max-width:1030px}.relatedpost{margin:2em 16px}.comments_list h3,.related_posts span{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333} .related_posts span { display: block;} .related_posts ol{list-style-type:none;margin:0;padding:0}.related_posts ol li{width:100%;margin-bottom:12px;padding:0}.related_posts .related_link a{color:#000;font-size:18px}.related_posts ol li amp-img{width:100px;float:left;margin-right:15px}.related_posts ol li p{font-size:12px;color:#999;line-height:1.2;margin:12px 0 0}.no_related_thumbnail{padding:15px 18px}.comments_list{margin:2.5em 16px}.comments_list ul{margin:0;padding:0}.comments_list ul.children{padding-bottom:10px;margin-left:4%;width:96%}
73
  .comments_list ul li p{margin:0;font-size:14px;clear:both;padding-top:5px; word-break:break-word;}
74
+ .comments_list ul li{font-family:sans-serif;font-size:11px;list-style-type:none;margin-bottom:12px;background:#fefefe;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:0 2px 3px rgba(0,0,0,.05);-webkit-box-shadow:0 2px 3px rgba(0,0,0,.05);box-shadow:0 2px 3px rgba(0,0,0,.05);padding:0;max-width:1000px;width:96%}.comments_list ul li .says{margin-right:4px}.comments_list li li,.comments_list li li li{margin:20px 20px 10px}.comments_list ul li p{font-family:Merriweather,'Times New Roman',Times,Serif}.comments_list ul li .comment-body{padding:10px 0 15px}.comment-author{float:left}.single-post footer.comment-meta{padding-bottom:0; line-height: 1.9;}.comments_list li li{background:#f7f7f7;box-shadow:none;border:1px solid #eee} .page-numbers{ padding: 9px 10px; background: #fff; font-size: 14px; } .comment-author-img{float: left; margin-right: 5px; border-radius: 60px;} .comment-content amp-img{max-width: 300px;} amp-sidebar{width:250px}.amp-sidebar-image{line-height:100px;vertical-align:middle}.amp-close-image{top:15px;left:225px;cursor:pointer}.toggle-navigationv2 ul{list-style-type:none;margin:0;font-family:sans-serif;padding:0}.toggle-navigationv2 ul ul li a{padding-left:35px;background:#fff;display:inline-block}.toggle-navigationv2 ul li a{padding:10px 15px 10px 25px;width:88%;text-decoration:none;background:#fafafa;font-size:13px;border-bottom:1px solid #efefef}.close-nav{font-size:12px;font-family:sans-serif;background:rgba(0,0,0,.25);letter-spacing:1px;padding:10px;border-radius:100px;line-height:8px;margin:14px;left:191px;color:#fff}.close-nav:hover{background:rgba(0,0,0,.45)}.toggle-navigation ul{list-style-type:none;margin:0;padding:0;width:100%}.menu-all-pages-container:after{content:"";clear:both}.toggle-navigation ul li{font-size:13px;border-bottom:1px solid rgba(0,0,0,.11);padding:11px 0;width:25%;float:left;text-align:center;margin-top:6px}.toggle-navigation ul ul{display:none}.toggle-navigation ul li a{color:#eee;padding:15px}.toggle-navigation{display:none;background:#444}.nav_container:hover+.toggle-navigation,.toggle-navigation:active,.toggle-navigation:focus,.toggle-navigation:hover{display:inline-block;width:100%}#amp-user-notification1 p{display:inline-block}amp-user-notification{padding:5px;text-align:center;background:#fff;border-top:1px solid} amp-user-notification button {padding: 8px 10px;background: <?php echo sanitize_hex_color( $header_background_color ); ?>;color: <?php echo sanitize_hex_color( $header_color ); ?>;margin-left: 5px;border: 0;}amp-user-notification button:hover {cursor: pointer} .amp-ad-wrapper {text-align: center} <?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_single() ) { ?>body {padding-bottom: 43px;}<?php } ?> .sticky_social a{text-decoration:none}.sticky_social{width:100%;bottom:0;display:block;left:0;box-shadow:0 4px 7px #000;background:#fff;padding:7px 0 0;position:fixed;margin:0;z-index:10;text-align:center}.whatsapp-share-icon{width:50px;height:28px;display:inline-block;background:#5cbe4a;padding:4px 0;position:relative;top:-4px}.amp-wp-tax-category span:first-child:after{content:' '}.amp-wp-tax-category span:after,.amp-wp-tax-tag span:after{content:', '}.amp-wp-tax-category span:last-child:after,.amp-wp-tax-tag span:last-child:after{content:' '}pre{white-space:pre-wrap}.amp-ad-wrapper.amp_ad_1{padding-top:20px}
75
+ .amp-wp-content-loop{width:100%}
76
+ .amp-wp-content-loop ul{margin:0}
77
+ .ampforwp_single_excerpt { margin-bottom:15px; }
78
  .ampforwp-ad-above-related-post{padding-top:15px;}
79
  .single-post .amp_author_area amp-img{ margin: 0; float: left; margin-right: 12px; border-radius: 60px; }
80
  .single-post .amp_author_area .amp_author_area_wrapper{ display: inline-block; width: 100%; line-height: 1.4; margin-top: 22px; font-size: 13px; color:#333; font-family: sans-serif; }
92
  .category-widget-gutter h4{ margin-bottom: 0px;}
93
  .category-widget-gutter ul{ margin-top: 10px; list-style-type:none; padding:0 }
94
  .amp-category-block ul{ margin: 1.5em 26px 3.5em; }
95
+ .amp-category-post{ width: 32%; display: inline-block; word-wrap: break-word;float: left;}
96
  .amp-category-post a{ color:#555; text-decoration:none}
97
  .amp-category-post amp-img{ margin-bottom:5px; }
98
  .amp-category-block li:nth-child(3){ margin: 0 1%; }
102
  .searchmenu button{ background:transparent; border:none }
103
  .closebutton{ background: transparent; border: 0; color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 30px; width: 32px; height: 32px; font-size: 12px; text-align: center; position: absolute; top: 12px; right: 20px; outline:none }
104
  amp-lightbox{ background: rgba(0, 0, 0,0.85); }
105
+ <?php if( is_singular() || is_home() && $redux_builder_amp['amp-frontpage-select-option'] && ampforwp_get_blog_details() == false ) { ?>
106
  /* Tables */
107
  table { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; overflow-x: auto; }
108
  table a:link { color: #666; font-weight: bold; text-decoration: none; }
121
  table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
122
  table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
123
  table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
124
+ <?php } ?>
125
  .amp-facebook-comments{margin: 0 0}
126
 
127
  /* CSS3 icon */
171
  <?php
172
  if ( class_exists('TablePress') ) { ?>
173
  .tablepress-table-description{clear:both;display:block}.tablepress{border-collapse:collapse;border-spacing:0;width:100%;margin-bottom:1em;border:none}.tablepress td,.tablepress th{padding:8px;border:none;background:0 0;text-align:left}.tablepress tbody td{vertical-align:top}.tablepress tbody td,.tablepress tfoot th{border-top:1px solid #ddd}.tablepress tbody tr:first-child td{border-top:0}.tablepress thead th{border-bottom:1px solid #ddd}.tablepress tfoot th,.tablepress thead th{background-color:#d9edf7;font-weight:700;vertical-align:middle}.tablepress .odd td{background-color:#f9f9f9}.tablepress .even td{background-color:#fff}.tablepress .row-hover tr:hover td{background-color:#f3f3f3}@media (min-width:768px) and (max-width:1600px){.tablepress{overflow-x:none}}@media (min-width:320px) and (max-width:767px){.tablepress{display:inline-block;overflow-x:scroll}}
174
+ <?php }
175
+ if( !is_home() && $redux_builder_amp['ampforwp-bread-crumb'] == 1 ) { ?>
176
  .breadcrumb{line-height: 1; margin: 0.1em 16px 1.5em;}
177
  .breadcrumb ul{padding:0; margin:0;}
178
  .breadcrumb ul li{display:inline;}
180
  .breadcrumb ul li a::after {content: "►";display: inline-block;font-size: 8px;padding: 0 6px 0 7px;vertical-align: middle;opacity: 0.5;position:relative;top: -1px;}
181
  .breadcrumb ul li:hover a::after{color:#c3c3c3;}
182
  .breadcrumb ul li:last-child a::after{display:none;}
183
+ <?php } ?>
184
  .amp-wp-content.widget-wrapper{max-width:840px}
185
  .amp_widget_above_the_footer {margin:0 10px;}
186
  .widget-wrapper li { list-style-position: inside; }
187
+ .amp-menu > li > a > amp-img, .sub-menu > li > a > amp-img { display: inline-block; margin-right: 4px; }
188
  <?php echo $redux_builder_amp['css_editor']; } ?>
templates/design-manager/design-2/archive.php CHANGED
@@ -79,32 +79,26 @@
79
  } ?>
80
 
81
  <div class="amp-wp-content amp-loop-list">
82
- <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) {
83
- if ( has_post_thumbnail()) {
84
- $thumb_id = get_post_thumbnail_id();
85
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
86
- $thumb_url = $thumb_url_array[0];
87
- }
88
- else{
89
- $thumb_url = ampforwp_cf_featured_image_src();
90
- }
91
- ?>
92
- <div class="home-post_image">
93
- <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
94
- <amp-img
95
- src=<?php echo $thumb_url ?>
96
- <?php ampforwp_thumbnail_alt(); ?>
97
- <?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
98
- width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
99
- height=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-height'] ?>
100
- <?php } else { ?>
101
- width=100
102
- height=75
103
- <?php } ?>
104
- ></amp-img>
105
- </a>
106
- </div>
107
- <?php } ?>
108
 
109
  <div class="amp-wp-post-content">
110
 
79
  } ?>
80
 
81
  <div class="amp-wp-content amp-loop-list">
82
+ <?php if ( ampforwp_has_post_thumbnail() ) {
83
+ $thumb_url = ampforwp_get_post_thumbnail();
84
+ if($thumb_url){ ?>
85
+ <div class="home-post_image">
86
+ <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
87
+ <amp-img
88
+ src=<?php echo esc_url($thumb_url); ?>
89
+ <?php ampforwp_thumbnail_alt(); ?>
90
+ <?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
91
+ width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
92
+ height=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-height'] ?>
93
+ <?php } else { ?>
94
+ width=100
95
+ height=75
96
+ <?php } ?>
97
+ ></amp-img>
98
+ </a>
99
+ </div>
100
+ <?php }
101
+ } ?>
 
 
 
 
 
 
102
 
103
  <div class="amp-wp-post-content">
104
 
templates/design-manager/design-2/elements/comments.php CHANGED
@@ -23,18 +23,22 @@ if (!comments_open() || ( isset($redux_builder_amp['wordpress-comments-support']
23
  function ampforwp_custom_translated_comment($comment, $args, $depth){
24
  $GLOBALS['comment'] = $comment;
25
  global $redux_builder_amp;
26
- ?>
 
27
  <li id="li-comment-<?php comment_ID() ?>"
28
  <?php comment_class(); ?> >
29
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
30
  <footer class="comment-meta">
 
 
 
31
  <div class="comment-author vcard">
32
  <?php
33
  printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
34
  </div>
35
  <!-- .comment-author -->
36
  <div class="comment-metadata">
37
- <a href="<?php echo htmlspecialchars( trailingslashit( get_comment_link( $comment->comment_ID ) ) ) ?>">
38
  <?php printf( ampforwp_translation( ('%1$s '. ampforwp_translation($redux_builder_amp['amp-translator-at-text'],'at').' %2$s'), '%1$s at %2$s') , get_comment_date(), get_comment_time())?>
39
  </a>
40
  <?php edit_comment_link( ampforwp_translation( $redux_builder_amp['amp-translator-Edit-text'], 'Edit' ) ) ?>
@@ -47,8 +51,10 @@ if (!comments_open() || ( isset($redux_builder_amp['wordpress-comments-support']
47
  $comment_content = get_comment_text();
48
  // Added <p> tag in comments #873
49
  $comment_content = wpautop( $comment_content );
50
- $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(),
51
- 'AMP_Video_Sanitizer' => array() ) ) );
 
 
52
  $sanitized_comment_content = $sanitizer->get_amp_content();
53
  echo make_clickable( $sanitized_comment_content ); ?>
54
  </div>
23
  function ampforwp_custom_translated_comment($comment, $args, $depth){
24
  $GLOBALS['comment'] = $comment;
25
  global $redux_builder_amp;
26
+ $comment_author_img_url = "";
27
+ $comment_author_img_url = ampforwp_get_comments_gravatar( $comment ); ?>
28
  <li id="li-comment-<?php comment_ID() ?>"
29
  <?php comment_class(); ?> >
30
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
31
  <footer class="comment-meta">
32
+ <?php if($comment_author_img_url){ ?>
33
+ <amp-img src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
34
+ <?php } ?>
35
  <div class="comment-author vcard">
36
  <?php
37
  printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
38
  </div>
39
  <!-- .comment-author -->
40
  <div class="comment-metadata">
41
+ <a href="<?php echo htmlspecialchars( untrailingslashit( get_comment_link( $comment->comment_ID ) ) ) ?>">
42
  <?php printf( ampforwp_translation( ('%1$s '. ampforwp_translation($redux_builder_amp['amp-translator-at-text'],'at').' %2$s'), '%1$s at %2$s') , get_comment_date(), get_comment_time())?>
43
  </a>
44
  <?php edit_comment_link( ampforwp_translation( $redux_builder_amp['amp-translator-Edit-text'], 'Edit' ) ) ?>
51
  $comment_content = get_comment_text();
52
  // Added <p> tag in comments #873
53
  $comment_content = wpautop( $comment_content );
54
+ $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array(
55
+ 'AMP_Img_Sanitizer' => array(),
56
+ 'AMP_Video_Sanitizer' => array(),
57
+ 'AMP_Style_Sanitizer' => array() ) ) );
58
  $sanitized_comment_content = $sanitizer->get_amp_content();
59
  echo make_clickable( $sanitized_comment_content ); ?>
60
  </div>
templates/design-manager/design-2/elements/content.php CHANGED
@@ -47,7 +47,7 @@ if( array_key_exists( 'enable-excerpt-single' , $redux_builder_amp ) ) {
47
 
48
  <!--Post Next-Previous Links-->
49
  <?php global $redux_builder_amp;
50
- if($redux_builder_amp['enable-single-next-prev']) { ?>
51
  <!--IF Starts here-->
52
  <div class="amp-wp-content post-pagination-meta">
53
  <div id="pagination">
47
 
48
  <!--Post Next-Previous Links-->
49
  <?php global $redux_builder_amp;
50
+ if($redux_builder_amp['enable-single-next-prev'] && !is_page() ) { ?>
51
  <!--IF Starts here-->
52
  <div class="amp-wp-content post-pagination-meta">
53
  <div id="pagination">
templates/design-manager/design-2/elements/featured-image.php CHANGED
@@ -1,5 +1,10 @@
1
  <?php do_action('ampforwp_before_featured_image_hook',$this);
2
  global $redux_builder_amp, $post;
 
 
 
 
 
3
  $featured_image = $this->get( 'featured_image' );
4
  if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || $redux_builder_amp['ampforwp-featured-image-from-content'] == true ) {
5
  if ( $featured_image ) {
1
  <?php do_action('ampforwp_before_featured_image_hook',$this);
2
  global $redux_builder_amp, $post;
3
+
4
+ $amp_html = "";
5
+ $caption = "";
6
+ $featured_image = "";
7
+
8
  $featured_image = $this->get( 'featured_image' );
9
  if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || $redux_builder_amp['ampforwp-featured-image-from-content'] == true ) {
10
  if ( $featured_image ) {
templates/design-manager/design-2/elements/meta-info.php CHANGED
@@ -9,18 +9,19 @@
9
  <?php $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 24 ) ); ?>
10
  <div class="amp-wp-meta amp-wp-byline">
11
  <?php
12
- if(is_single() ) {?>
13
- <span class="amp-wp-author author vcard"><?php echo esc_html( $post_author->display_name ); ?></span>
14
  <li class="amp-wp-meta-date"> <?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-on-text'] . ' ', 'On'); the_modified_date( get_option( 'date_format' ) ) ?></li>
15
  <?php }
16
- if( is_page() && $redux_builder_amp['meta_page'] ) { ?>
17
- <span class="amp-wp-author author vcard"><?php echo esc_html( $post_author->display_name ); ?></span>
18
  <li class="amp-wp-meta-date"> <?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-on-text'] . ' ', 'On'); the_modified_date( get_option( 'date_format' ) ) ?></li>
19
  <?php } ?>
20
  </div>
21
  <?php endif; ?>
22
 
23
  <?php
 
24
  $ampforwp_categories = get_the_terms( $this->ID, 'category' );
25
  if ( $ampforwp_categories ) : ?>
26
  <div class="amp-wp-meta amp-wp-tax-category ampforwp-tax-category">
@@ -42,7 +43,7 @@
42
 
43
  ?>
44
  </div>
45
- <?php endif; ?>
46
 
47
  </ul>
48
  </div>
9
  <?php $author_avatar_url = get_avatar_url( $post_author->user_email, array( 'size' => 24 ) ); ?>
10
  <div class="amp-wp-meta amp-wp-byline">
11
  <?php
12
+ if(is_single() ) {
13
+ echo ampforwp_get_author_details( $post_author , 'meta-info' ); ?>
14
  <li class="amp-wp-meta-date"> <?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-on-text'] . ' ', 'On'); the_modified_date( get_option( 'date_format' ) ) ?></li>
15
  <?php }
16
+ if( is_page() && $redux_builder_amp['meta_page'] ) {
17
+ echo ampforwp_get_author_details( $post_author , 'meta-info' ); ?>
18
  <li class="amp-wp-meta-date"> <?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-on-text'] . ' ', 'On'); the_modified_date( get_option( 'date_format' ) ) ?></li>
19
  <?php } ?>
20
  </div>
21
  <?php endif; ?>
22
 
23
  <?php
24
+ if( isset($redux_builder_amp['ampforwp-cats-single']) && $redux_builder_amp['ampforwp-cats-single']) {
25
  $ampforwp_categories = get_the_terms( $this->ID, 'category' );
26
  if ( $ampforwp_categories ) : ?>
27
  <div class="amp-wp-meta amp-wp-tax-category ampforwp-tax-category">
43
 
44
  ?>
45
  </div>
46
+ <?php endif; } ?>
47
 
48
  </ul>
49
  </div>
templates/design-manager/design-2/elements/meta-taxonomy.php CHANGED
@@ -1,6 +1,7 @@
 
 
1
  <div class="amp-wp-article-header amp-wp-article-category ampforwp-meta-taxonomy ">
2
- <?php global $redux_builder_amp;
3
- $ampforwp_tags= get_the_terms( $this->ID, 'post_tag' );
4
  if ( $ampforwp_tags && ! is_wp_error( $ampforwp_tags ) ) :?>
5
  <?php do_action('ampforwp_before_meta_taxonomy_hook',$this); ?>
6
  <div class="amp-wp-meta amp-wp-tax-tag ampforwp-tax-tag">
@@ -26,7 +27,7 @@
26
 
27
  </div>
28
  <?php endif;?>
29
- </div>
30
 
31
  <?php
32
 
@@ -45,8 +46,9 @@ if( array_key_exists( 'amp-author-description' , $redux_builder_amp ) && is_sing
45
  if ( $author_avatar_url ) { ?>
46
  <amp-img src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
47
  <?php
48
- } ?>
49
- <strong><?php echo esc_html( $post_author->display_name ); ?></strong>: <?php echo $post_author->description ; ?>
 
50
 
51
  <?php } ?>
52
  </div>
1
+ <?php global $redux_builder_amp;
2
+ if( isset($redux_builder_amp['ampforwp-tags-single']) && $redux_builder_amp['ampforwp-tags-single']) { ?>
3
  <div class="amp-wp-article-header amp-wp-article-category ampforwp-meta-taxonomy ">
4
+ <?php $ampforwp_tags= get_the_terms( $this->ID, 'post_tag' );
 
5
  if ( $ampforwp_tags && ! is_wp_error( $ampforwp_tags ) ) :?>
6
  <?php do_action('ampforwp_before_meta_taxonomy_hook',$this); ?>
7
  <div class="amp-wp-meta amp-wp-tax-tag ampforwp-tax-tag">
27
 
28
  </div>
29
  <?php endif;?>
30
+ </div> <?php } ?>
31
 
32
  <?php
33
 
46
  if ( $author_avatar_url ) { ?>
47
  <amp-img src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
48
  <?php
49
+ }
50
+ echo ampforwp_get_author_details( $post_author , 'meta-taxonomy' );
51
+ echo $post_author->description ; ?>
52
 
53
  <?php } ?>
54
  </div>
templates/design-manager/design-2/elements/related-posts.php CHANGED
@@ -5,7 +5,11 @@
5
 
6
  // declaring this variable here to prevent debug errors
7
  $args = null;
8
-
 
 
 
 
9
  // Custom Post types
10
  if( $current_post_type = get_post_type( $post )) {
11
  // The query arguments
@@ -14,7 +18,7 @@
14
  $args = array(
15
  'posts_per_page'=> $int_number_of_related_posts,
16
  'order' => 'DESC',
17
- 'orderby' => 'ID',
18
  'post_type' => $current_post_type,
19
  'post__not_in' => array( $post->ID )
20
  );
@@ -27,12 +31,13 @@
27
  $category_ids = array();
28
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
29
  $args=array(
30
- 'category__in' => $category_ids,
31
- 'post__not_in' => array($post->ID),
32
- 'posts_per_page'=> $int_number_of_related_posts,
33
- 'ignore_sticky_posts'=>1,
34
- 'has_password' => false ,
35
- 'post_status'=> 'publish'
 
36
  );
37
  }
38
  } //end of block for categories
@@ -40,16 +45,17 @@
40
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
41
  $ampforwp_tags = get_the_tags($post->ID);
42
  if ($ampforwp_tags) {
43
- $tag_ids = array();
44
- foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
45
- $args=array(
46
- 'tag__in' => $tag_ids,
47
- 'post__not_in' => array($post->ID),
48
- 'posts_per_page'=> $int_number_of_related_posts,
49
- 'ignore_sticky_posts'=>1,
50
- 'has_password' => false ,
51
- 'post_status'=> 'publish'
52
- );
 
53
  }
54
  }//end of block for tags
55
  $my_query = new wp_query( $args );
5
 
6
  // declaring this variable here to prevent debug errors
7
  $args = null;
8
+ $orderby = 'ID';
9
+ // Check for the order of related posts
10
+ if( isset( $redux_builder_amp['ampforwp-single-order-of-related-posts'] ) && $redux_builder_amp['ampforwp-single-order-of-related-posts'] ){
11
+ $orderby = 'rand';
12
+ }
13
  // Custom Post types
14
  if( $current_post_type = get_post_type( $post )) {
15
  // The query arguments
18
  $args = array(
19
  'posts_per_page'=> $int_number_of_related_posts,
20
  'order' => 'DESC',
21
+ 'orderby' => $orderby,
22
  'post_type' => $current_post_type,
23
  'post__not_in' => array( $post->ID )
24
  );
31
  $category_ids = array();
32
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
33
  $args=array(
34
+ 'category__in' => $category_ids,
35
+ 'post__not_in' => array($post->ID),
36
+ 'posts_per_page' => $int_number_of_related_posts,
37
+ 'ignore_sticky_posts'=> 1,
38
+ 'has_password' => false ,
39
+ 'post_status' => 'publish',
40
+ 'orderby' => $orderby
41
  );
42
  }
43
  } //end of block for categories
45
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
46
  $ampforwp_tags = get_the_tags($post->ID);
47
  if ($ampforwp_tags) {
48
+ $tag_ids = array();
49
+ foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
50
+ $args=array(
51
+ 'tag__in' => $tag_ids,
52
+ 'post__not_in' => array($post->ID),
53
+ 'posts_per_page' => $int_number_of_related_posts,
54
+ 'ignore_sticky_posts'=> 1,
55
+ 'has_password' => false ,
56
+ 'post_status' => 'publish',
57
+ 'orderby' => $orderby
58
+ );
59
  }
60
  }//end of block for tags
61
  $my_query = new wp_query( $args );
templates/design-manager/design-2/elements/social-icons.php CHANGED
@@ -54,6 +54,13 @@ if ( is_single() ) {
54
  </div>
55
  </a>
56
  <?php } ?>
 
 
 
 
 
 
 
57
  </div>
58
  <?php } ?>
59
  <?php do_action('ampforwp_after_social_icons_hook',$this);
54
  </div>
55
  </a>
56
  <?php } ?>
57
+ <?php if($redux_builder_amp['enable-single-odnoklassniki-share'] == true) { ?>
58
+ <a href="http://ok.ru/dk?st.cmd=WidgetShare&st.shareUrl=<?php echo get_the_permalink(); ?>" target="_blank">
59
+ <div class="custom-amp-socialsharing-icon custom-amp-social-sharing-odnoklassniki">
60
+ <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjRweCIgdmlld0JveD0iMCAwIDk1LjQ4MSA5NS40ODEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDk1LjQ4MSA5NS40ODE7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8Zz4KCQk8cGF0aCBkPSJNNDMuMDQxLDY3LjI1NGMtNy40MDItMC43NzItMTQuMDc2LTIuNTk1LTE5Ljc5LTcuMDY0Yy0wLjcwOS0wLjU1Ni0xLjQ0MS0xLjA5Mi0yLjA4OC0xLjcxMyAgICBjLTIuNTAxLTIuNDAyLTIuNzUzLTUuMTUzLTAuNzc0LTcuOTg4YzEuNjkzLTIuNDI2LDQuNTM1LTMuMDc1LDcuNDg5LTEuNjgyYzAuNTcyLDAuMjcsMS4xMTcsMC42MDcsMS42MzksMC45NjkgICAgYzEwLjY0OSw3LjMxNywyNS4yNzgsNy41MTksMzUuOTY3LDAuMzI5YzEuMDU5LTAuODEyLDIuMTkxLTEuNDc0LDMuNTAzLTEuODEyYzIuNTUxLTAuNjU1LDQuOTMsMC4yODIsNi4yOTksMi41MTQgICAgYzEuNTY0LDIuNTQ5LDEuNTQ0LDUuMDM3LTAuMzgzLDcuMDE2Yy0yLjk1NiwzLjAzNC02LjUxMSw1LjIyOS0xMC40NjEsNi43NjFjLTMuNzM1LDEuNDQ4LTcuODI2LDIuMTc3LTExLjg3NSwyLjY2MSAgICBjMC42MTEsMC42NjUsMC44OTksMC45OTIsMS4yODEsMS4zNzZjNS40OTgsNS41MjQsMTEuMDIsMTEuMDI1LDE2LjUsMTYuNTY2YzEuODY3LDEuODg4LDIuMjU3LDQuMjI5LDEuMjI5LDYuNDI1ICAgIGMtMS4xMjQsMi40LTMuNjQsMy45NzktNi4xMDcsMy44MWMtMS41NjMtMC4xMDgtMi43ODItMC44ODYtMy44NjUtMS45NzdjLTQuMTQ5LTQuMTc1LTguMzc2LTguMjczLTEyLjQ0MS0xMi41MjcgICAgYy0xLjE4My0xLjIzNy0xLjc1Mi0xLjAwMy0yLjc5NiwwLjA3MWMtNC4xNzQsNC4yOTctOC40MTYsOC41MjgtMTIuNjgzLDEyLjczNWMtMS45MTYsMS44ODktNC4xOTYsMi4yMjktNi40MTgsMS4xNSAgICBjLTIuMzYyLTEuMTQ1LTMuODY1LTMuNTU2LTMuNzQ5LTUuOTc5YzAuMDgtMS42MzksMC44ODYtMi44OTEsMi4wMTEtNC4wMTRjNS40NDEtNS40MzMsMTAuODY3LTEwLjg4LDE2LjI5NS0xNi4zMjIgICAgQzQyLjE4Myw2OC4xOTcsNDIuNTE4LDY3LjgxMyw0My4wNDEsNjcuMjU0eiIgZmlsbD0iI0ZGRkZGRiIvPgoJCTxwYXRoIGQ9Ik00Ny41NSw0OC4zMjljLTEzLjIwNS0wLjA0NS0yNC4wMzMtMTAuOTkyLTIzLjk1Ni0yNC4yMThDMjMuNjcsMTAuNzM5LDM0LjUwNS0wLjAzNyw0Ny44NCwwICAgIGMxMy4zNjIsMC4wMzYsMjQuMDg3LDEwLjk2NywyNC4wMiwyNC40NzhDNzEuNzkyLDM3LjY3Nyw2MC44ODksNDguMzc1LDQ3LjU1LDQ4LjMyOXogTTU5LjU1MSwyNC4xNDMgICAgYy0wLjAyMy02LjU2Ny01LjI1My0xMS43OTUtMTEuODA3LTExLjgwMWMtNi42MDktMC4wMDctMTEuODg2LDUuMzE2LTExLjgzNSwxMS45NDNjMC4wNDksNi41NDIsNS4zMjQsMTEuNzMzLDExLjg5NiwxMS43MDkgICAgQzU0LjM1NywzNS45NzEsNTkuNTczLDMwLjcwOSw1OS41NTEsMjQuMTQzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
61
+ </div>
62
+ </a>
63
+ <?php } ?>
64
  </div>
65
  <?php } ?>
66
  <?php do_action('ampforwp_after_social_icons_hook',$this);
templates/design-manager/design-2/footer.php CHANGED
@@ -3,18 +3,24 @@
3
  <footer class="container">
4
  <div id="footer">
5
  <?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
6
- <div class="footer_menu"> <?php
 
 
 
7
  $menu = wp_nav_menu( array(
8
  'theme_location' => 'amp-footer-menu',
 
 
9
  'echo' => false
10
  ) );
11
  echo strip_tags( $menu , '<ul><li><a>'); ?>
12
  </div>
 
13
  <?php } ?>
14
 
15
- <p>
16
  <a href="#header">
17
- <?php echo ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top'); ?> </a> <?php
18
  if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') { ?> | <?php ampforwp_view_nonamp();
19
  } ?>
20
 
3
  <footer class="container">
4
  <div id="footer">
5
  <?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
6
+ <div class="footer_menu">
7
+ <?php // schema.org/SiteNavigationElement missing from menus #1229 ?>
8
+ <nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
9
+ <?php
10
  $menu = wp_nav_menu( array(
11
  'theme_location' => 'amp-footer-menu',
12
+ 'link_before' => '<span itemprop="name">',
13
+ 'link_after' => '</span>',
14
  'echo' => false
15
  ) );
16
  echo strip_tags( $menu , '<ul><li><a>'); ?>
17
  </div>
18
+ </nav>
19
  <?php } ?>
20
 
21
+ <p> <?php if($redux_builder_amp['ampforwp-footer-top']=='1') { ?>
22
  <a href="#header">
23
+ <?php echo ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top'); ?> </a> <?php }
24
  if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') { ?> | <?php ampforwp_view_nonamp();
25
  } ?>
26
 
templates/design-manager/design-2/header-bar.php CHANGED
@@ -68,11 +68,23 @@
68
  layout="nodisplay"
69
  side="right">
70
  <div class="toggle-navigationv2">
71
- <div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div> <?php
72
- $menu = wp_nav_menu( array(
 
 
 
73
  'theme_location' => 'amp-menu' ,
74
- 'echo' => false) );
75
- echo strip_tags( $menu , '<ul><li><a>'); ?>
 
 
 
 
 
 
 
 
 
76
 
77
  </div>
78
  </amp-sidebar>
68
  layout="nodisplay"
69
  side="right">
70
  <div class="toggle-navigationv2">
71
+ <div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div>
72
+ <?php // schema.org/SiteNavigationElement missing from menus #1229 ?>
73
+ <nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
74
+ <?php
75
+ $menu_html_content = wp_nav_menu( array(
76
  'theme_location' => 'amp-menu' ,
77
+ 'link_before' => '<span itemprop="name">',
78
+ 'link_after' => '</span>',
79
+ 'echo' => false,
80
+ 'menu_class' => 'menu amp-menu'
81
+ ) );
82
+ $sanitizer_obj = new AMPFORWP_Content( $menu_html_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array() ) ) );
83
+ $sanitized_comment_content = $sanitizer_obj->get_amp_content();
84
+ echo make_clickable( $sanitized_comment_content );
85
+
86
+ ?>
87
+ </nav>
88
 
89
  </div>
90
  </amp-sidebar>
templates/design-manager/design-2/index.php CHANGED
@@ -52,31 +52,25 @@
52
  $ampforwp_amp_post_url = user_trailingslashit( trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ) ; ?>
53
 
54
  <div class="amp-wp-content amp-loop-list">
55
- <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) {
56
- if ( has_post_thumbnail()) {
57
- $thumb_id = get_post_thumbnail_id();
58
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
59
- $thumb_url = $thumb_url_array[0];
60
- }
61
- else{
62
- $thumb_url = ampforwp_cf_featured_image_src();
63
- }
64
- ?>
65
- <div class="home-post_image">
66
- <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
67
- <amp-img src=<?php echo $thumb_url ?>
68
- <?php ampforwp_thumbnail_alt(); ?>
69
- <?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
70
- width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
71
- height=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-height'] ?>
72
- <?php } else { ?>
73
- width=100
74
- height=75
75
- <?php } ?>
76
- ></amp-img>
77
- </a>
78
- </div>
79
- <?php } ?>
80
 
81
  <div class="amp-wp-post-content">
82
 
52
  $ampforwp_amp_post_url = user_trailingslashit( trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ) ; ?>
53
 
54
  <div class="amp-wp-content amp-loop-list">
55
+ <?php if ( ampforwp_has_post_thumbnail() ) {
56
+ $thumb_url = ampforwp_get_post_thumbnail();
57
+ if($thumb_url){ ?>
58
+ <div class="home-post_image">
59
+ <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
60
+ <amp-img src=<?php echo esc_url($thumb_url); ?>
61
+ <?php ampforwp_thumbnail_alt(); ?>
62
+ <?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
63
+ width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
64
+ height=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-height'] ?>
65
+ <?php } else { ?>
66
+ width=100
67
+ height=75
68
+ <?php } ?>
69
+ ></amp-img>
70
+ </a>
71
+ </div>
72
+ <?php }
73
+ } ?>
 
 
 
 
 
 
74
 
75
  <div class="amp-wp-post-content">
76
 
templates/design-manager/design-2/search.php CHANGED
@@ -51,18 +51,12 @@
51
  <?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
52
  $ampforwp_amp_post_url = trailingslashit( trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ); ?>
53
  <div class="amp-wp-content amp-loop-list">
54
- <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) {
55
- if ( has_post_thumbnail()) {
56
- $thumb_id = get_post_thumbnail_id();
57
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
58
- $thumb_url = $thumb_url_array[0];
59
- }
60
- else{
61
- $thumb_url = ampforwp_cf_featured_image_src();
62
- }
63
- ?>
64
- <div class="home-post_image"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><amp-img src=<?php echo $thumb_url ?> width=100 height=75></amp-img></a></div>
65
- <?php } ?>
66
  <div class="amp-wp-post-content">
67
  <h2 class="amp-wp-title"> <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"> <?php the_title(); ?></a></h2>
68
 
51
  <?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
52
  $ampforwp_amp_post_url = trailingslashit( trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ); ?>
53
  <div class="amp-wp-content amp-loop-list">
54
+ <?php if ( ampforwp_has_post_thumbnail() ) {
55
+ $thumb_url = ampforwp_get_post_thumbnail();
56
+ if($thumb_url){ ?>
57
+ <div class="home-post_image"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><amp-img src=<?php echo esc_url($thumb_url); ?> width=100 height=75></amp-img></a></div>
58
+ <?php }
59
+ } ?>
 
 
 
 
 
 
60
  <div class="amp-wp-post-content">
61
  <h2 class="amp-wp-title"> <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"> <?php the_title(); ?></a></h2>
62
 
templates/design-manager/design-2/style.php CHANGED
@@ -28,6 +28,7 @@ body{ background: #f1f1f1; font: 16px/1.4 Sans-serif; }
28
  a { color: #312C7E; text-decoration: none }
29
  .clearfix, .cb { clear: both }
30
  amp-iframe{ max-width: 100%; margin-bottom : 20px; }
 
31
  .alignleft{ margin-right: 12px; margin-bottom:5px; float: left; }
32
  .alignright{ float:right; margin-left: 12px; margin-bottom:5px; }
33
  .aligncenter{ text-align:center; margin: 0 auto }
@@ -66,7 +67,7 @@ amp-sidebar{ width: 250px; }
66
  .amp-category-block-btn{ display: block; text-align: center; font-size: 13px; margin-top: 15px; border-bottom: 1px solid #f1f1f1; text-decoration: none; padding-bottom: 8px;}
67
  .category-widget-gutter h4{ margin-bottom: 0px;}
68
  .category-widget-gutter ul{ margin-top: 10px; list-style-type:none; padding:0 }
69
- .amp-category-post{ width: 32%; display:inline-table; }
70
  .amp-category-post amp-img{ margin-bottom:5px; }
71
  .amp-category-block li:nth-child(3){ margin: 0 1%;}
72
  .searchmenu{ margin-right: 15px; margin-top: 11px; position: absolute; top: 0; right: 0; }
@@ -92,6 +93,8 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
92
  #pagination .next{ float: right; margin-bottom: 10px; }
93
  #pagination .prev{ float: left }
94
  #pagination .next a, #pagination .prev a{ 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: 11px 15px; font-size: 12px; color: #666; }
 
 
95
  /* Sticky Social bar in Single */
96
  .ampforwp-social-icons-wrapper{ margin: 0.65em 0px 0.65em 0px; height: 28px; }
97
  .sticky_social{ width: 100%; bottom: 0; display: block; left: 0; box-shadow: 0px 4px 7px #000; background: #fff; padding: 7px 0px 0px 0px; position: fixed; margin: 0; z-index: 10; text-align: center; }
@@ -99,6 +102,8 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
99
  .custom-amp-socialsharing-icon amp-img{ top: 4px; }
100
  .custom-amp-socialsharing-line{background:#00b900}
101
  .ampforwp-social-icons custom-amp-socialsharing-vk{background:#45668e}
 
 
102
  /* Header */
103
  #header{ background: #fff; text-align: center; }
104
  #header h3{ text-align: center; font-size: 20px; font-weight: bold; line-height: 1; padding: 15px; margin: 0; }
@@ -134,6 +139,7 @@ main .amp-archive-heading{ background : none; box-shadow: none; padding: 5px; }
134
  .footer_menu ul li:first-child{ margin-left:0 }
135
  .footer_menu ul li:last-child{ margin-right:0 }
136
  .footer_menu ul ul{ display:none }
 
137
  /* Single */
138
  .comment-button-wrapper{ margin-bottom: 0px; margin-top: 60px; text-align:center }
139
  .comment-button-wrapper a{ color: #fff; background: #312c7e; font-size: 13px; padding: 10px 20px 10px 20px; box-shadow: 0 0px 3px rgba(0,0,0,.04); border-radius: 80px; }
@@ -166,10 +172,11 @@ main .amp-wp-content.featured-image-content{ padding: 0px; border: 0; margin-bot
166
  .amp-wp-article-featured-image.wp-caption .wp-caption-text, .ampforwp-gallery-item .wp-caption-text{color: #696969; font-size: 11px; line-height: 15px; background: #eee; margin: 0; padding: .66em .75em; text-align: center;}
167
  .ampforwp-gallery-item.amp-carousel-slide { padding-bottom: 20px;}
168
  .amp-wp-content.post-pagination-meta{ max-width: 1030px; }
169
- .single-post .ampforwp-social-icons.ampforwp-social-icons-wrapper{ display: block; margin: 2em auto 0.9em auto ; max-width: 1030px; }
170
  .amp-wp-article-header.amp-wp-article-category.ampforwp-meta-taxonomy{ margin: 10px auto; max-width: 1030px; } .ampforwp_single_excerpt { margin-bottom:15px; font-size: 15px;}
171
  .single-post .amp_author_area amp-img{ margin: 0; float: left; margin-right: 12px; border-radius: 60px; }
172
- .single-post .amp_author_area .amp_author_area_wrapper{ display: inline-block; width: 100%; line-height: 1.4; margin-top: 22px; font-size: 13px; color:#333; font-family: sans-serif; }
 
173
  /* Related Posts */
174
  main .amp-wp-content.relatedpost{ background: none; box-shadow: none; max-width: 1030px; padding:0px 0 0 0; margin:1.8em auto 1.5em auto }
175
  .related_posts .related-title, .comments_list h3{ font-size: 14px; font-weight: bold; letter-spacing: 0.4px; margin: 15px 0 10px 0; color: #333; }
@@ -184,6 +191,8 @@ main .amp-wp-content.relatedpost{ background: none; box-shadow: none; max-width:
184
  .related_posts ol li p{ font-size: 12px; color: #999; line-height: 1.2; margin: 12px 0 0 0; }
185
  .no_related_thumbnail{ padding: 15px 18px; }
186
  .no_related_thumbnail .related_link{ margin: 16px 18px 20px 19px; }
 
 
187
  /* Comments */
188
  .page-numbers{padding: 9px 10px;background: #fff;font-size: 14px}
189
  .ampforwp-comment-wrapper{margin:1.8em 0px 1.5em 0px}
@@ -196,21 +205,25 @@ main .amp-wp-content.comments_list {background: none;box-shadow: none;max-width:
196
  .comments_list ul li .comment-body{ padding: 25px;width: 91%;}
197
  .comments_list ul li .comment-body .comment-author{ margin-right:5px}
198
  .comment-author{ float:left }
199
- .single-post footer.comment-meta{ padding-bottom: 0;}
 
200
  .comments_list li li{ margin: 20px 20px 10px 20px;background: #f7f7f7;box-shadow: none;border: 1px solid #eee;}
201
  .comments_list li li li{ margin:20px 20px 10px 20px}
202
  .comment-content amp-img{max-width: 300px;}
 
203
  .amp-facebook-comments{margin-top:45px}
204
  /* ADS */
205
  .amp_home_body .amp_ad_1{ margin-top: 10px; margin-bottom: -20px; }
206
  .single-post .amp_ad_1{ margin-top: 10px; margin-bottom: -20px; }
207
  html .single-post .ampforwp-incontent-ad-1 { margin-bottom: 10px; }
208
  .amp-ad-4{ margin-top:10px; }
 
209
  /* Notifications */
210
  #amp-user-notification1 p { display: inline-block; }
211
  amp-user-notification { padding: 5px; text-align: center; background: #fff; border-top: 1px solid; }
212
  amp-user-notification button { padding: 8px 10px; background: #000; color: #fff; margin-left: 5px; border: 0; }
213
  amp-user-notification button:hover { cursor: pointer }
 
214
  .amp-wp-content blockquote { background-color: #fff; border-left: 3px solid; margin: 0; padding: 15px 20px 8px 24px; background: #f3f3f3; }
215
  pre { white-space: pre-wrap; }
216
  /* Tables */
@@ -233,6 +246,7 @@ table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit
233
  table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
234
  table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
235
  .hide-meta-info{ display: none; }
 
236
  /* Responsive */
237
  @media screen and (min-width: 650px) { table {display: inline-table;} }
238
  @media screen and (max-width: 800px) { .single-post main{ padding: 12px 10px 10px 10px } }
@@ -242,7 +256,7 @@ table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, le
242
  .related_posts .related_link { margin: 17px 18px 17px 19px; }
243
  .comments_list ul li .comment-body{ width:auto }
244
  }
245
- @media screen and (max-width: 425px) { .related_posts .related_link p{ display:none } .alignright, .alignleft {float: none;} .related_posts .related_link { margin: 13px 18px 14px 19px; } .related_posts .related_link a{ font-size: 18px; line-height: 1.7; } .amp-meta-wrapper{ display: inline-block; margin-bottom: 0px; margin-top: 8px; width:100% } .ampforwp-tax-category{ padding-bottom:0 } h1.amp-wp-title{ margin: 16px 0px 13px 0px; } .amp-wp-byline{ padding:0 } .amp-meta-wrapper .amp-wp-meta-date{ display:none } .related_posts .related_link a { font-size: 17px; line-height: 1.5; } }
246
  @media screen and (max-width: 375px) { #pagination .next a, #pagination .prev a{ padding: 10px 6px; font-size: 11px; color: #666; } .related_posts .related-title, .comments_list h3{ margin-top:15px; } #pagination .next{ margin-bottom:15px;} .related_posts .related_link a { font-size: 15px; line-height: 1.6; } }
247
  @media screen and (max-width: 340px) { .related_posts .related_link a { font-size: 15px; } .single-post main{ padding: 10px 5px 10px 5px } .the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; } .amp-category-post {line-height: 1.45;font-size: 12px; } .amp-category-block li:nth-child(3) {margin:0%} }
248
  @media screen and (max-width: 320px) { .related_posts .related_link a { font-size: 13px; } h1.amp-wp-title{ font-size:17px; padding:0px 4px } }
@@ -266,6 +280,7 @@ main .amp-archive-heading { direction:rtl }
266
  .toggle-navigationv2 ul li a { padding: 15px 8px; width: 95%;}
267
  <?php } ?>
268
  .amp-wp-tax-tag a, a, .amp-wp-author, .headerlogo a, [class*=icono-] { color: <?php echo sanitize_hex_color( $header_background_color ); ?>;; }
 
269
  .amp-wp-content blockquote{ border-color:<?php echo sanitize_hex_color( $header_background_color ); ?>;; }
270
  .nav_container, .comment-button-wrapper a { background: <?php echo sanitize_hex_color( $header_background_color ); ?>;; }
271
  .nav_container a{ color:<?php echo sanitize_hex_color( $header_color ); ?> }
@@ -301,6 +316,7 @@ amp-user-notification button { background-color: <?php echo sanitize_hex_color(
301
  @media (min-width: 320px) and (max-width: 767px) {.tablepress { display: inline-block; overflow-x: scroll; } }
302
  <?php } ?>
303
  .design_2_wrapper .amp-loop-list .amp-wp-meta {display: none;}
 
304
  .breadcrumb{line-height: 1;margin-bottom:6px;}
305
  .breadcrumb ul, .category-single ul{padding:0; margin:0;}
306
  .breadcrumb ul li{display:inline;}
@@ -308,4 +324,6 @@ amp-user-notification button { background-color: <?php echo sanitize_hex_color(
308
  .breadcrumb ul li a::after {content: "►";display: inline-block;font-size: 8px;padding: 0 6px 0 7px;vertical-align: middle;opacity: 0.5;position:relative;top: -0.5px;}
309
  .breadcrumb ul li:hover a::after{color:#c3c3c3;}
310
  .breadcrumb ul li:last-child a::after{display:none;}
 
 
311
  <?php echo $redux_builder_amp['css_editor']; } ?>
28
  a { color: #312C7E; text-decoration: none }
29
  .clearfix, .cb { clear: both }
30
  amp-iframe{ max-width: 100%; margin-bottom : 20px; }
31
+ amp-anim { max-width: 100%; }
32
  .alignleft{ margin-right: 12px; margin-bottom:5px; float: left; }
33
  .alignright{ float:right; margin-left: 12px; margin-bottom:5px; }
34
  .aligncenter{ text-align:center; margin: 0 auto }
67
  .amp-category-block-btn{ display: block; text-align: center; font-size: 13px; margin-top: 15px; border-bottom: 1px solid #f1f1f1; text-decoration: none; padding-bottom: 8px;}
68
  .category-widget-gutter h4{ margin-bottom: 0px;}
69
  .category-widget-gutter ul{ margin-top: 10px; list-style-type:none; padding:0 }
70
+ .amp-category-post{ width: 32%;display: inline-block; word-wrap: break-word;float: left;}
71
  .amp-category-post amp-img{ margin-bottom:5px; }
72
  .amp-category-block li:nth-child(3){ margin: 0 1%;}
73
  .searchmenu{ margin-right: 15px; margin-top: 11px; position: absolute; top: 0; right: 0; }
93
  #pagination .next{ float: right; margin-bottom: 10px; }
94
  #pagination .prev{ float: left }
95
  #pagination .next a, #pagination .prev a{ 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: 11px 15px; font-size: 12px; color: #666; }
96
+ <?php
97
+ if(is_single()){?>
98
  /* Sticky Social bar in Single */
99
  .ampforwp-social-icons-wrapper{ margin: 0.65em 0px 0.65em 0px; height: 28px; }
100
  .sticky_social{ width: 100%; bottom: 0; display: block; left: 0; box-shadow: 0px 4px 7px #000; background: #fff; padding: 7px 0px 0px 0px; position: fixed; margin: 0; z-index: 10; text-align: center; }
102
  .custom-amp-socialsharing-icon amp-img{ top: 4px; }
103
  .custom-amp-socialsharing-line{background:#00b900}
104
  .ampforwp-social-icons custom-amp-socialsharing-vk{background:#45668e}
105
+ .custom-amp-social-sharing-odnoklassniki{background:#ed812b}
106
+ <?php }?>
107
  /* Header */
108
  #header{ background: #fff; text-align: center; }
109
  #header h3{ text-align: center; font-size: 20px; font-weight: bold; line-height: 1; padding: 15px; margin: 0; }
139
  .footer_menu ul li:first-child{ margin-left:0 }
140
  .footer_menu ul li:last-child{ margin-right:0 }
141
  .footer_menu ul ul{ display:none }
142
+ <?php if(is_singular() || is_home() && $redux_builder_amp['amp-frontpage-select-option'] && ampforwp_get_blog_details() == false ){ ?>
143
  /* Single */
144
  .comment-button-wrapper{ margin-bottom: 0px; margin-top: 60px; text-align:center }
145
  .comment-button-wrapper a{ color: #fff; background: #312c7e; font-size: 13px; padding: 10px 20px 10px 20px; box-shadow: 0 0px 3px rgba(0,0,0,.04); border-radius: 80px; }
172
  .amp-wp-article-featured-image.wp-caption .wp-caption-text, .ampforwp-gallery-item .wp-caption-text{color: #696969; font-size: 11px; line-height: 15px; background: #eee; margin: 0; padding: .66em .75em; text-align: center;}
173
  .ampforwp-gallery-item.amp-carousel-slide { padding-bottom: 20px;}
174
  .amp-wp-content.post-pagination-meta{ max-width: 1030px; }
175
+ .single-post .ampforwp-social-icons.ampforwp-social-icons-wrapper{ display: block; margin: 0.9em auto 0.9em auto ; max-width: 1030px; }
176
  .amp-wp-article-header.amp-wp-article-category.ampforwp-meta-taxonomy{ margin: 10px auto; max-width: 1030px; } .ampforwp_single_excerpt { margin-bottom:15px; font-size: 15px;}
177
  .single-post .amp_author_area amp-img{ margin: 0; float: left; margin-right: 12px; border-radius: 60px; }
178
+ .single-post .amp_author_area .amp_author_area_wrapper{ display: inline-block; width: 100%; line-height: 1.4; margin-top: 2px; font-size: 13px; color:#333; font-family: sans-serif; }
179
+ <?php if(is_single()){?>
180
  /* Related Posts */
181
  main .amp-wp-content.relatedpost{ background: none; box-shadow: none; max-width: 1030px; padding:0px 0 0 0; margin:1.8em auto 1.5em auto }
182
  .related_posts .related-title, .comments_list h3{ font-size: 14px; font-weight: bold; letter-spacing: 0.4px; margin: 15px 0 10px 0; color: #333; }
191
  .related_posts ol li p{ font-size: 12px; color: #999; line-height: 1.2; margin: 12px 0 0 0; }
192
  .no_related_thumbnail{ padding: 15px 18px; }
193
  .no_related_thumbnail .related_link{ margin: 16px 18px 20px 19px; }
194
+ <?php }
195
+ if($redux_builder_amp['wordpress-comments-support'] ==1) { ?>
196
  /* Comments */
197
  .page-numbers{padding: 9px 10px;background: #fff;font-size: 14px}
198
  .ampforwp-comment-wrapper{margin:1.8em 0px 1.5em 0px}
205
  .comments_list ul li .comment-body{ padding: 25px;width: 91%;}
206
  .comments_list ul li .comment-body .comment-author{ margin-right:5px}
207
  .comment-author{ float:left }
208
+ .comment-author-img{float: left; margin-right: 5px; border-radius: 60px;}
209
+ .single-post footer.comment-meta{ padding-bottom: 0; line-height: 1.7;}
210
  .comments_list li li{ margin: 20px 20px 10px 20px;background: #f7f7f7;box-shadow: none;border: 1px solid #eee;}
211
  .comments_list li li li{ margin:20px 20px 10px 20px}
212
  .comment-content amp-img{max-width: 300px;}
213
+ <?php } ?>
214
  .amp-facebook-comments{margin-top:45px}
215
  /* ADS */
216
  .amp_home_body .amp_ad_1{ margin-top: 10px; margin-bottom: -20px; }
217
  .single-post .amp_ad_1{ margin-top: 10px; margin-bottom: -20px; }
218
  html .single-post .ampforwp-incontent-ad-1 { margin-bottom: 10px; }
219
  .amp-ad-4{ margin-top:10px; }
220
+ <?php if($redux_builder_amp['amp-enable-notifications']==1){ ?>
221
  /* Notifications */
222
  #amp-user-notification1 p { display: inline-block; }
223
  amp-user-notification { padding: 5px; text-align: center; background: #fff; border-top: 1px solid; }
224
  amp-user-notification button { padding: 8px 10px; background: #000; color: #fff; margin-left: 5px; border: 0; }
225
  amp-user-notification button:hover { cursor: pointer }
226
+ <?php } ?>
227
  .amp-wp-content blockquote { background-color: #fff; border-left: 3px solid; margin: 0; padding: 15px 20px 8px 24px; background: #f3f3f3; }
228
  pre { white-space: pre-wrap; }
229
  /* Tables */
246
  table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
247
  table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
248
  .hide-meta-info{ display: none; }
249
+ <?php }?>
250
  /* Responsive */
251
  @media screen and (min-width: 650px) { table {display: inline-table;} }
252
  @media screen and (max-width: 800px) { .single-post main{ padding: 12px 10px 10px 10px } }
256
  .related_posts .related_link { margin: 17px 18px 17px 19px; }
257
  .comments_list ul li .comment-body{ width:auto }
258
  }
259
+ @media screen and (max-width: 425px) { .related_posts .related_link p{ display:none } .alignright, .alignleft {float: none;} .related_posts .related_link { margin: 13px 18px 14px 19px; } .related_posts .related_link a{ font-size: 18px; line-height: 1.7; } .amp-meta-wrapper{ display: inline-block; margin-bottom: 0px; margin-top: 8px; width:100% } .ampforwp-tax-category{ padding-bottom:0 } h1.amp-wp-title{ margin: 16px 0px 13px 0px; } .amp-wp-byline{ padding:0 } .related_posts .related_link a { font-size: 17px; line-height: 1.5; } }
260
  @media screen and (max-width: 375px) { #pagination .next a, #pagination .prev a{ padding: 10px 6px; font-size: 11px; color: #666; } .related_posts .related-title, .comments_list h3{ margin-top:15px; } #pagination .next{ margin-bottom:15px;} .related_posts .related_link a { font-size: 15px; line-height: 1.6; } }
261
  @media screen and (max-width: 340px) { .related_posts .related_link a { font-size: 15px; } .single-post main{ padding: 10px 5px 10px 5px } .the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; } .amp-category-post {line-height: 1.45;font-size: 12px; } .amp-category-block li:nth-child(3) {margin:0%} }
262
  @media screen and (max-width: 320px) { .related_posts .related_link a { font-size: 13px; } h1.amp-wp-title{ font-size:17px; padding:0px 4px } }
280
  .toggle-navigationv2 ul li a { padding: 15px 8px; width: 95%;}
281
  <?php } ?>
282
  .amp-wp-tax-tag a, a, .amp-wp-author, .headerlogo a, [class*=icono-] { color: <?php echo sanitize_hex_color( $header_background_color ); ?>;; }
283
+ body a {color: <?php echo $redux_builder_amp['amp-opt-color-rgba-link-design2']['color'];?> }
284
  .amp-wp-content blockquote{ border-color:<?php echo sanitize_hex_color( $header_background_color ); ?>;; }
285
  .nav_container, .comment-button-wrapper a { background: <?php echo sanitize_hex_color( $header_background_color ); ?>;; }
286
  .nav_container a{ color:<?php echo sanitize_hex_color( $header_color ); ?> }
316
  @media (min-width: 320px) and (max-width: 767px) {.tablepress { display: inline-block; overflow-x: scroll; } }
317
  <?php } ?>
318
  .design_2_wrapper .amp-loop-list .amp-wp-meta {display: none;}
319
+ <?php if(!is_home() && $redux_builder_amp['ampforwp-bread-crumb'] == 1 ) { ?>
320
  .breadcrumb{line-height: 1;margin-bottom:6px;}
321
  .breadcrumb ul, .category-single ul{padding:0; margin:0;}
322
  .breadcrumb ul li{display:inline;}
324
  .breadcrumb ul li a::after {content: "►";display: inline-block;font-size: 8px;padding: 0 6px 0 7px;vertical-align: middle;opacity: 0.5;position:relative;top: -0.5px;}
325
  .breadcrumb ul li:hover a::after{color:#c3c3c3;}
326
  .breadcrumb ul li:last-child a::after{display:none;}
327
+ <?php } ?>
328
+ .amp-menu > li > a > amp-img, .sub-menu > li > a > amp-img { display: inline-block; margin-right: 4px; }
329
  <?php echo $redux_builder_amp['css_editor']; } ?>
templates/design-manager/design-3/archive.php CHANGED
@@ -88,29 +88,24 @@ if ( get_query_var( 'paged' ) ) {
88
  }
89
  }?>
90
 
91
- <div class="amp-wp-content amp-loop-list <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) { } else{?>amp-loop-list-noimg<?php } ?>">
92
- <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) {
93
- if ( has_post_thumbnail()) {
94
- $thumb_id = get_post_thumbnail_id();
95
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
96
- $thumb_url = $thumb_url_array[0];
97
- }
98
- else{
99
- $thumb_url = ampforwp_cf_featured_image_src();
100
- }
101
- ?>
102
- <div class="home-post_image">
103
- <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
104
- <amp-img
105
- layout="responsive"
106
- src=<?php echo $thumb_url ?>
107
- <?php ampforwp_thumbnail_alt(); ?>
108
- width=450
109
- height=270
110
- ></amp-img>
111
- </a>
112
- </div>
113
- <?php } ?>
114
 
115
  <div class="amp-wp-post-content">
116
  <ul class="amp-wp-tags">
@@ -153,9 +148,9 @@ if ( get_query_var( 'paged' ) ) {
153
 
154
 
155
  <div id="pagination">
156
- <div class="next"><?php next_posts_link( ampforwp_translation ($redux_builder_amp['amp-translator-show-more-posts-text'] , 'Show more Posts') ,0 ) ?></div>
157
  <?php if ( $paged > 1 ) { ?>
158
- <div class="prev"><?php previous_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-previous-posts-text'], 'Show previous Posts') ); ?></div>
159
  <?php } ?>
160
  <div class="clearfix"></div>
161
  </div>
88
  }
89
  }?>
90
 
91
+ <div class="amp-wp-content amp-loop-list <?php if ( ! ampforwp_has_post_thumbnail() ) { ?>amp-loop-list-noimg<?php } ?>">
92
+ <?php if ( ampforwp_has_post_thumbnail() ) {
93
+ $thumb_url = ampforwp_get_post_thumbnail();
94
+ if($thumb_url){
95
+ ?>
96
+ <div class="home-post_image">
97
+ <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
98
+ <amp-img
99
+ layout="responsive"
100
+ src=<?php echo esc_url($thumb_url); ?>
101
+ <?php ampforwp_thumbnail_alt(); ?>
102
+ width=450
103
+ height=270
104
+ ></amp-img>
105
+ </a>
106
+ </div>
107
+ <?php }
108
+ }?>
 
 
 
 
 
109
 
110
  <div class="amp-wp-post-content">
111
  <ul class="amp-wp-tags">
148
 
149
 
150
  <div id="pagination">
151
+ <div class="next"><?php next_posts_link( ampforwp_translation ($redux_builder_amp['amp-translator-show-more-posts-text']. ' &raquo;' , 'Show more Posts') ,0 ) ?></div>
152
  <?php if ( $paged > 1 ) { ?>
153
+ <div class="prev"><?php previous_posts_link( '&laquo; '.ampforwp_translation($redux_builder_amp['amp-translator-show-previous-posts-text'], 'Show previous Posts') ); ?></div>
154
  <?php } ?>
155
  <div class="clearfix"></div>
156
  </div>
templates/design-manager/design-3/elements/comments.php CHANGED
@@ -22,18 +22,22 @@ if (!comments_open() || ( isset($redux_builder_amp['wordpress-comments-support']
22
  function ampforwp_custom_translated_comment($comment, $args, $depth){
23
  $GLOBALS['comment'] = $comment;
24
  global $redux_builder_amp;
25
- ?>
 
26
  <li id="li-comment-<?php comment_ID() ?>"
27
  <?php comment_class(); ?> >
28
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
29
  <footer class="comment-meta">
 
 
 
30
  <div class="comment-author vcard">
31
  <?php
32
  printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
33
  </div>
34
  <!-- .comment-author -->
35
  <div class="comment-metadata">
36
- <a href="<?php echo htmlspecialchars( trailingslashit( get_comment_link( $comment->comment_ID ) ) ) ?>">
37
  <?php printf( ampforwp_translation( ('%1$s '. ampforwp_translation($redux_builder_amp['amp-translator-at-text'],'at').' %2$s'), '%1$s at %2$s') , get_comment_date(), get_comment_time())?>
38
  </a>
39
  <?php edit_comment_link( ampforwp_translation( $redux_builder_amp['amp-translator-Edit-text'], 'Edit' ) ) ?>
@@ -46,8 +50,10 @@ if (!comments_open() || ( isset($redux_builder_amp['wordpress-comments-support']
46
  $comment_content = get_comment_text();
47
  // Added <p> tag in comments #873
48
  $comment_content = wpautop( $comment_content );
49
- $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(),
50
- 'AMP_Video_Sanitizer' => array() ) ) );
 
 
51
  $sanitized_comment_content = $sanitizer->get_amp_content();
52
  echo make_clickable( $sanitized_comment_content ); ?>
53
  </div>
22
  function ampforwp_custom_translated_comment($comment, $args, $depth){
23
  $GLOBALS['comment'] = $comment;
24
  global $redux_builder_amp;
25
+ $comment_author_img_url = "";
26
+ $comment_author_img_url = ampforwp_get_comments_gravatar( $comment ); ?>
27
  <li id="li-comment-<?php comment_ID() ?>"
28
  <?php comment_class(); ?> >
29
  <article id="comment-<?php comment_ID(); ?>" class="comment-body">
30
  <footer class="comment-meta">
31
+ <?php if($comment_author_img_url){ ?>
32
+ <amp-img src="<?php echo esc_url($comment_author_img_url); ?>" width="40" height="40" layout="fixed" class="comment-author-img"></amp-img>
33
+ <?php } ?>
34
  <div class="comment-author vcard">
35
  <?php
36
  printf(__('<b class="fn">%s</b> <span class="says">'.ampforwp_translation($redux_builder_amp['amp-translator-says-text'],'says').':</span>'), get_comment_author_link()) ?>
37
  </div>
38
  <!-- .comment-author -->
39
  <div class="comment-metadata">
40
+ <a href="<?php echo htmlspecialchars( untrailingslashit( get_comment_link( $comment->comment_ID ) ) ) ?>">
41
  <?php printf( ampforwp_translation( ('%1$s '. ampforwp_translation($redux_builder_amp['amp-translator-at-text'],'at').' %2$s'), '%1$s at %2$s') , get_comment_date(), get_comment_time())?>
42
  </a>
43
  <?php edit_comment_link( ampforwp_translation( $redux_builder_amp['amp-translator-Edit-text'], 'Edit' ) ) ?>
50
  $comment_content = get_comment_text();
51
  // Added <p> tag in comments #873
52
  $comment_content = wpautop( $comment_content );
53
+ $sanitizer = new AMPFORWP_Content( $comment_content, array(), apply_filters( 'ampforwp_content_sanitizers', array(
54
+ 'AMP_Img_Sanitizer' => array(),
55
+ 'AMP_Video_Sanitizer' => array(),
56
+ 'AMP_Style_Sanitizer' => array() ) ) );
57
  $sanitized_comment_content = $sanitizer->get_amp_content();
58
  echo make_clickable( $sanitized_comment_content ); ?>
59
  </div>
templates/design-manager/design-3/elements/content.php CHANGED
@@ -45,7 +45,7 @@
45
 
46
  <!--Post Next-Previous Links-->
47
  <?php global $redux_builder_amp;
48
- if($redux_builder_amp['enable-single-next-prev']) { ?>
49
  <div class="amp-wp-content post-pagination-meta">
50
  <div id="pagination">
51
  <?php $next_post = get_next_post();
45
 
46
  <!--Post Next-Previous Links-->
47
  <?php global $redux_builder_amp;
48
+ if($redux_builder_amp['enable-single-next-prev'] && !is_page() ) { ?>
49
  <div class="amp-wp-content post-pagination-meta">
50
  <div id="pagination">
51
  <?php $next_post = get_next_post();
templates/design-manager/design-3/elements/featured-image.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php do_action('ampforwp_before_featured_image_hook',$this);
2
  global $redux_builder_amp, $post;
3
  $featured_image = $this->get( 'featured_image' );
 
 
4
  if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || $redux_builder_amp['ampforwp-featured-image-from-content'] == true){
5
  if ( $featured_image ) {
6
  $amp_html = $featured_image['amp_html'];
1
  <?php do_action('ampforwp_before_featured_image_hook',$this);
2
  global $redux_builder_amp, $post;
3
  $featured_image = $this->get( 'featured_image' );
4
+ $amp_html = "";
5
+ $caption = "";
6
  if($featured_image || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) || $redux_builder_amp['ampforwp-featured-image-from-content'] == true){
7
  if ( $featured_image ) {
8
  $amp_html = $featured_image['amp_html'];
templates/design-manager/design-3/elements/meta-info.php CHANGED
@@ -8,13 +8,15 @@
8
  <?php $post_author = $this->get( 'post_author' ); ?>
9
  <?php if ( $post_author ) : ?>
10
  <div class="amp-wp-meta amp-wp-byline">
11
- <?php if ( is_single() ) { ?>
12
- <span class="amp-wp-author author vcard"><?php echo esc_html( $post_author->display_name ); ?></span>
13
- <?php } ?>
14
- <?php if( is_page() && $redux_builder_amp['meta_page'] ) { ?>
15
- <span class="amp-wp-author author vcard"><?php echo esc_html( $post_author->display_name ); ?></span>
16
- <?php } ?>
17
- <?php $ampforwp_categories = get_the_terms( $this->ID, 'category' );
 
 
18
  if ( $ampforwp_categories ) : ?>
19
  <span class="amp-wp-meta amp-wp-tax-category ampforwp-tax-category ">
20
  <?php
@@ -29,7 +31,7 @@
29
  }
30
  ?>
31
  </span>
32
- <?php endif; ?>
33
 
34
  <?php if ( $redux_builder_amp['amp-design-3-date-feature'] ) : ?>
35
  <span class="ampforwp-design3-single-date"><?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-on-text']. ' ', 'On'); the_modified_date( get_option( 'date_format' ) ) ?></span>
8
  <?php $post_author = $this->get( 'post_author' ); ?>
9
  <?php if ( $post_author ) : ?>
10
  <div class="amp-wp-meta amp-wp-byline">
11
+ <?php if ( is_single() ) {
12
+ echo ampforwp_get_author_details( $post_author , 'meta-info' );
13
+ } ?>
14
+ <?php if( is_page() && $redux_builder_amp['meta_page'] ) {
15
+ echo ampforwp_get_author_details( $post_author , 'meta-info' );
16
+ } ?>
17
+ <?php
18
+ if( isset($redux_builder_amp['ampforwp-cats-single']) && $redux_builder_amp['ampforwp-cats-single']) {
19
+ $ampforwp_categories = get_the_terms( $this->ID, 'category' );
20
  if ( $ampforwp_categories ) : ?>
21
  <span class="amp-wp-meta amp-wp-tax-category ampforwp-tax-category ">
22
  <?php
31
  }
32
  ?>
33
  </span>
34
+ <?php endif; } ?>
35
 
36
  <?php if ( $redux_builder_amp['amp-design-3-date-feature'] ) : ?>
37
  <span class="ampforwp-design3-single-date"><?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-on-text']. ' ', 'On'); the_modified_date( get_option( 'date_format' ) ) ?></span>
templates/design-manager/design-3/elements/meta-taxonomy.php CHANGED
@@ -1,5 +1,7 @@
 
 
1
  <div class="amp-wp-content amp-wp-article-tags amp-wp-article-category ampforwp-meta-taxonomy ">
2
- <?php global $redux_builder_amp;
3
  $ampforwp_tags= get_the_terms( $this->ID, 'post_tag' );
4
  if ( $ampforwp_tags && ! is_wp_error( $ampforwp_tags ) ) :?>
5
  <?php do_action('ampforwp_before_meta_taxonomy_hook',$this); ?>
@@ -14,9 +16,9 @@
14
  } ?>
15
  </div>
16
  <?php endif;?>
17
- </div>
18
- <?php
19
 
 
20
  if( array_key_exists( 'amp-author-description' , $redux_builder_amp ) && is_single() ) {
21
  if( $redux_builder_amp['amp-author-description'] ) { ?>
22
  <div class="amp-wp-content amp_author_area ampforwp-meta-taxonomy">
@@ -32,10 +34,10 @@ if( array_key_exists( 'amp-author-description' , $redux_builder_amp ) && is_sing
32
  if ( $author_avatar_url ) { ?>
33
  <amp-img src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
34
  <?php
35
- } ?>
36
- <strong><?php echo esc_html( $post_author->display_name ); ?></strong>: <?php echo $post_author->description ; ?>
37
-
38
- <?php } ?>
39
  </div>
40
  </div> <?php
41
  }
1
+ <?php global $redux_builder_amp;
2
+ if( isset($redux_builder_amp['ampforwp-tags-single']) && $redux_builder_amp['ampforwp-tags-single']) { ?>
3
  <div class="amp-wp-content amp-wp-article-tags amp-wp-article-category ampforwp-meta-taxonomy ">
4
+ <?php
5
  $ampforwp_tags= get_the_terms( $this->ID, 'post_tag' );
6
  if ( $ampforwp_tags && ! is_wp_error( $ampforwp_tags ) ) :?>
7
  <?php do_action('ampforwp_before_meta_taxonomy_hook',$this); ?>
16
  } ?>
17
  </div>
18
  <?php endif;?>
19
+ </div> <?php } ?>
 
20
 
21
+ <?php
22
  if( array_key_exists( 'amp-author-description' , $redux_builder_amp ) && is_single() ) {
23
  if( $redux_builder_amp['amp-author-description'] ) { ?>
24
  <div class="amp-wp-content amp_author_area ampforwp-meta-taxonomy">
34
  if ( $author_avatar_url ) { ?>
35
  <amp-img src="<?php echo $author_avatar_url; ?>" width="70" height="70" layout="fixed"></amp-img>
36
  <?php
37
+ }
38
+ echo ampforwp_get_author_details( $post_author , 'meta-taxonomy' );
39
+ echo $post_author->description ;
40
+ } ?>
41
  </div>
42
  </div> <?php
43
  }
templates/design-manager/design-3/elements/related-posts.php CHANGED
@@ -6,7 +6,11 @@
6
 
7
  // declaring this variable here to prevent debug errors
8
  $args = null;
9
-
 
 
 
 
10
  // Custom Post types
11
  if( $current_post_type = get_post_type( $post )) {
12
  // The query arguments
@@ -15,7 +19,7 @@
15
  $args = array(
16
  'posts_per_page'=> $int_number_of_related_posts,
17
  'order' => 'DESC',
18
- 'orderby' => 'ID',
19
  'post_type' => $current_post_type,
20
  'post__not_in' => array( $post->ID )
21
 
@@ -29,12 +33,13 @@
29
  $category_ids = array();
30
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
31
  $args=array(
32
- 'category__in' => $category_ids,
33
- 'post__not_in' => array($post->ID),
34
- 'posts_per_page'=> $int_number_of_related_posts,
35
- 'ignore_sticky_posts'=>1,
36
- 'has_password' => false ,
37
- 'post_status'=> 'publish'
 
38
  );
39
  }
40
  } //end of block for categories
@@ -42,16 +47,17 @@
42
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
43
  $ampforwp_tags = get_the_tags($post->ID);
44
  if ($ampforwp_tags) {
45
- $tag_ids = array();
46
- foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
47
- $args=array(
48
- 'tag__in' => $tag_ids,
49
- 'post__not_in' => array($post->ID),
50
- 'posts_per_page'=> $int_number_of_related_posts,
51
- 'ignore_sticky_posts'=>1,
52
- 'has_password' => false ,
53
- 'post_status'=> 'publish'
54
- );
 
55
  }
56
  }//end of block for tags
57
  $my_query = new wp_query( $args );
6
 
7
  // declaring this variable here to prevent debug errors
8
  $args = null;
9
+ $orderby = 'ID';
10
+ // Check for the order of related posts
11
+ if( isset( $redux_builder_amp['ampforwp-single-order-of-related-posts'] ) && $redux_builder_amp['ampforwp-single-order-of-related-posts'] ){
12
+ $orderby = 'rand';
13
+ }
14
  // Custom Post types
15
  if( $current_post_type = get_post_type( $post )) {
16
  // The query arguments
19
  $args = array(
20
  'posts_per_page'=> $int_number_of_related_posts,
21
  'order' => 'DESC',
22
+ 'orderby' => $orderby,
23
  'post_type' => $current_post_type,
24
  'post__not_in' => array( $post->ID )
25
 
33
  $category_ids = array();
34
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
35
  $args=array(
36
+ 'category__in' => $category_ids,
37
+ 'post__not_in' => array($post->ID),
38
+ 'posts_per_page' => $int_number_of_related_posts,
39
+ 'ignore_sticky_posts'=> 1,
40
+ 'has_password' => false ,
41
+ 'post_status' => 'publish',
42
+ 'orderby' => $orderby,
43
  );
44
  }
45
  } //end of block for categories
47
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
48
  $ampforwp_tags = get_the_tags($post->ID);
49
  if ($ampforwp_tags) {
50
+ $tag_ids = array();
51
+ foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
52
+ $args=array(
53
+ 'tag__in' => $tag_ids,
54
+ 'post__not_in' => array($post->ID),
55
+ 'posts_per_page' => $int_number_of_related_posts,
56
+ 'ignore_sticky_posts'=> 1,
57
+ 'has_password' => false ,
58
+ 'post_status' => 'publish',
59
+ 'orderby' => $orderby,
60
+ );
61
  }
62
  }//end of block for tags
63
  $my_query = new wp_query( $args );
templates/design-manager/design-3/elements/social-icons.php CHANGED
@@ -53,6 +53,13 @@
53
  </div>
54
  </a>
55
  <?php } ?>
 
 
 
 
 
 
 
56
  </div>
57
  <?php } ?>
58
  <?php do_action('ampforwp_after_social_icons_hook',$this);
53
  </div>
54
  </a>
55
  <?php } ?>
56
+ <?php if($redux_builder_amp['enable-single-odnoklassniki-share'] == true) { ?>
57
+ <a href="http://ok.ru/dk?st.cmd=WidgetShare&st.shareUrl=<?php echo get_the_permalink(); ?>" target="_blank">
58
+ <div class="custom-amp-socialsharing-icon-rounded custom-amp-social-sharing-odnoklassniki">
59
+ <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjRweCIgdmlld0JveD0iMCAwIDk1LjQ4MSA5NS40ODEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDk1LjQ4MSA5NS40ODE7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8Zz4KCQk8cGF0aCBkPSJNNDMuMDQxLDY3LjI1NGMtNy40MDItMC43NzItMTQuMDc2LTIuNTk1LTE5Ljc5LTcuMDY0Yy0wLjcwOS0wLjU1Ni0xLjQ0MS0xLjA5Mi0yLjA4OC0xLjcxMyAgICBjLTIuNTAxLTIuNDAyLTIuNzUzLTUuMTUzLTAuNzc0LTcuOTg4YzEuNjkzLTIuNDI2LDQuNTM1LTMuMDc1LDcuNDg5LTEuNjgyYzAuNTcyLDAuMjcsMS4xMTcsMC42MDcsMS42MzksMC45NjkgICAgYzEwLjY0OSw3LjMxNywyNS4yNzgsNy41MTksMzUuOTY3LDAuMzI5YzEuMDU5LTAuODEyLDIuMTkxLTEuNDc0LDMuNTAzLTEuODEyYzIuNTUxLTAuNjU1LDQuOTMsMC4yODIsNi4yOTksMi41MTQgICAgYzEuNTY0LDIuNTQ5LDEuNTQ0LDUuMDM3LTAuMzgzLDcuMDE2Yy0yLjk1NiwzLjAzNC02LjUxMSw1LjIyOS0xMC40NjEsNi43NjFjLTMuNzM1LDEuNDQ4LTcuODI2LDIuMTc3LTExLjg3NSwyLjY2MSAgICBjMC42MTEsMC42NjUsMC44OTksMC45OTIsMS4yODEsMS4zNzZjNS40OTgsNS41MjQsMTEuMDIsMTEuMDI1LDE2LjUsMTYuNTY2YzEuODY3LDEuODg4LDIuMjU3LDQuMjI5LDEuMjI5LDYuNDI1ICAgIGMtMS4xMjQsMi40LTMuNjQsMy45NzktNi4xMDcsMy44MWMtMS41NjMtMC4xMDgtMi43ODItMC44ODYtMy44NjUtMS45NzdjLTQuMTQ5LTQuMTc1LTguMzc2LTguMjczLTEyLjQ0MS0xMi41MjcgICAgYy0xLjE4My0xLjIzNy0xLjc1Mi0xLjAwMy0yLjc5NiwwLjA3MWMtNC4xNzQsNC4yOTctOC40MTYsOC41MjgtMTIuNjgzLDEyLjczNWMtMS45MTYsMS44ODktNC4xOTYsMi4yMjktNi40MTgsMS4xNSAgICBjLTIuMzYyLTEuMTQ1LTMuODY1LTMuNTU2LTMuNzQ5LTUuOTc5YzAuMDgtMS42MzksMC44ODYtMi44OTEsMi4wMTEtNC4wMTRjNS40NDEtNS40MzMsMTAuODY3LTEwLjg4LDE2LjI5NS0xNi4zMjIgICAgQzQyLjE4Myw2OC4xOTcsNDIuNTE4LDY3LjgxMyw0My4wNDEsNjcuMjU0eiIgZmlsbD0iI0ZGRkZGRiIvPgoJCTxwYXRoIGQ9Ik00Ny41NSw0OC4zMjljLTEzLjIwNS0wLjA0NS0yNC4wMzMtMTAuOTkyLTIzLjk1Ni0yNC4yMThDMjMuNjcsMTAuNzM5LDM0LjUwNS0wLjAzNyw0Ny44NCwwICAgIGMxMy4zNjIsMC4wMzYsMjQuMDg3LDEwLjk2NywyNC4wMiwyNC40NzhDNzEuNzkyLDM3LjY3Nyw2MC44ODksNDguMzc1LDQ3LjU1LDQ4LjMyOXogTTU5LjU1MSwyNC4xNDMgICAgYy0wLjAyMy02LjU2Ny01LjI1My0xMS43OTUtMTEuODA3LTExLjgwMWMtNi42MDktMC4wMDctMTEuODg2LDUuMzE2LTExLjgzNSwxMS45NDNjMC4wNDksNi41NDIsNS4zMjQsMTEuNzMzLDExLjg5NiwxMS43MDkgICAgQzU0LjM1NywzNS45NzEsNTkuNTczLDMwLjcwOSw1OS41NTEsMjQuMTQzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="16" height="16" />
60
+ </div>
61
+ </a>
62
+ <?php } ?>
63
  </div>
64
  <?php } ?>
65
  <?php do_action('ampforwp_after_social_icons_hook',$this);
templates/design-manager/design-3/fonts/ptserif/OFL.txt ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2010, ParaType Ltd. (http://www.paratype.com/public),
2
+ with Reserved Font Names "PT Sans", "PT Serif" and "ParaType".
3
+
4
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
+ This license is copied below, and is also available with a FAQ at:
6
+ http://scripts.sil.org/OFL
7
+
8
+
9
+ -----------------------------------------------------------
10
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
+ -----------------------------------------------------------
12
+
13
+ PREAMBLE
14
+ The goals of the Open Font License (OFL) are to stimulate worldwide
15
+ development of collaborative font projects, to support the font creation
16
+ efforts of academic and linguistic communities, and to provide a free and
17
+ open framework in which fonts may be shared and improved in partnership
18
+ with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves. The
22
+ fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply
27
+ to any document created using the fonts or their derivatives.
28
+
29
+ DEFINITIONS
30
+ "Font Software" refers to the set of files released by the Copyright
31
+ Holder(s) under this license and clearly marked as such. This may
32
+ include source files, build scripts and documentation.
33
+
34
+ "Reserved Font Name" refers to any names specified as such after the
35
+ copyright statement(s).
36
+
37
+ "Original Version" refers to the collection of Font Software components as
38
+ distributed by the Copyright Holder(s).
39
+
40
+ "Modified Version" refers to any derivative made by adding to, deleting,
41
+ or substituting -- in part or in whole -- any of the components of the
42
+ Original Version, by changing formats or by porting the Font Software to a
43
+ new environment.
44
+
45
+ "Author" refers to any designer, engineer, programmer, technical
46
+ writer or other person who contributed to the Font Software.
47
+
48
+ PERMISSION & CONDITIONS
49
+ Permission is hereby granted, free of charge, to any person obtaining
50
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
51
+ redistribute, and sell modified and unmodified copies of the Font
52
+ Software, subject to the following conditions:
53
+
54
+ 1) Neither the Font Software nor any of its individual components,
55
+ in Original or Modified Versions, may be sold by itself.
56
+
57
+ 2) Original or Modified Versions of the Font Software may be bundled,
58
+ redistributed and/or sold with any software, provided that each copy
59
+ contains the above copyright notice and this license. These can be
60
+ included either as stand-alone text files, human-readable headers or
61
+ in the appropriate machine-readable metadata fields within text or
62
+ binary files as long as those fields can be easily viewed by the user.
63
+
64
+ 3) No Modified Version of the Font Software may use the Reserved Font
65
+ Name(s) unless explicit written permission is granted by the corresponding
66
+ Copyright Holder. This restriction only applies to the primary font name as
67
+ presented to the users.
68
+
69
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70
+ Software shall not be used to promote, endorse or advertise any
71
+ Modified Version, except to acknowledge the contribution(s) of the
72
+ Copyright Holder(s) and the Author(s) or with their explicit written
73
+ permission.
74
+
75
+ 5) The Font Software, modified or unmodified, in part or in whole,
76
+ must be distributed entirely under this license, and must not be
77
+ distributed under any other license. The requirement for fonts to
78
+ remain under this license does not apply to any document created
79
+ using the Font Software.
80
+
81
+ TERMINATION
82
+ This license becomes null and void if any of the above conditions are
83
+ not met.
84
+
85
+ DISCLAIMER
86
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94
+ OTHER DEALINGS IN THE FONT SOFTWARE.
templates/design-manager/design-3/fonts/ptserif/PT_Serif-Web-Bold.ttf ADDED
Binary file
templates/design-manager/design-3/fonts/ptserif/PT_Serif-Web-Regular.ttf ADDED
Binary file
templates/design-manager/design-3/fonts/robotoslab/LICENSE.txt ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
templates/design-manager/design-3/fonts/robotoslab/RobotoSlab-Bold.ttf ADDED
Binary file
templates/design-manager/design-3/fonts/robotoslab/RobotoSlab-Regular.ttf ADDED
Binary file
templates/design-manager/design-3/footer.php CHANGED
@@ -2,14 +2,21 @@
2
  wp_reset_postdata();?>
3
  <footer class="footer_wrapper container">
4
  <div id="footer">
 
5
  <?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
6
- <div class="footer_menu"> <?php
 
 
 
7
  $menu = wp_nav_menu( array(
8
  'theme_location' => 'amp-footer-menu',
 
 
9
  'echo' => false
10
  ) );
11
  echo strip_tags( $menu , '<ul><li><a>'); ?>
12
  </div>
 
13
  <?php } ?>
14
 
15
  <?php if( ampforwp_checking_any_social_profiles() ) { ?>
@@ -73,10 +80,15 @@
73
 
74
  </ul>
75
  </div>
76
- <?php } ?>
 
 
 
 
 
77
  <p class="rightslink">
78
  <?php
79
- global $allowed_html;
80
  echo wp_kses( ampforwp_translation($redux_builder_amp['amp-translator-footer-text'], 'Footer') ,$allowed_html ) ;
81
  if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') { ?> | <?php ampforwp_view_nonamp(); } ?>
82
  </p>
2
  wp_reset_postdata();?>
3
  <footer class="footer_wrapper container">
4
  <div id="footer">
5
+
6
  <?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
7
+ <?php // schema.org/SiteNavigationElement missing from menus #1229 ?>
8
+ <div class="footer_menu">
9
+ <nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
10
+ <?php
11
  $menu = wp_nav_menu( array(
12
  'theme_location' => 'amp-footer-menu',
13
+ 'link_before' => '<span itemprop="name">',
14
+ 'link_after' => '</span>',
15
  'echo' => false
16
  ) );
17
  echo strip_tags( $menu , '<ul><li><a>'); ?>
18
  </div>
19
+ </nav>
20
  <?php } ?>
21
 
22
  <?php if( ampforwp_checking_any_social_profiles() ) { ?>
80
 
81
  </ul>
82
  </div>
83
+ <?php }
84
+ if( isset( $redux_builder_amp['ampforwp-footer-top-design3'] ) =='1' ){ ?>
85
+ <p class="rightslink back-to-top">
86
+ <a href="#">
87
+ <?php echo ampforwp_translation( $redux_builder_amp['amp-translator-top-text'], 'Top'); ?>
88
+ </a> </p> <?php } ?>
89
  <p class="rightslink">
90
  <?php
91
+ global $allowed_html;
92
  echo wp_kses( ampforwp_translation($redux_builder_amp['amp-translator-footer-text'], 'Footer') ,$allowed_html ) ;
93
  if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') { ?> | <?php ampforwp_view_nonamp(); } ?>
94
  </p>
templates/design-manager/design-3/functions.php CHANGED
@@ -1,14 +1,10 @@
1
  <?php
2
  global $redux_builder_amp;
3
- // Add required Fonts for Design 3
4
  add_filter( 'amp_post_template_data', 'ampforwp_add_design3_required_fonts' );
5
  function ampforwp_add_design3_required_fonts( $data ) {
6
-
7
- $data['font_urls']['roboto_slab_pt_serif'] = 'https://fonts.googleapis.com/css?family=Roboto+Slab:400,700|PT+Serif:400,700';
8
  unset($data['font_urls']['merriweather']);
9
-
10
  return $data;
11
-
12
  }
13
 
14
  // Add required Javascripts for Design 3
1
  <?php
2
  global $redux_builder_amp;
 
3
  add_filter( 'amp_post_template_data', 'ampforwp_add_design3_required_fonts' );
4
  function ampforwp_add_design3_required_fonts( $data ) {
5
+ // $data['font_urls']['roboto_slab_pt_serif'] = 'https://fonts.googleapis.com/css?family=Roboto+Slab:400,700|PT+Serif:400,700';
 
6
  unset($data['font_urls']['merriweather']);
 
7
  return $data;
 
8
  }
9
 
10
  // Add required Javascripts for Design 3
templates/design-manager/design-3/header-bar.php CHANGED
@@ -9,15 +9,27 @@ if(isset($redux_builder_amp['ampforwp-amp-menu']) && $redux_builder_amp['ampforw
9
  <?php
10
  if( has_nav_menu( 'amp-menu' ) ) { ?>
11
  <div class="navigation_heading"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-navigate-text'] , 'Navigate' ); ?></div>
 
 
 
 
 
12
  <?php
13
- // Grand child support AND amp-accordion non critical error in Design 3 due to nav #1152
14
- wp_nav_menu( array(
15
  'theme_location' => 'amp-menu',
 
 
16
  'menu'=>'ul',
17
- 'menu_class'=>'amp-menu'
 
18
  ) );
 
 
 
19
  }
20
  ?>
 
 
21
  <div class="social_icons">
22
  <ul>
23
 
@@ -106,6 +118,10 @@ if(isset($redux_builder_amp['ampforwp-amp-menu']) && $redux_builder_amp['ampforw
106
  } else {
107
  if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
108
  $ampforwp_home_url = user_trailingslashit( trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR );
 
 
 
 
109
  } else {
110
  if( $redux_builder_amp['amp-mobile-redirection'] ) {
111
  $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
@@ -114,7 +130,9 @@ if(isset($redux_builder_amp['ampforwp-amp-menu']) && $redux_builder_amp['ampforw
114
  $ampforwp_home_url = trailingslashit( get_bloginfo('url') );
115
  }
116
  }
117
- }?>
 
 
118
 
119
  <?php if ( isset($redux_builder_amp['opt-media']['url'] ) && true == ($redux_builder_amp['opt-media']['url']) ) {
120
  $logo_id = attachment_url_to_postid($redux_builder_amp['opt-media'] ['url']);
9
  <?php
10
  if( has_nav_menu( 'amp-menu' ) ) { ?>
11
  <div class="navigation_heading"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-navigate-text'] , 'Navigate' ); ?></div>
12
+
13
+ <?php // Grand child support AND amp-accordion non critical error in Design 3 due to nav #1152
14
+ // schema.org/SiteNavigationElement missing from menus #1229 ?>
15
+ <nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
16
+ <nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
17
  <?php
18
+ $menu_html_content = wp_nav_menu( array(
 
19
  'theme_location' => 'amp-menu',
20
+ 'link_before' => '<span itemprop="name">',
21
+ 'link_after' => '</span>',
22
  'menu'=>'ul',
23
+ 'menu_class'=>'amp-menu',
24
+ 'echo'=>false
25
  ) );
26
+ $sanitizer_obj = new AMPFORWP_Content( $menu_html_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array() ) ) );
27
+ $sanitized_comment_content = $sanitizer_obj->get_amp_content();
28
+ echo make_clickable( $sanitized_comment_content );
29
  }
30
  ?>
31
+
32
+ </nav>
33
  <div class="social_icons">
34
  <ul>
35
 
118
  } else {
119
  if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
120
  $ampforwp_home_url = user_trailingslashit( trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR );
121
+ $get_permalink_structure = get_option('permalink_structure');
122
+ if ( empty( $get_permalink_structure ) ) {
123
+ $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?amp=1';
124
+ }
125
  } else {
126
  if( $redux_builder_amp['amp-mobile-redirection'] ) {
127
  $ampforwp_home_url = trailingslashit( get_bloginfo('url') ).'?nonamp=1';
130
  $ampforwp_home_url = trailingslashit( get_bloginfo('url') );
131
  }
132
  }
133
+
134
+ }
135
+ ?>
136
 
137
  <?php if ( isset($redux_builder_amp['opt-media']['url'] ) && true == ($redux_builder_amp['opt-media']['url']) ) {
138
  $logo_id = attachment_url_to_postid($redux_builder_amp['opt-media'] ['url']);
templates/design-manager/design-3/index.php CHANGED
@@ -62,18 +62,13 @@ if ( get_query_var( 'paged' ) ) {
62
  $category_posts->the_post();
63
  ?>
64
  <div>
65
- <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) {
66
- if ( has_post_thumbnail()) {
67
- $thumb_id = get_post_thumbnail_id();
68
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium_large', true);
69
- $thumb_url = $thumb_url_array[0];
70
- }
71
- else{
72
- $thumb_url = ampforwp_cf_featured_image_src();
73
- }
74
- ?>
75
- <amp-img src=<?php echo $thumb_url ?> width=450 height=270></amp-img>
76
- <?php } ?>
77
  <a href="<?php echo user_trailingslashit( trailingslashit( get_the_permalink() ) . AMPFORWP_AMP_QUERY_VAR ); ?>">
78
  <div class="featured_title">
79
  <div class="featured_time"><?php
@@ -115,29 +110,24 @@ if ( get_query_var( 'paged' ) ) {
115
  if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
116
  $ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
117
 
118
- <div class="amp-wp-content amp-loop-list <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) { } else{?>amp-loop-list-noimg<?php } ?>">
119
- <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) {
120
- if ( has_post_thumbnail()) {
121
- $thumb_id = get_post_thumbnail_id();
122
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
123
- $thumb_url = $thumb_url_array[0];
124
- }
125
- else{
126
- $thumb_url = ampforwp_cf_featured_image_src();
127
- }
128
- ?>
129
- <div class="home-post_image">
130
- <a href="<?php echo esc_url( user_trailingslashit( $ampforwp_amp_post_url ) ); ?>">
131
- <amp-img
132
- layout="responsive"
133
- src=<?php echo $thumb_url ?>
134
- <?php ampforwp_thumbnail_alt(); ?>
135
- width=450
136
- height=270
137
- ></amp-img>
138
- </a>
139
- </div>
140
- <?php } ?>
141
 
142
  <div class="amp-wp-post-content">
143
  <ul class="amp-wp-tags">
@@ -182,9 +172,9 @@ if ( get_query_var( 'paged' ) ) {
182
  <div class="amp-wp-content pagination-holder">
183
 
184
  <div id="pagination">
185
- <div class="next"><?php next_posts_link( ampforwp_translation( $redux_builder_amp['amp-translator-show-more-posts-text'] , 'Show more Posts'), 0 ) ?></div>
186
  <?php if ( $paged > 1 ) { ?>
187
- <div class="prev"><?php previous_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-previous-posts-text'], 'Show previous Posts') ); ?></div>
188
  <?php } ?>
189
  <div class="clearfix"></div>
190
  </div>
62
  $category_posts->the_post();
63
  ?>
64
  <div>
65
+ <?php if ( ampforwp_has_post_thumbnail() ) {
66
+ $thumb_url = ampforwp_get_post_thumbnail();
67
+ if($thumb_url){
68
+ ?>
69
+ <amp-img src=<?php echo $thumb_url ?> width=450 height=270></amp-img>
70
+ <?php }
71
+ }?>
 
 
 
 
 
72
  <a href="<?php echo user_trailingslashit( trailingslashit( get_the_permalink() ) . AMPFORWP_AMP_QUERY_VAR ); ?>">
73
  <div class="featured_title">
74
  <div class="featured_time"><?php
110
  if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
111
  $ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
112
 
113
+ <div class="amp-wp-content amp-loop-list <?php if ( ! ampforwp_has_post_thumbnail() ){?>amp-loop-list-noimg<?php } ?>">
114
+ <?php if ( ampforwp_has_post_thumbnail() ) {
115
+ $thumb_url = ampforwp_get_post_thumbnail();
116
+ if($thumb_url){
117
+ ?>
118
+ <div class="home-post_image">
119
+ <a href="<?php echo esc_url( user_trailingslashit( $ampforwp_amp_post_url ) ); ?>">
120
+ <amp-img
121
+ layout="responsive"
122
+ src=<?php echo esc_url( $thumb_url ); ?>
123
+ <?php ampforwp_thumbnail_alt(); ?>
124
+ width=450
125
+ height=270
126
+ ></amp-img>
127
+ </a>
128
+ </div>
129
+ <?php }
130
+ } ?>
 
 
 
 
 
131
 
132
  <div class="amp-wp-post-content">
133
  <ul class="amp-wp-tags">
172
  <div class="amp-wp-content pagination-holder">
173
 
174
  <div id="pagination">
175
+ <div class="next"><?php next_posts_link( ampforwp_translation( $redux_builder_amp['amp-translator-show-more-posts-text']. ' &raquo;' , 'Show more Posts'), 0 ) ?></div>
176
  <?php if ( $paged > 1 ) { ?>
177
+ <div class="prev"><?php previous_posts_link( '&laquo; '.ampforwp_translation($redux_builder_amp['amp-translator-show-previous-posts-text'], 'Show previous Posts') ); ?></div>
178
  <?php } ?>
179
  <div class="clearfix"></div>
180
  </div>
templates/design-manager/design-3/search.php CHANGED
@@ -60,18 +60,13 @@
60
  $ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
61
 
62
  <div class="amp-wp-content amp-loop-list">
63
- <?php if ( has_post_thumbnail() || ( ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src() ) ) {
64
- if ( has_post_thumbnail()) {
65
- $thumb_id = get_post_thumbnail_id();
66
- $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
67
- $thumb_url = $thumb_url_array[0];
68
- }
69
- else{
70
- $thumb_url = ampforwp_cf_featured_image_src();
71
- }
72
  ?>
73
- <div class="home-post_image"><a href="<?php echo esc_url( trailingslashit( $ampforwp_amp_post_url ) ); ?>"><amp-img layout="responsive" src=<?php echo $thumb_url ?> width=450 height=270 ></amp-img></a></div>
74
- <?php } ?>
 
75
 
76
  <div class="amp-wp-post-content">
77
  <ul class="amp-wp-tags">
@@ -113,9 +108,9 @@
113
 
114
 
115
  <div id="pagination">
116
- <div class="next"><?php next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-more-posts-text'] , 'Show more Posts'), 0 ) ?></div>
117
  <?php if ( $paged > 1 ) { ?>
118
- <div class="prev"><?php previous_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-previous-posts-text'], 'Show previous Posts' ) ); ?></div>
119
  <?php } ?>
120
  <div class="clearfix"></div>
121
  </div>
60
  $ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
61
 
62
  <div class="amp-wp-content amp-loop-list">
63
+ <?php if ( ampforwp_has_post_thumbnail() ) {
64
+ $thumb_url = ampforwp_get_post_thumbnail();
65
+ if($thumb_url){
 
 
 
 
 
 
66
  ?>
67
+ <div class="home-post_image"><a href="<?php echo esc_url( trailingslashit( $ampforwp_amp_post_url ) ); ?>"><amp-img layout="responsive" src=<?php echo esc_url($thumb_url); ?> width=450 height=270 ></amp-img></a></div>
68
+ <?php }
69
+ } ?>
70
 
71
  <div class="amp-wp-post-content">
72
  <ul class="amp-wp-tags">
108
 
109
 
110
  <div id="pagination">
111
+ <div class="next"><?php next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-more-posts-text']. ' &raquo;' , 'Show more Posts'), 0 ) ?></div>
112
  <?php if ( $paged > 1 ) { ?>
113
+ <div class="prev"><?php previous_posts_link( '&laquo; '.ampforwp_translation($redux_builder_amp['amp-translator-show-previous-posts-text'], 'Show previous Posts' ) ); ?></div>
114
  <?php } ?>
115
  <div class="clearfix"></div>
116
  </div>
templates/design-manager/design-3/style.php CHANGED
@@ -28,6 +28,32 @@ a{ color: #312C7E; text-decoration: none }
28
  .alignright{ float:right; margin-left: 12px; margin-bottom:5px; }
29
  .aligncenter{ text-align:center; margin: 0 auto }
30
  #statcounter{width: 1px;height:1px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  /* Template Styles */
33
  .amp-wp-content, .amp-wp-title-bar div {
@@ -38,7 +64,6 @@ a{ color: #312C7E; text-decoration: none }
38
  }
39
 
40
  /* Slide Navigation code */
41
-
42
  amp-sidebar{ width: 280px; background: #131313; font-family: 'Roboto Slab', serif; }
43
  .amp-sidebar-image{ line-height: 100px; vertical-align:middle; }
44
  .amp-close-image{ top: 15px; left: 225px; cursor: pointer; }
@@ -57,40 +82,34 @@ amp-sidebar{ width: 280px; background: #131313; font-family: 'Roboto Slab', seri
57
  .toggle-text{ color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: 3px; display: inherit; text-align: center; }
58
  .toggle-text:before{ content: "..."; font-size: 32px; position: ; font-family: georgia; line-height: 0px; margin-left: 0px; letter-spacing: 1px; top: -3px; position: relative; padding-right: 10px; }
59
  .toggle-navigation:hover, .toggle-navigation:active, .toggle-navigation:focus{ display: inline-block; width: 100%; }
60
-
61
  /* Pagination */
62
  .amp-wp-content.pagination-holder{ background: none; padding: 0; box-shadow: none; height: auto; min-height: auto; }
63
  #pagination{ width: 100%; margin-top: 20px; }
64
  #pagination .next, #pagination .prev{ margin: 0px 6% 10px 6%; }
65
  #pagination .next a, #pagination .prev a{ opacity:0.9; background: #f42f42; width: 100%; color: #fff; display: inline-block; text-align: center; font-size: 16px; line-height: 1; padding: 18px 0%; border-radius: 4px; }
 
 
66
  /* Sticky Social bar in Single */
67
-
68
  .sticky_social{ width: 100%; bottom: 0; display: block; left: 0; box-shadow: 0px 4px 7px #000; background: #fff; padding: 7px 0px 0px 0px; position: fixed; margin: 0; z-index: 10; text-align: center; }
69
  .custom-amp-socialsharing-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; }
70
  .custom-amp-socialsharing-icon amp-img{ top: 4px; }
71
  .custom-amp-socialsharing-line{background:#00b900}
72
-
73
  .sticky_social .whatsapp-share-icon{ padding: 4px 0px 14px 0px; height: 28px; top: -4px; position: relative; }
74
  .sticky_social .line-share-icon{ padding: 4px 0px 14px 0px; height: 28px; top: -4px; position: relative; }
75
- /* Header */
76
  /*Sticky Head For Design 3*/
77
-
78
  #header{ background: #fff; text-align: center; height:50px; box-shadow:0 0 32px rgba(0,0,0,.15); }
79
  header{ padding-bottom:50px; }
80
  #headerwrap{ position: fixed; z-index:1000; width: 100%; top:0; }
81
-
82
-
83
  <?php if($sticky_head) { ?>
84
  header{ padding-bottom:0px; }
85
  #headerwrap{ position: relative;}
86
  <?php } ?>
87
-
88
  #header h1{ text-align: center; font-size: 16px; position: relative; font-weight: bold; line-height: 53px; padding: 0; margin: 0; text-transform: uppercase }
89
-
90
  main .amp-wp-content{ font-size: 18px; line-height: 29px; color:#111 }
91
  .single-post main .amp-wp-article-content h1{ font-size:2em}
92
  .single-post main .amp-wp-article-content h1, .single-post main .amp-wp-article-content h2, .single-post main .amp-wp-article-content h3, .single-post main .amp-wp-article-content h4, .single-post main .amp-wp-article-content h5, .single-post main .amp-wp-article-content h6{ font-family: 'Roboto Slab', serif; margin: 0px 0px 5px 0px; line-height: 1.6; }
93
-
94
  .home-post_image{ float: left; width:33%; padding-right: 2%; }
95
  .amp-wp-title{ margin-top: 0px; }
96
  h2.amp-wp-title{ font-family: 'Roboto Slab', serif; font-weight: 700; font-size: 20px; margin-bottom: 7px; line-height: 1.3; }
@@ -102,14 +121,17 @@ body .amp-loop-list-noimg .amp-wp-post-content{ width:100% }
102
  .amp-loop-list .amp-wp-post-content{ float: left; width: 65%; }
103
  .amp-loop-list .featured_time{ color:#b3b3b3; padding-left:0 }
104
  .amp-wp-post-content p{ color: grey; line-height: 1.5; font-size: 14px; margin: 8px 0 10px; font-family:'PT Serif', serif }
 
105
  /* For Excerpt */
106
  .amp-wp-post-content .small-screen-excerpt-design-3 {display: none;} .amp-wp-post-content .large-screen-excerpt-design-3 { display: block; }
 
107
  /* Footer */
108
  #footer{ background: #151515; color: #eee; font-size: 13px; text-align: center; letter-spacing: 0.2px; padding: 35px 0 35px 0; margin-top: 30px; }
109
  #footer a{ color:#fff }
110
  #footer p:first-child{ margin-bottom: 12px; }
111
  #footer .social_icons{ margin: 0px 20px 25px 20px; border-bottom: 1px solid #3c3c3c; padding-bottom: 25px; }
112
  #footer p{ margin: 0 }
 
113
  .rightslink, #footer .rightslink a{ font-size:13px; color:#999 }
114
  .poweredby{ padding-top:10px; font-size:10px; }
115
  #footer .poweredby a{ color:#666 }
@@ -118,6 +140,7 @@ body .amp-loop-list-noimg .amp-wp-post-content{ width:100% }
118
  .footer_menu ul li:first-child{ margin-left:0 }
119
  .footer_menu ul li:last-child{ margin-right:0 }
120
  .footer_menu ul ul{ display:none }
 
121
  /* Single */
122
  .single-post main{ margin: 20px 17px 17px 17px; }
123
  .amp-wp-article-content{ font-family:'PT Serif', serif; }
@@ -140,6 +163,7 @@ h1.amp-wp-title{ margin: 0; color: #333333; font-size: 48px; line-height: 58px;
140
  .custom-amp-socialsharing-icon-rounded{margin-right:6px;padding: 11px 12px 9px 12px; top: -13px; position: relative; line-height: 1; background: #5cbe4a; display: inline-block; height: inherit; border-radius: 60px; }
141
  .custom-amp-socialsharing-line{background:#00b900}
142
  .custom-amp-social-sharing-vk{background:#45668e}
 
143
  .amp-wp-tax-tag { list-style: none; display: inline-block; }
144
  figure{ margin: 0 0 20px 0; }
145
  figure amp-img{ max-width:100%; }
@@ -152,8 +176,8 @@ figcaption{ font-size: 11px; line-height: 1.6; margin-bottom: 11px; background:
152
  .amp-wp-tax-tag{ }
153
  main .amp-wp-content.featured-image-content{ padding: 0px; border: 0; margin-bottom: 0; box-shadow: none }
154
  .amp-wp-content .amp-wp-article-featured-image amp-img {margin: 0 auto;}
155
- .archives_body main{ margin-top:30px }
156
- .single-post .amp-wp-article-content amp-img{ max-width:100% }
157
  /* Related Posts */
158
  main .amp-wp-content.relatedpost{ background: none; box-shadow: none; padding:0px 0 0 0; margin:1.8em auto 1.5em auto }
159
  .single-post main,.related-title,.single-post .comments_list h3{ font-size: 20px; color: #777; font-family:'Roboto Slab', serif; border-bottom: 1px solid #eee; font-weight: 400; padding-bottom: 1px; margin-bottom: 10px; }
@@ -165,6 +189,8 @@ main .amp-wp-content.relatedpost{ background: none; box-shadow: none; padding:0p
165
  .related_posts ol li p{ font-size: 12px; color: #999; line-height: 1.2; margin: 12px 0 0 0; }
166
  .no_related_thumbnail{ padding: 15px 18px; }
167
  .no_related_thumbnail .related_link{ margin: 16px 18px 20px 19px; } .ampforwp_single_excerpt{ margin-bottom: 15px; }
 
 
168
  /* Comments */
169
  .page-numbers{ padding: 9px 10px; background: #fff; font-size: 14px; }
170
  .comment-body .comment-content{ font-family:'PT Serif', serif; margin-top: 2px; }
@@ -177,11 +203,13 @@ main .amp-wp-content.comments_list{ background: none; box-shadow: none; padding:
177
  .comments_list ul ul li{ border-left: 2px solid #eee; padding-left: 15px; border-bottom: 0; padding-bottom: 0px; }
178
  .comments_list ul li .comment-body .comment-author{ margin-right:5px }
179
  .comment-author{ float:left }
180
- .single-post footer.comment-meta{ color:#666; padding-bottom: 0; }
 
181
  .comment-metadata a{ color:#888 }
182
  .comments_list li li{ margin: 20px 20px 10px 20px; background: #f7f7f7; box-shadow: none; border: 1px solid #eee; }
183
  .comments_list li li li{ margin:20px 20px 10px 20px }
184
  .comment-content amp-img{max-width: 300px;}
 
185
  /* ADS */
186
  .amp_ad_1{ margin-top: 15px; margin-bottom: 10px; }
187
  .single-post .amp_ad_1{ margin-bottom: -15px; }
@@ -189,11 +217,13 @@ main .amp-wp-content.comments_list{ background: none; box-shadow: none; padding:
189
  html .single-post .ampforwp-incontent-ad-1 { margin-bottom: 10px; }
190
  .amp-ad-3{ margin-bottom:10px; }
191
  .amp-ad-4{ margin-top:2px; }
 
192
  /* Notifications */
193
  #amp-user-notification1 p{ display: inline-block; }
194
  amp-user-notification{ padding: 5px; text-align: center; background: #fff; border-top: 1px solid; }
195
  amp-user-notification button{ padding: 8px 10px; background: #000; color: #fff; margin-left: 5px; border: 0; }
196
  amp-user-notification button:hover{ cursor: pointer }
 
197
  .amp-wp-content blockquote{ background-color: #fff; border-left: 3px solid; margin: 0; padding: 15px 20px; background: #f3f3f3; }
198
  .amp-wp-content blockquote p{ margin-bottom:0 }
199
  pre{ white-space: pre-wrap; }
@@ -203,13 +233,14 @@ pre{ white-space: pre-wrap; }
203
  -webkit-transform-origin: right center;
204
  transform-origin: right center;*/
205
  }
 
206
  /* Sidebar */
207
  #sidebar[aria-hidden="false"]+#designthree { max-height: 100vh; overflow: hidden; animation: opening .3s normal forwards ease-in-out; -webkit-transform: translate3d(60%, 0, 0) scale(0.8); transform: translate3d(60%, 0, 0) scale(0.8); }
208
  @keyframes opening{ 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(60%, 0, 0) scale(0.8); } }
209
  @keyframes closing{ 0% { transform: translate3d(60%, 0, 0) scale(0.8); } 100% { transform: translate3d(0, 0, 0) scale(1); } }
210
  @keyframes closingFix{ 0% { max-height: 100vh; overflow: hidden; } 100% { max-height: none; overflow: visible; } }
211
-
212
  .hamburgermenu{ float:left; position:relative; z-index: 9999; }
 
213
  /* Category 3 */
214
  .amp-category-block{ margin: 30px 0px 10px 0px }
215
  .amp-category-block a{ color:#666}
@@ -219,7 +250,7 @@ pre{ white-space: pre-wrap; }
219
  .amp-category-block-btn{ display: block; text-align: center; font-size: 13px; margin-top: 15px; border-bottom: 1px solid #f1f1f1; text-decoration: none; padding-bottom: 8px;}
220
  .design_2_wrapper .amp-category-block{ max-width: 840px; margin: 1.5em auto; }
221
  .amp-category-block ul, .category-widget-wrapper{ max-width: 1000px; margin: 0 auto; padding:0px 15px 5px 15px }
222
- .amp-category-post{ width: 32%; display:inline-table; }
223
  .amp-category-post amp-img{ margin-bottom:5px; }
224
  .amp-category-block li:nth-child(3){ margin: 0 1%; }
225
  .searchmenu{ margin-right: 15px; margin-top: 11px; position: absolute; top: 0; right: 0; }
@@ -227,6 +258,7 @@ pre{ white-space: pre-wrap; }
227
  .headerlogo{ margin: 0 auto; width: 80%; text-align: center; }
228
  .headerlogo amp-img{ margin-top:6px }
229
  .headerlogo a{ color:#F42; }
 
230
  /*Navigation Menu*/
231
  .toast { display: block; position: relative; height: 50px; padding-left: 20px; padding-right: 15px; width: 49px; background:none; border:0 }
232
  .toast:after, .toast:before, .toast span{ position: absolute; display: block; width: 19px; height: 2px; border-radius: 2px; background-color: #F42; -webkit-transform: translate3d(0, 0, 0) rotate(0deg); transform: translate3d(0, 0, 0) rotate(0deg); }
@@ -254,7 +286,10 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
254
  .searchform{ background: transparent; left: 20%; position: absolute; top: 35%; width: 60%; max-width: 100%; transition-delay: 0.5s; }
255
  .searchform input{ background: transparent; border: 1px solid #666; color: #f7f7f7; font-size: 14px; font-weight: 400; line-height: 1; letter-spacing: 0.3px; text-transform: capitalize; padding: 20px 0px 20px 30px; margin-top: 15px; width: 100%; }
256
  #searchsubmit{opacity:0}
257
-
 
 
 
258
  /* AMP carousel */
259
  .amp-carousel-button-prev, .amp-carousel-button-next{ top:30px;border-radius:60px; }
260
  .amp-featured-wrapper{ background:#333 }
@@ -262,11 +297,11 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
262
  .amp-carousel-slide h1{ font-size: 30px; font-family: 'PT Serif', serif; margin: 0; font-weight: normal; line-height: 38px; color: #fff; padding: 10px 20px 20px 20px; }
263
  .amp-featured-area .amp-carousel-slide amp-img:before{ z-index:100; bottom: 0; content: ""; display: block; height: 100%; position:absolute; width: 100%; background: -webkit-gradient(linear, 50% 0%, 50% 75%, color-stop(0%, rgba(0,0,0,0)), color-stop(150%, #000000)) repeat scroll 0 0 rgba(0,0,0,0.2); background: -webkit-linear-gradient(rgba(0,0,0,0),#000000 75%) repeat scroll 0 0 rgba(0,0,0,0); background: -moz-linear-gradient(rgba(0,0,0,0),#000000 75%) repeat scroll 0 0 rgba(0,0,0,0); background: -o-linear-gradient(rgba(0,0,0,0),#000000 75%) repeat scroll 0 0 rgba(0,0,0,0); background: linear-gradient(rgba(0,0,0,0),#000000 75%) repeat scroll 0 0 rgba(0,0,0,0); }
264
  .featured_title{ position:absolute; z-index:110; bottom:0 }
265
- .featured_time{ font-size: 12px; color: #fff; opacity: 0.8; padding-left: 20px; }
266
  .featured_meta{ color:#acacac; font-size:12px; margin:0 15px; }
267
  .featured_meta_left{ float:left }
268
  .featured_meta_right{ float:right }
269
-
 
270
  /* Tables */
271
  table { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; overflow-x: auto; }
272
  table a:link { color: #666; font-weight: bold; text-decoration: none; }
@@ -285,6 +320,7 @@ table tr:last-child td {border-bottom: 0;}
285
  table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
286
  table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
287
  table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
 
288
 
289
  /* Responsive */
290
  @media screen and (min-width: 650px) { table {display: inline-table;} }
@@ -393,7 +429,8 @@ if ( class_exists('TablePress') ) { ?>
393
  .tablepress .row-hover tr:hover td{ background-color: #f3f3f3; }
394
  @media (min-width: 768px) and (max-width: 1600px){ .tablepress{ overflow-x: none; } }
395
  @media (min-width: 320px) and (max-width: 767px){ .tablepress{ display: inline-block; overflow-x: scroll; } }
396
- <?php } ?>
 
397
  .breadcrumb{line-height: 1;margin-bottom:6px;}
398
  .breadcrumb ul, .category-single ul{ padding:0; margin:0;}
399
  .breadcrumb ul li{display:inline;}
@@ -401,4 +438,6 @@ if ( class_exists('TablePress') ) { ?>
401
  .breadcrumb ul li a::after {content: "►";display: inline-block;font-size: 8px;padding: 0 6px 0 7px;vertical-align: middle;opacity: 0.5;position:relative;top:-1px}
402
  .breadcrumb ul li:hover a::after{color:#c3c3c3;}
403
  .breadcrumb ul li:last-child a::after{display:none;}
 
 
404
  <?php echo $redux_builder_amp['css_editor']; } ?>
28
  .alignright{ float:right; margin-left: 12px; margin-bottom:5px; }
29
  .aligncenter{ text-align:center; margin: 0 auto }
30
  #statcounter{width: 1px;height:1px;}
31
+ amp-anim { max-width: 100%; }
32
+ @font-face {
33
+ font-family: 'Roboto Slab';
34
+ font-style: normal;
35
+ font-weight: 400;
36
+ src: local('Roboto Slab Regular'), local('RobotoSlab-Regular'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/robotoslab/RobotoSlab-Regular.ttf');
37
+ }
38
+ @font-face {
39
+ font-family: 'Roboto Slab';
40
+ font-style: normal;
41
+ font-weight: 700;
42
+ src: local('Roboto Slab Bold'), local('RobotoSlab-Bold'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/robotoslab/RobotoSlab-Bold.ttf');
43
+ }
44
+
45
+ @font-face {
46
+ font-family: 'PT Serif';
47
+ font-style: normal;
48
+ font-weight: 400;
49
+ src: local('PT Serif'), local('PTSerif-Regular'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/ptserif/PT_Serif-Web-Regular.ttf');
50
+ }
51
+ @font-face {
52
+ font-family: 'PT Serif';
53
+ font-style: normal;
54
+ font-weight: 700;
55
+ src: local('PT Serif Bold'), local('PTSerif-Bold'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/ptserif/PT_Serif-Web-Bold.ttf');
56
+ }
57
 
58
  /* Template Styles */
59
  .amp-wp-content, .amp-wp-title-bar div {
64
  }
65
 
66
  /* Slide Navigation code */
 
67
  amp-sidebar{ width: 280px; background: #131313; font-family: 'Roboto Slab', serif; }
68
  .amp-sidebar-image{ line-height: 100px; vertical-align:middle; }
69
  .amp-close-image{ top: 15px; left: 225px; cursor: pointer; }
82
  .toggle-text{ color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: 3px; display: inherit; text-align: center; }
83
  .toggle-text:before{ content: "..."; font-size: 32px; position: ; font-family: georgia; line-height: 0px; margin-left: 0px; letter-spacing: 1px; top: -3px; position: relative; padding-right: 10px; }
84
  .toggle-navigation:hover, .toggle-navigation:active, .toggle-navigation:focus{ display: inline-block; width: 100%; }
85
+ <?php if( ! is_singular() ){ ?>
86
  /* Pagination */
87
  .amp-wp-content.pagination-holder{ background: none; padding: 0; box-shadow: none; height: auto; min-height: auto; }
88
  #pagination{ width: 100%; margin-top: 20px; }
89
  #pagination .next, #pagination .prev{ margin: 0px 6% 10px 6%; }
90
  #pagination .next a, #pagination .prev a{ opacity:0.9; background: #f42f42; width: 100%; color: #fff; display: inline-block; text-align: center; font-size: 16px; line-height: 1; padding: 18px 0%; border-radius: 4px; }
91
+ <?php }
92
+ if(is_single()){?>
93
  /* Sticky Social bar in Single */
 
94
  .sticky_social{ width: 100%; bottom: 0; display: block; left: 0; box-shadow: 0px 4px 7px #000; background: #fff; padding: 7px 0px 0px 0px; position: fixed; margin: 0; z-index: 10; text-align: center; }
95
  .custom-amp-socialsharing-icon{ width: 50px; height: 28px; display: inline-block; background: #5cbe4a;position: relative; top: -8px; padding-top: 0px; }
96
  .custom-amp-socialsharing-icon amp-img{ top: 4px; }
97
  .custom-amp-socialsharing-line{background:#00b900}
 
98
  .sticky_social .whatsapp-share-icon{ padding: 4px 0px 14px 0px; height: 28px; top: -4px; position: relative; }
99
  .sticky_social .line-share-icon{ padding: 4px 0px 14px 0px; height: 28px; top: -4px; position: relative; }
100
+ <?php }?>
101
  /*Sticky Head For Design 3*/
 
102
  #header{ background: #fff; text-align: center; height:50px; box-shadow:0 0 32px rgba(0,0,0,.15); }
103
  header{ padding-bottom:50px; }
104
  #headerwrap{ position: fixed; z-index:1000; width: 100%; top:0; }
 
 
105
  <?php if($sticky_head) { ?>
106
  header{ padding-bottom:0px; }
107
  #headerwrap{ position: relative;}
108
  <?php } ?>
 
109
  #header h1{ text-align: center; font-size: 16px; position: relative; font-weight: bold; line-height: 53px; padding: 0; margin: 0; text-transform: uppercase }
 
110
  main .amp-wp-content{ font-size: 18px; line-height: 29px; color:#111 }
111
  .single-post main .amp-wp-article-content h1{ font-size:2em}
112
  .single-post main .amp-wp-article-content h1, .single-post main .amp-wp-article-content h2, .single-post main .amp-wp-article-content h3, .single-post main .amp-wp-article-content h4, .single-post main .amp-wp-article-content h5, .single-post main .amp-wp-article-content h6{ font-family: 'Roboto Slab', serif; margin: 0px 0px 5px 0px; line-height: 1.6; }
 
113
  .home-post_image{ float: left; width:33%; padding-right: 2%; }
114
  .amp-wp-title{ margin-top: 0px; }
115
  h2.amp-wp-title{ font-family: 'Roboto Slab', serif; font-weight: 700; font-size: 20px; margin-bottom: 7px; line-height: 1.3; }
121
  .amp-loop-list .amp-wp-post-content{ float: left; width: 65%; }
122
  .amp-loop-list .featured_time{ color:#b3b3b3; padding-left:0 }
123
  .amp-wp-post-content p{ color: grey; line-height: 1.5; font-size: 14px; margin: 8px 0 10px; font-family:'PT Serif', serif }
124
+ <?php if( $redux_builder_amp['enable-excerpt-single'] == 1) { ?>
125
  /* For Excerpt */
126
  .amp-wp-post-content .small-screen-excerpt-design-3 {display: none;} .amp-wp-post-content .large-screen-excerpt-design-3 { display: block; }
127
+ <?php } ?>
128
  /* Footer */
129
  #footer{ background: #151515; color: #eee; font-size: 13px; text-align: center; letter-spacing: 0.2px; padding: 35px 0 35px 0; margin-top: 30px; }
130
  #footer a{ color:#fff }
131
  #footer p:first-child{ margin-bottom: 12px; }
132
  #footer .social_icons{ margin: 0px 20px 25px 20px; border-bottom: 1px solid #3c3c3c; padding-bottom: 25px; }
133
  #footer p{ margin: 0 }
134
+ .back-to-top{padding-bottom: 8px;}
135
  .rightslink, #footer .rightslink a{ font-size:13px; color:#999 }
136
  .poweredby{ padding-top:10px; font-size:10px; }
137
  #footer .poweredby a{ color:#666 }
140
  .footer_menu ul li:first-child{ margin-left:0 }
141
  .footer_menu ul li:last-child{ margin-right:0 }
142
  .footer_menu ul ul{ display:none }
143
+ <?php if(is_singular() || $redux_builder_amp['amp-frontpage-select-option'] && ampforwp_get_blog_details() == false ){ ?>
144
  /* Single */
145
  .single-post main{ margin: 20px 17px 17px 17px; }
146
  .amp-wp-article-content{ font-family:'PT Serif', serif; }
163
  .custom-amp-socialsharing-icon-rounded{margin-right:6px;padding: 11px 12px 9px 12px; top: -13px; position: relative; line-height: 1; background: #5cbe4a; display: inline-block; height: inherit; border-radius: 60px; }
164
  .custom-amp-socialsharing-line{background:#00b900}
165
  .custom-amp-social-sharing-vk{background:#45668e}
166
+ .custom-amp-social-sharing-odnoklassniki{background:#ed812b}
167
  .amp-wp-tax-tag { list-style: none; display: inline-block; }
168
  figure{ margin: 0 0 20px 0; }
169
  figure amp-img{ max-width:100%; }
176
  .amp-wp-tax-tag{ }
177
  main .amp-wp-content.featured-image-content{ padding: 0px; border: 0; margin-bottom: 0; box-shadow: none }
178
  .amp-wp-content .amp-wp-article-featured-image amp-img {margin: 0 auto;}
179
+ .single-post .amp-wp-article-content amp-img{ max-width:100% }
180
+ <?php if(is_single()){?>
181
  /* Related Posts */
182
  main .amp-wp-content.relatedpost{ background: none; box-shadow: none; padding:0px 0 0 0; margin:1.8em auto 1.5em auto }
183
  .single-post main,.related-title,.single-post .comments_list h3{ font-size: 20px; color: #777; font-family:'Roboto Slab', serif; border-bottom: 1px solid #eee; font-weight: 400; padding-bottom: 1px; margin-bottom: 10px; }
189
  .related_posts ol li p{ font-size: 12px; color: #999; line-height: 1.2; margin: 12px 0 0 0; }
190
  .no_related_thumbnail{ padding: 15px 18px; }
191
  .no_related_thumbnail .related_link{ margin: 16px 18px 20px 19px; } .ampforwp_single_excerpt{ margin-bottom: 15px; }
192
+ <?php }
193
+ if( $redux_builder_amp['wordpress-comments-support'] ==1) { ?>
194
  /* Comments */
195
  .page-numbers{ padding: 9px 10px; background: #fff; font-size: 14px; }
196
  .comment-body .comment-content{ font-family:'PT Serif', serif; margin-top: 2px; }
203
  .comments_list ul ul li{ border-left: 2px solid #eee; padding-left: 15px; border-bottom: 0; padding-bottom: 0px; }
204
  .comments_list ul li .comment-body .comment-author{ margin-right:5px }
205
  .comment-author{ float:left }
206
+ .single-post footer.comment-meta{ color:#666; padding-bottom: 0; line-height: 1.9; }
207
+ .comment-author-img{float: left; margin-right: 5px; border-radius: 60px; }
208
  .comment-metadata a{ color:#888 }
209
  .comments_list li li{ margin: 20px 20px 10px 20px; background: #f7f7f7; box-shadow: none; border: 1px solid #eee; }
210
  .comments_list li li li{ margin:20px 20px 10px 20px }
211
  .comment-content amp-img{max-width: 300px;}
212
+ <?php } ?>
213
  /* ADS */
214
  .amp_ad_1{ margin-top: 15px; margin-bottom: 10px; }
215
  .single-post .amp_ad_1{ margin-bottom: -15px; }
217
  html .single-post .ampforwp-incontent-ad-1 { margin-bottom: 10px; }
218
  .amp-ad-3{ margin-bottom:10px; }
219
  .amp-ad-4{ margin-top:2px; }
220
+ <?php if($redux_builder_amp['amp-enable-notifications']==1){ ?>
221
  /* Notifications */
222
  #amp-user-notification1 p{ display: inline-block; }
223
  amp-user-notification{ padding: 5px; text-align: center; background: #fff; border-top: 1px solid; }
224
  amp-user-notification button{ padding: 8px 10px; background: #000; color: #fff; margin-left: 5px; border: 0; }
225
  amp-user-notification button:hover{ cursor: pointer }
226
+ <?php } ?>
227
  .amp-wp-content blockquote{ background-color: #fff; border-left: 3px solid; margin: 0; padding: 15px 20px; background: #f3f3f3; }
228
  .amp-wp-content blockquote p{ margin-bottom:0 }
229
  pre{ white-space: pre-wrap; }
233
  -webkit-transform-origin: right center;
234
  transform-origin: right center;*/
235
  }
236
+ <?php }?>
237
  /* Sidebar */
238
  #sidebar[aria-hidden="false"]+#designthree { max-height: 100vh; overflow: hidden; animation: opening .3s normal forwards ease-in-out; -webkit-transform: translate3d(60%, 0, 0) scale(0.8); transform: translate3d(60%, 0, 0) scale(0.8); }
239
  @keyframes opening{ 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(60%, 0, 0) scale(0.8); } }
240
  @keyframes closing{ 0% { transform: translate3d(60%, 0, 0) scale(0.8); } 100% { transform: translate3d(0, 0, 0) scale(1); } }
241
  @keyframes closingFix{ 0% { max-height: 100vh; overflow: hidden; } 100% { max-height: none; overflow: visible; } }
 
242
  .hamburgermenu{ float:left; position:relative; z-index: 9999; }
243
+
244
  /* Category 3 */
245
  .amp-category-block{ margin: 30px 0px 10px 0px }
246
  .amp-category-block a{ color:#666}
250
  .amp-category-block-btn{ display: block; text-align: center; font-size: 13px; margin-top: 15px; border-bottom: 1px solid #f1f1f1; text-decoration: none; padding-bottom: 8px;}
251
  .design_2_wrapper .amp-category-block{ max-width: 840px; margin: 1.5em auto; }
252
  .amp-category-block ul, .category-widget-wrapper{ max-width: 1000px; margin: 0 auto; padding:0px 15px 5px 15px }
253
+ .amp-category-post{ width: 32%; display: inline-block; word-wrap: break-word;float: left;}
254
  .amp-category-post amp-img{ margin-bottom:5px; }
255
  .amp-category-block li:nth-child(3){ margin: 0 1%; }
256
  .searchmenu{ margin-right: 15px; margin-top: 11px; position: absolute; top: 0; right: 0; }
258
  .headerlogo{ margin: 0 auto; width: 80%; text-align: center; }
259
  .headerlogo amp-img{ margin-top:6px }
260
  .headerlogo a{ color:#F42; }
261
+
262
  /*Navigation Menu*/
263
  .toast { display: block; position: relative; height: 50px; padding-left: 20px; padding-right: 15px; width: 49px; background:none; border:0 }
264
  .toast:after, .toast:before, .toast span{ position: absolute; display: block; width: 19px; height: 2px; border-radius: 2px; background-color: #F42; -webkit-transform: translate3d(0, 0, 0) rotate(0deg); transform: translate3d(0, 0, 0) rotate(0deg); }
286
  .searchform{ background: transparent; left: 20%; position: absolute; top: 35%; width: 60%; max-width: 100%; transition-delay: 0.5s; }
287
  .searchform input{ background: transparent; border: 1px solid #666; color: #f7f7f7; font-size: 14px; font-weight: 400; line-height: 1; letter-spacing: 0.3px; text-transform: capitalize; padding: 20px 0px 20px 30px; margin-top: 15px; width: 100%; }
288
  #searchsubmit{opacity:0}
289
+ .featured_time{ font-size: 12px; color: #fff; opacity: 0.8; padding-left: 20px; }
290
+ .archives_body main{ margin-top:30px }
291
+ .archives_body .page-title{margin-left:15px}
292
+ <?php if(is_home() && $redux_builder_amp['amp-frontpage-select-option']==0){?>
293
  /* AMP carousel */
294
  .amp-carousel-button-prev, .amp-carousel-button-next{ top:30px;border-radius:60px; }
295
  .amp-featured-wrapper{ background:#333 }
297
  .amp-carousel-slide h1{ font-size: 30px; font-family: 'PT Serif', serif; margin: 0; font-weight: normal; line-height: 38px; color: #fff; padding: 10px 20px 20px 20px; }
298
  .amp-featured-area .amp-carousel-slide amp-img:before{ z-index:100; bottom: 0; content: ""; display: block; height: 100%; position:absolute; width: 100%; background: -webkit-gradient(linear, 50% 0%, 50% 75%, color-stop(0%, rgba(0,0,0,0)), color-stop(150%, #000000)) repeat scroll 0 0 rgba(0,0,0,0.2); background: -webkit-linear-gradient(rgba(0,0,0,0),#000000 75%) repeat scroll 0 0 rgba(0,0,0,0); background: -moz-linear-gradient(rgba(0,0,0,0),#000000 75%) repeat scroll 0 0 rgba(0,0,0,0); background: -o-linear-gradient(rgba(0,0,0,0),#000000 75%) repeat scroll 0 0 rgba(0,0,0,0); background: linear-gradient(rgba(0,0,0,0),#000000 75%) repeat scroll 0 0 rgba(0,0,0,0); }
299
  .featured_title{ position:absolute; z-index:110; bottom:0 }
 
300
  .featured_meta{ color:#acacac; font-size:12px; margin:0 15px; }
301
  .featured_meta_left{ float:left }
302
  .featured_meta_right{ float:right }
303
+ <?php }
304
+ if( is_singular() || is_home() && $redux_builder_amp['amp-frontpage-select-option'] && ampforwp_get_blog_details() == false ) { ?>
305
  /* Tables */
306
  table { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; overflow-x: auto; }
307
  table a:link { color: #666; font-weight: bold; text-decoration: none; }
320
  table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
321
  table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
322
  table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
323
+ <?php } ?>
324
 
325
  /* Responsive */
326
  @media screen and (min-width: 650px) { table {display: inline-table;} }
429
  .tablepress .row-hover tr:hover td{ background-color: #f3f3f3; }
430
  @media (min-width: 768px) and (max-width: 1600px){ .tablepress{ overflow-x: none; } }
431
  @media (min-width: 320px) and (max-width: 767px){ .tablepress{ display: inline-block; overflow-x: scroll; } }
432
+ <?php }
433
+ if( !is_home() && $redux_builder_amp['ampforwp-bread-crumb'] == 1 ) { ?>
434
  .breadcrumb{line-height: 1;margin-bottom:6px;}
435
  .breadcrumb ul, .category-single ul{ padding:0; margin:0;}
436
  .breadcrumb ul li{display:inline;}
438
  .breadcrumb ul li a::after {content: "►";display: inline-block;font-size: 8px;padding: 0 6px 0 7px;vertical-align: middle;opacity: 0.5;position:relative;top:-1px}
439
  .breadcrumb ul li:hover a::after{color:#c3c3c3;}
440
  .breadcrumb ul li:last-child a::after{display:none;}
441
+ <?php } ?>
442
+ .amp-menu > li > a > amp-img, .sub-menu > li > a > amp-img { display: inline-block; margin-right: 4px; }
443
  <?php echo $redux_builder_amp['css_editor']; } ?>
templates/features.php CHANGED
@@ -94,7 +94,13 @@
94
  84. Inline Related Posts
95
  85. Caption for Gallery Images
96
  86. minify the content of pages
97
-
 
 
 
 
 
 
98
  */
99
  // Adding AMP-related things to the main theme
100
  global $redux_builder_amp;
@@ -172,7 +178,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
172
 
173
  function ampforwp_home_archive_rel_canonical() {
174
  global $redux_builder_amp;
175
- global $wp;
176
  if( is_attachment() ) {
177
  return;
178
  }
@@ -185,6 +191,10 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
185
  if ( is_archive() && !$redux_builder_amp['ampforwp-archive-support'] ) {
186
  return;
187
  }
 
 
 
 
188
  // #872 no-amphtml if selected as hide from settings
189
  if(is_archive() && $redux_builder_amp['ampforwp-archive-support']){
190
  $selected_cats = array();
@@ -220,7 +230,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
220
  if ( is_home() || is_front_page() || is_archive() ){
221
  global $wp;
222
  $current_archive_url = home_url( $wp->request );
223
- $amp_url = trailingslashit(trailingslashit($current_archive_url).'amp');
224
  } else {
225
  $amp_url = amp_get_permalink( get_queried_object_id() );
226
  }
@@ -260,7 +270,22 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
260
  $current_search_url =trailingslashit(get_home_url())."?amp=1&s=".get_search_query();
261
  $amp_url = untrailingslashit($current_search_url);
262
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
 
 
264
  $amp_url = apply_filters('ampforwp_modify_rel_canonical',$amp_url);
265
 
266
  if( $supported_amp_post_types) {
@@ -399,19 +424,21 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
399
  }
400
 
401
  // 6. Add required Javascripts for extra AMP features
402
- add_action('amp_post_template_head','ampforwp_register_additional_scripts', 20);
403
- function ampforwp_register_additional_scripts() {
 
404
  global $redux_builder_amp;
405
- if( $redux_builder_amp['enable-single-social-icons'] == true || defined('AMPFORWP_DM_SOCIAL_CHECK') && AMPFORWP_DM_SOCIAL_CHECK === 'true' ) { ?>
406
- <?php if( is_single() ) {
407
- if( is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
408
- <script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
409
- <?php }
410
- }
411
- }
412
- // Check if any of the ads are enabled then only load ads script
413
- // moved this code to its own function and done the AMP way
414
- }
 
415
  // 6.1 Adding Analytics Scripts
416
  add_filter('amp_post_template_data','ampforwp_register_analytics_script', 20);
417
  function ampforwp_register_analytics_script( $data ){
@@ -943,7 +970,17 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
943
 
944
 
945
  //Convert the Twitter embed into url for better sanitization #1010
946
- $content = preg_replace('/<blockquote.+?(?=class="twitter-tweet")class="twitter-tweet".+?(https:\/\/twitter\.com\/\w+\/\w+\/.*?)".+?(?=<\/blockquote>)<\/blockquote>/s', "$1", $content);
 
 
 
 
 
 
 
 
 
 
947
  return $content;
948
  }
949
 
@@ -1099,13 +1136,21 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
1099
  */
1100
  function ampforwp_get_all_post_types(){
1101
  global $redux_builder_amp;
 
 
1102
 
1103
  $post_types = array('post' => 'post', 'page' => 'page');
1104
  if ( isset($redux_builder_amp['ampforwp-custom-type']) && $redux_builder_amp['ampforwp-custom-type'] ) {
1105
- $post_types = array_merge($post_types, $redux_builder_amp['ampforwp-custom-type']);
 
 
 
 
1106
  }
 
1107
  return $post_types;
1108
  }
 
1109
  function ampforwp_title_custom_meta() {
1110
  global $redux_builder_amp;
1111
 
@@ -1589,20 +1634,18 @@ function ampforwp_sticky_social_icons(){
1589
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCAzMDQuMzYgMzA0LjM2IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAzMDQuMzYgMzA0LjM2OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4Ij4KPGcgaWQ9IlhNTElEXzFfIj4KCTxwYXRoIGlkPSJYTUxJRF84MDdfIiBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7IiBkPSJNMjYxLjk0NSwxNzUuNTc2YzEwLjA5Niw5Ljg1NywyMC43NTIsMTkuMTMxLDI5LjgwNywyOS45ODIgICBjNCw0LjgyMiw3Ljc4Nyw5Ljc5OCwxMC42ODQsMTUuMzk0YzQuMTA1LDcuOTU1LDAuMzg3LDE2LjcwOS02Ljc0NiwxNy4xODRsLTQ0LjM0LTAuMDJjLTExLjQzNiwwLjk0OS0yMC41NTktMy42NTUtMjguMjMtMTEuNDc0ICAgYy02LjEzOS02LjI1My0xMS44MjQtMTIuOTA4LTE3LjcyNy0xOS4zNzJjLTIuNDItMi42NDItNC45NTMtNS4xMjgtNy45NzktNy4wOTNjLTYuMDUzLTMuOTI5LTExLjMwNy0yLjcyNi0xNC43NjYsMy41ODcgICBjLTMuNTIzLDYuNDIxLTQuMzIyLDEzLjUzMS00LjY2OCwyMC42ODdjLTAuNDc1LDEwLjQ0MS0zLjYzMSwxMy4xODYtMTQuMTE5LDEzLjY2NGMtMjIuNDE0LDEuMDU3LTQzLjY4Ni0yLjMzNC02My40NDctMTMuNjQxICAgYy0xNy40MjItOS45NjgtMzAuOTMyLTI0LjA0LTQyLjY5MS0zOS45NzFDMzQuODI4LDE1My40ODIsMTcuMjk1LDExOS4zOTUsMS41MzcsODQuMzUzQy0yLjAxLDc2LjQ1OCwwLjU4NCw3Mi4yMiw5LjI5NSw3Mi4wNyAgIGMxNC40NjUtMC4yODEsMjguOTI4LTAuMjYxLDQzLjQxLTAuMDJjNS44NzksMC4wODYsOS43NzEsMy40NTgsMTIuMDQxLDkuMDEyYzcuODI2LDE5LjI0MywxNy40MDIsMzcuNTUxLDI5LjQyMiw1NC41MjEgICBjMy4yMDEsNC41MTgsNi40NjUsOS4wMzYsMTEuMTEzLDEyLjIxNmM1LjE0MiwzLjUyMSw5LjA1NywyLjM1NCwxMS40NzYtMy4zNzRjMS41MzUtMy42MzIsMi4yMDctNy41NDQsMi41NTMtMTEuNDM0ICAgYzEuMTQ2LTEzLjM4MywxLjI5Ny0yNi43NDMtMC43MTMtNDAuMDc5Yy0xLjIzNC04LjMyMy01LjkyMi0xMy43MTEtMTQuMjI3LTE1LjI4NmMtNC4yMzgtMC44MDMtMy42MDctMi4zOC0xLjU1NS00Ljc5OSAgIGMzLjU2NC00LjE3Miw2LjkxNi02Ljc2OSwxMy41OTgtNi43NjloNTAuMTExYzcuODg5LDEuNTU3LDkuNjQxLDUuMTAxLDEwLjcyMSwxMy4wMzlsMC4wNDMsNTUuNjYzICAgYy0wLjA4NiwzLjA3MywxLjUzNSwxMi4xOTIsNy4wNywxNC4yMjZjNC40MywxLjQ0OCw3LjM1LTIuMDk2LDEwLjAwOC00LjkwNWMxMS45OTgtMTIuNzM0LDIwLjU2MS0yNy43ODMsMjguMjExLTQzLjM2NiAgIGMzLjM5NS02Ljg1Miw2LjMxNC0xMy45NjgsOS4xNDMtMjEuMDc4YzIuMDk2LTUuMjc2LDUuMzg1LTcuODcyLDExLjMyOC03Ljc1N2w0OC4yMjksMC4wNDNjMS40MywwLDIuODc3LDAuMDIxLDQuMjYyLDAuMjU4ICAgYzguMTI3LDEuMzg1LDEwLjM1NCw0Ljg4MSw3Ljg0NCwxMi44MTdjLTMuOTU1LDEyLjQ1MS0xMS42NSwyMi44MjctMTkuMTc0LDMzLjI1MWMtOC4wNDMsMTEuMTI5LTE2LjY0NSwyMS44NzctMjQuNjIxLDMzLjA3MiAgIEMyNTIuMjYsMTYxLjU0NCwyNTIuODQyLDE2Ni42OTcsMjYxLjk0NSwxNzUuNTc2TDI2MS45NDUsMTc1LjU3NnogTTI2MS45NDUsMTc1LjU3NiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
1590
  </div>
1591
  </a>
 
 
 
 
 
 
 
1592
  <?php } ?>
1593
  </div>
1594
  <?php }
1595
  //}
1596
  }
1597
- // if ( $ampforwp_social_icons_enabled == true ) {
1598
- //
1599
- // }
1600
- // add_action('amp_post_template_head','ampforwp_register_social_sharing_script');
1601
- function ampforwp_register_social_sharing_script() {
1602
- if( is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
1603
- <script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
1604
- <?php }
1605
- }
1606
 
1607
  // 25. Yoast meta Support
1608
  function ampforwp_custom_yoast_meta(){
@@ -2177,11 +2220,15 @@ function ampforwp_add_extra_functions() {
2177
  add_filter( 'get_the_archive_title', 'ampforwp_editable_archvies_title' );
2178
  function ampforwp_editable_archvies_title($title) {
2179
  global $redux_builder_amp;
2180
- if ( is_category() ) {
2181
- $title = single_cat_title( ampforwp_translation($redux_builder_amp['amp-translator-archive-cat-text'], 'Category (archive title)').' ', false );
2182
- } elseif ( is_tag() ) {
2183
- $title = single_tag_title( ampforwp_translation($redux_builder_amp['amp-translator-archive-tag-text'], 'Tag (archive title)').' ', false );
2184
- }
 
 
 
 
2185
  return $title;
2186
  }
2187
 
@@ -2267,7 +2314,7 @@ function ampforwp_talking_to_robots() {
2267
 
2268
  // 41. Rewrite URL only on save #511
2269
  function ampforwp_auto_flush_on_save($redux_builder_amp) {
2270
- if ( $redux_builder_amp['amp-on-off-for-all-pages'] == 1 || $redux_builder_amp['ampforwp-archive-support'] == 1 ) {
2271
  global $wp_rewrite;
2272
  $wp_rewrite->flush_rules();
2273
  }
@@ -2571,6 +2618,15 @@ function ampforwp_search_or_homepage_or_staticpage_metadata( $metadata, $post )
2571
  $structured_data_width = $featured_image_array[1];
2572
  $structured_data_height = $featured_image_array[2];
2573
  }
 
 
 
 
 
 
 
 
 
2574
  }
2575
  else{
2576
  if( ampforwp_get_blog_details() == true ) {
@@ -2917,7 +2973,7 @@ add_shortcode('amp-gist', 'ampforwp_gist_shortcode_generator');
2917
  function ampforwp_gist_shortcode_generator($atts) {
2918
  extract(shortcode_atts(array(
2919
  'id' =>'' ,
2920
- 'layout' => fixed-height,
2921
  'height' => 200,
2922
  ), $atts));
2923
  if ( empty ( $height ) ) {
@@ -2928,20 +2984,30 @@ function ampforwp_gist_shortcode_generator($atts) {
2928
  height="'. $height .'">
2929
  </amp-gist>';
2930
  }
2931
- add_action('amp_post_template_head','ampforwp_add_gist_script', 10 , 1);
2932
- function ampforwp_add_gist_script( $data ){
2933
- if ( is_single() ) {
2934
- $content = $data->get('post');
2935
- if ( $content ) {
2936
- $content = $content->post_content;
2937
- }
2938
- if( has_shortcode( $content , 'amp-gist' ) ){ ?>
2939
- <script async custom-element="amp-gist" src="https://cdn.ampproject.org/v0/amp-gist-0.1.js"></script>
2940
- <?php
2941
- }
2942
- }
 
 
 
 
 
 
 
 
 
2943
  }
2944
 
 
2945
  // 62. Adding Meta viewport via hook instead of direct #878
2946
  add_action( 'amp_post_template_head','ampforwp_add_meta_viewport', 9);
2947
  function ampforwp_add_meta_viewport() {
@@ -3029,7 +3095,7 @@ function ampforwp_frontpage_comments() {
3029
  </div>
3030
  <!-- .comment-author -->
3031
  <div class="comment-metadata">
3032
- <a href="<?php echo trailingslashit( htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ) ?>">
3033
  <?php printf( ampforwp_translation( ('%1$s '. ampforwp_translation($redux_builder_amp['amp-translator-at-text'],'at').' %2$s'), '%1$s at %2$s') , get_comment_date(), get_comment_time())?>
3034
  </a>
3035
  <?php edit_comment_link( ampforwp_translation( $redux_builder_amp['amp-translator-Edit-text'], 'Edit' ) ) ?>
@@ -3626,30 +3692,28 @@ function ampforwp_generate_meta_desc(){
3626
  $desc = '';
3627
  $post_id = '';
3628
  $genesis_description = '';
3629
- if($redux_builder_amp['ampforwp-seo-yoast-description']){
3630
- if ( class_exists('WPSEO_Frontend') ) {
3631
- // general Description of everywhere
3632
- $front = WPSEO_Frontend::get_instance();
3633
- $desc = addslashes( strip_tags( $front->metadesc( false ) ) );
3634
-
3635
- // Static front page
3636
- // Code for Custom Frontpage Yoast SEO Description
3637
- //WPML Static Front Page Support for title and description with Yoast #1143
3638
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
3639
- if( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) && is_plugin_active('wordpress-seo/wp-seo.php')){
3640
-
3641
- $post_id = get_option( 'page_on_front' );
3642
- }
3643
- else {
3644
- $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
3645
- }
3646
 
3647
- if ( class_exists('WPSEO_Meta') ) {
3648
- if ( is_home() && $redux_builder_amp['amp-frontpage-select-option'] ) {
3649
- $desc = addslashes( strip_tags( WPSEO_Meta::get_value('metadesc', $post_id ) ) );
3650
- }
3651
  }
3652
- }
3653
  // for search
3654
  if( is_search() ) {
3655
  $desc = addslashes( ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query() );
@@ -3950,50 +4014,62 @@ if( !function_exists('ampforwp_get_blog_details') ) {
3950
  function ampforwp_get_blog_details( $param = "" ) {
3951
  global $redux_builder_amp;
3952
  $current_url = '';
3953
- $output = '';
 
 
 
3954
  $current_url_in_pieces = array();
3955
  if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1 && get_option('show_on_front') == 'page'){
3956
  $current_url = home_url( $GLOBALS['wp']->request );
3957
  $current_url_in_pieces = explode( '/', $current_url );
3958
  $page_for_posts = get_option( 'page_for_posts' );
3959
- $post = get_post($page_for_posts);
3960
- if ( $post ) {
3961
- $slug = $post->post_name;
3962
- $title = $post->post_title;
3963
- $blog_id = $post->ID;
3964
- }
3965
- switch ($param) {
3966
- case 'title':
3967
- $output = $title;
3968
- break;
3969
- case 'name':
3970
- $output = $slug;
3971
- break;
3972
- case 'id':
3973
- $output = $blog_id;
3974
- break;
3975
- default:
3976
- if(in_array($slug, $current_url_in_pieces)){
3977
- $output = true;
3978
- }
3979
- else
3980
- $output = false;
3981
- break;
 
 
3982
  }
 
 
3983
  }
3984
  return $output;
3985
  }
3986
  }
3987
  // 78. Saved Custom Post Types for AMP in Options for Structured Data
3988
- add_action('init', 'ampforwp_get_custom_post_types_sd');
3989
- if(! function_exists('ampforwp_get_custom_post_types_sd') ) {
3990
- function ampforwp_get_custom_post_types_sd(){
3991
  global $redux_builder_amp;
3992
- $post_types = array();
3993
  $saved_custom_posts = array();
 
 
 
 
3994
 
3995
  $saved_custom_posts = get_option('ampforwp_custom_post_types');
3996
- $post_types = get_post_types( array( 'public' => true, '_builtin' => false));
 
3997
 
3998
  if (empty($post_types)) {
3999
  $post_types = array();
@@ -4005,7 +4081,20 @@ if(! function_exists('ampforwp_get_custom_post_types_sd') ) {
4005
  if ( empty( $saved_custom_posts ) ) {
4006
  $saved_custom_posts = array();
4007
  }
4008
- if(array_diff($saved_custom_posts, $post_types) ){
 
 
 
 
 
 
 
 
 
 
 
 
 
4009
  update_option('ampforwp_custom_post_types', $post_types);
4010
  }
4011
 
@@ -4021,7 +4110,6 @@ add_action('amp_post_template_head','wp_site_icon');
4021
  * As it is not the best practice to add css directly into admin head
4022
  * for more info please check the issue #1082 in github
4023
  */
4024
-
4025
  // 81. Duplicate Featured Image Support
4026
  add_filter('ampforwp_allow_featured_image', 'ampforwp_enable_post_and_featured_image');
4027
  function ampforwp_enable_post_and_featured_image($show_image){
@@ -4034,7 +4122,7 @@ function ampforwp_enable_post_and_featured_image($show_image){
4034
  return $show_image;
4035
  }
4036
  // 82. Grab Featured Image from The Content
4037
- function ampforwp_get_featured_image_from_content($size = 'full') {
4038
  global $post, $posts;
4039
  $image_url = '';
4040
  $output = '';
@@ -4042,18 +4130,33 @@ function ampforwp_get_featured_image_from_content($size = 'full') {
4042
  $amp_html_sanitizer = '';
4043
  $amp_html = '';
4044
  $image_html = '';
 
4045
  ob_start();
4046
  ob_end_clean();
4047
  // Match all the images from the content
4048
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
4049
  //Grab the First Image
4050
  if ( $matches[0] ) {
 
4051
  $image_html = $matches[0][0];
4052
  // Sanitize it
4053
  $amp_html_sanitizer = new AMPFORWP_Content( $image_html, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array() ) ) );
4054
  $amp_html = $amp_html_sanitizer->get_amp_content();
4055
  }
4056
- return $amp_html;
 
 
 
 
 
 
 
 
 
 
 
 
 
4057
  }
4058
 
4059
  // 83. Advance Analytics(Google Analytics)
@@ -4297,9 +4400,9 @@ function ampforwp_minify_html_output($content_buffer){
4297
  $buffer .= $process.$asis;
4298
  }
4299
  $buffer = str_replace(array (chr(10) . '<script', chr(10) . '<style', '*/' . chr(10), 'M1N1FY-ST4RT'), array('<script', '<style', '*/', ''), $buffer);
4300
- $minify_html_xhtml = 'no';
4301
- $minify_html_relative = 'no';
4302
- $minify_html_scheme = 'no';
4303
  if ( $minify_html_xhtml == 'yes' && strtolower( substr( ltrim( $buffer ), 0, 15 ) ) == '<!doctype html>' )
4304
  $buffer = str_replace( ' />', '>', $buffer );
4305
  if ( $minify_html_relative == 'yes' )
@@ -4311,4 +4414,219 @@ function ampforwp_minify_html_output($content_buffer){
4311
 
4312
  return $content_buffer;
4313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4314
  }
94
  84. Inline Related Posts
95
  85. Caption for Gallery Images
96
  86. minify the content of pages
97
+ 87. Post Thumbnail
98
+ 88. Author Details
99
+ 89. Facebook Pixel
100
+ 90. Set Header last modified information
101
+ 91. Comment Author Gravatar URL
102
+ 92. View AMP in Admin Bar
103
+ 93. added AMP url purifire for amphtml
104
  */
105
  // Adding AMP-related things to the main theme
106
  global $redux_builder_amp;
178
 
179
  function ampforwp_home_archive_rel_canonical() {
180
  global $redux_builder_amp;
181
+ global $wp, $post;
182
  if( is_attachment() ) {
183
  return;
184
  }
191
  if ( is_archive() && !$redux_builder_amp['ampforwp-archive-support'] ) {
192
  return;
193
  }
194
+ // #1192 Password Protected posts exclusion
195
+ if(post_password_required( $post )){
196
+ return;
197
+ }
198
  // #872 no-amphtml if selected as hide from settings
199
  if(is_archive() && $redux_builder_amp['ampforwp-archive-support']){
200
  $selected_cats = array();
230
  if ( is_home() || is_front_page() || is_archive() ){
231
  global $wp;
232
  $current_archive_url = home_url( $wp->request );
233
+ $amp_url = trailingslashit($current_archive_url);
234
  } else {
235
  $amp_url = amp_get_permalink( get_queried_object_id() );
236
  }
270
  $current_search_url =trailingslashit(get_home_url())."?amp=1&s=".get_search_query();
271
  $amp_url = untrailingslashit($current_search_url);
272
  }
273
+
274
+ // WPML AMPHTML #1285
275
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
276
+ if(is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){
277
+ Global $sitepress_settings;
278
+ if($sitepress_settings[ 'language_negotiation_type' ] == 3){
279
+ $wpml_url =get_permalink( get_queried_object_id() );
280
+ $explode_url = explode('/', $wpml_url);
281
+ $append_amp = 'amp';
282
+ array_splice( $explode_url, 5, 0, $append_amp );
283
+ $impode_url = implode('/', $explode_url);
284
+ $amp_url = untrailingslashit($impode_url);
285
+ }
286
+ }
287
 
288
+ $amp_url = ampforwp_url_purifier($amp_url);
289
  $amp_url = apply_filters('ampforwp_modify_rel_canonical',$amp_url);
290
 
291
  if( $supported_amp_post_types) {
424
  }
425
 
426
  // 6. Add required Javascripts for extra AMP features
427
+ // Code updated and added the JS proper way #336
428
+ add_filter('amp_post_template_data','ampforwp_add_amp_social_share_script', 20);
429
+ function ampforwp_add_amp_social_share_script( $data ){
430
  global $redux_builder_amp;
431
+ if( $redux_builder_amp['enable-single-social-icons'] == true || defined('AMPFORWP_DM_SOCIAL_CHECK') && AMPFORWP_DM_SOCIAL_CHECK === 'true' ) {
432
+ if( is_single() && is_socialshare_or_socialsticky_enabled_in_ampforwp() ) {
433
+ if ( empty( $data['amp_component_scripts']['amp-social-share'] ) ) {
434
+ $data['amp_component_scripts']['amp-social-share'] = 'https://cdn.ampproject.org/v0/amp-social-share-0.1.js';
435
+ }
436
+ }
437
+ }
438
+ return $data;
439
+ }
440
+
441
+
442
  // 6.1 Adding Analytics Scripts
443
  add_filter('amp_post_template_data','ampforwp_register_analytics_script', 20);
444
  function ampforwp_register_analytics_script( $data ){
970
 
971
 
972
  //Convert the Twitter embed into url for better sanitization #1010
973
+ $content = preg_replace('/<blockquote.+?(?=class="twitter-.*?")class="twitter-.*?".+?(https:\/\/twitter\.com\/\w+\/\w+\/.*?)".+?(?=<\/blockquote>)<\/blockquote>/s', "$1", $content);
974
+
975
+ // for readability attibute in div tag
976
+ $content = preg_replace('/readability=[^>]*/', '', $content);
977
+ // removing color from span tag
978
+ $content = preg_replace('/<span(.*?)(color=".*?")(.*?)>/', '<span$1$3>', $content);
979
+ // removing sl-processed form anchor tag
980
+ $content = preg_replace('/<a (href=".*?")(.*?)(target=".*?")(.*?)(sl-processed=".*?")>/', '<a $1$3>', $content);
981
+ // removing text-align:center from p tag
982
+ $content = preg_replace('/<p(.*?)(text-align:=".*?")(.*?)(center=".*?")(.*?)>/', '<p$1$5>', $content);
983
+
984
  return $content;
985
  }
986
 
1136
  */
1137
  function ampforwp_get_all_post_types(){
1138
  global $redux_builder_amp;
1139
+ $post_types = array();
1140
+ $selected_post_types = array();
1141
 
1142
  $post_types = array('post' => 'post', 'page' => 'page');
1143
  if ( isset($redux_builder_amp['ampforwp-custom-type']) && $redux_builder_amp['ampforwp-custom-type'] ) {
1144
+
1145
+ foreach ($redux_builder_amp['ampforwp-custom-type'] as $key) {
1146
+ $selected_post_types[$key] = $key;
1147
+ }
1148
+ $post_types = array_merge($post_types, $selected_post_types);
1149
  }
1150
+
1151
  return $post_types;
1152
  }
1153
+
1154
  function ampforwp_title_custom_meta() {
1155
  global $redux_builder_amp;
1156
 
1634
  <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCAzMDQuMzYgMzA0LjM2IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAzMDQuMzYgMzA0LjM2OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4Ij4KPGcgaWQ9IlhNTElEXzFfIj4KCTxwYXRoIGlkPSJYTUxJRF84MDdfIiBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7IiBkPSJNMjYxLjk0NSwxNzUuNTc2YzEwLjA5Niw5Ljg1NywyMC43NTIsMTkuMTMxLDI5LjgwNywyOS45ODIgICBjNCw0LjgyMiw3Ljc4Nyw5Ljc5OCwxMC42ODQsMTUuMzk0YzQuMTA1LDcuOTU1LDAuMzg3LDE2LjcwOS02Ljc0NiwxNy4xODRsLTQ0LjM0LTAuMDJjLTExLjQzNiwwLjk0OS0yMC41NTktMy42NTUtMjguMjMtMTEuNDc0ICAgYy02LjEzOS02LjI1My0xMS44MjQtMTIuOTA4LTE3LjcyNy0xOS4zNzJjLTIuNDItMi42NDItNC45NTMtNS4xMjgtNy45NzktNy4wOTNjLTYuMDUzLTMuOTI5LTExLjMwNy0yLjcyNi0xNC43NjYsMy41ODcgICBjLTMuNTIzLDYuNDIxLTQuMzIyLDEzLjUzMS00LjY2OCwyMC42ODdjLTAuNDc1LDEwLjQ0MS0zLjYzMSwxMy4xODYtMTQuMTE5LDEzLjY2NGMtMjIuNDE0LDEuMDU3LTQzLjY4Ni0yLjMzNC02My40NDctMTMuNjQxICAgYy0xNy40MjItOS45NjgtMzAuOTMyLTI0LjA0LTQyLjY5MS0zOS45NzFDMzQuODI4LDE1My40ODIsMTcuMjk1LDExOS4zOTUsMS41MzcsODQuMzUzQy0yLjAxLDc2LjQ1OCwwLjU4NCw3Mi4yMiw5LjI5NSw3Mi4wNyAgIGMxNC40NjUtMC4yODEsMjguOTI4LTAuMjYxLDQzLjQxLTAuMDJjNS44NzksMC4wODYsOS43NzEsMy40NTgsMTIuMDQxLDkuMDEyYzcuODI2LDE5LjI0MywxNy40MDIsMzcuNTUxLDI5LjQyMiw1NC41MjEgICBjMy4yMDEsNC41MTgsNi40NjUsOS4wMzYsMTEuMTEzLDEyLjIxNmM1LjE0MiwzLjUyMSw5LjA1NywyLjM1NCwxMS40NzYtMy4zNzRjMS41MzUtMy42MzIsMi4yMDctNy41NDQsMi41NTMtMTEuNDM0ICAgYzEuMTQ2LTEzLjM4MywxLjI5Ny0yNi43NDMtMC43MTMtNDAuMDc5Yy0xLjIzNC04LjMyMy01LjkyMi0xMy43MTEtMTQuMjI3LTE1LjI4NmMtNC4yMzgtMC44MDMtMy42MDctMi4zOC0xLjU1NS00Ljc5OSAgIGMzLjU2NC00LjE3Miw2LjkxNi02Ljc2OSwxMy41OTgtNi43NjloNTAuMTExYzcuODg5LDEuNTU3LDkuNjQxLDUuMTAxLDEwLjcyMSwxMy4wMzlsMC4wNDMsNTUuNjYzICAgYy0wLjA4NiwzLjA3MywxLjUzNSwxMi4xOTIsNy4wNywxNC4yMjZjNC40MywxLjQ0OCw3LjM1LTIuMDk2LDEwLjAwOC00LjkwNWMxMS45OTgtMTIuNzM0LDIwLjU2MS0yNy43ODMsMjguMjExLTQzLjM2NiAgIGMzLjM5NS02Ljg1Miw2LjMxNC0xMy45NjgsOS4xNDMtMjEuMDc4YzIuMDk2LTUuMjc2LDUuMzg1LTcuODcyLDExLjMyOC03Ljc1N2w0OC4yMjksMC4wNDNjMS40MywwLDIuODc3LDAuMDIxLDQuMjYyLDAuMjU4ICAgYzguMTI3LDEuMzg1LDEwLjM1NCw0Ljg4MSw3Ljg0NCwxMi44MTdjLTMuOTU1LDEyLjQ1MS0xMS42NSwyMi44MjctMTkuMTc0LDMzLjI1MWMtOC4wNDMsMTEuMTI5LTE2LjY0NSwyMS44NzctMjQuNjIxLDMzLjA3MiAgIEMyNTIuMjYsMTYxLjU0NCwyNTIuODQyLDE2Ni42OTcsMjYxLjk0NSwxNzUuNTc2TDI2MS45NDUsMTc1LjU3NnogTTI2MS45NDUsMTc1LjU3NiIgZmlsbD0iI0ZGRkZGRiIvPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
1635
  </div>
1636
  </a>
1637
+ <?php } ?>
1638
+ <?php if($redux_builder_amp['enable-single-odnoklassniki-share'] == true) { ?>
1639
+ <a href="http://ok.ru/dk?st.cmd=WidgetShare&st.shareUrl=<?php echo get_the_permalink(); ?>" target="_blank">
1640
+ <div class="custom-amp-socialsharing-icon custom-amp-social-sharing-odnoklassniki">
1641
+ <amp-img src="data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjY0cHgiIGhlaWdodD0iNjRweCIgdmlld0JveD0iMCAwIDk1LjQ4MSA5NS40ODEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDk1LjQ4MSA5NS40ODE7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8Zz4KCQk8cGF0aCBkPSJNNDMuMDQxLDY3LjI1NGMtNy40MDItMC43NzItMTQuMDc2LTIuNTk1LTE5Ljc5LTcuMDY0Yy0wLjcwOS0wLjU1Ni0xLjQ0MS0xLjA5Mi0yLjA4OC0xLjcxMyAgICBjLTIuNTAxLTIuNDAyLTIuNzUzLTUuMTUzLTAuNzc0LTcuOTg4YzEuNjkzLTIuNDI2LDQuNTM1LTMuMDc1LDcuNDg5LTEuNjgyYzAuNTcyLDAuMjcsMS4xMTcsMC42MDcsMS42MzksMC45NjkgICAgYzEwLjY0OSw3LjMxNywyNS4yNzgsNy41MTksMzUuOTY3LDAuMzI5YzEuMDU5LTAuODEyLDIuMTkxLTEuNDc0LDMuNTAzLTEuODEyYzIuNTUxLTAuNjU1LDQuOTMsMC4yODIsNi4yOTksMi41MTQgICAgYzEuNTY0LDIuNTQ5LDEuNTQ0LDUuMDM3LTAuMzgzLDcuMDE2Yy0yLjk1NiwzLjAzNC02LjUxMSw1LjIyOS0xMC40NjEsNi43NjFjLTMuNzM1LDEuNDQ4LTcuODI2LDIuMTc3LTExLjg3NSwyLjY2MSAgICBjMC42MTEsMC42NjUsMC44OTksMC45OTIsMS4yODEsMS4zNzZjNS40OTgsNS41MjQsMTEuMDIsMTEuMDI1LDE2LjUsMTYuNTY2YzEuODY3LDEuODg4LDIuMjU3LDQuMjI5LDEuMjI5LDYuNDI1ICAgIGMtMS4xMjQsMi40LTMuNjQsMy45NzktNi4xMDcsMy44MWMtMS41NjMtMC4xMDgtMi43ODItMC44ODYtMy44NjUtMS45NzdjLTQuMTQ5LTQuMTc1LTguMzc2LTguMjczLTEyLjQ0MS0xMi41MjcgICAgYy0xLjE4My0xLjIzNy0xLjc1Mi0xLjAwMy0yLjc5NiwwLjA3MWMtNC4xNzQsNC4yOTctOC40MTYsOC41MjgtMTIuNjgzLDEyLjczNWMtMS45MTYsMS44ODktNC4xOTYsMi4yMjktNi40MTgsMS4xNSAgICBjLTIuMzYyLTEuMTQ1LTMuODY1LTMuNTU2LTMuNzQ5LTUuOTc5YzAuMDgtMS42MzksMC44ODYtMi44OTEsMi4wMTEtNC4wMTRjNS40NDEtNS40MzMsMTAuODY3LTEwLjg4LDE2LjI5NS0xNi4zMjIgICAgQzQyLjE4Myw2OC4xOTcsNDIuNTE4LDY3LjgxMyw0My4wNDEsNjcuMjU0eiIgZmlsbD0iI0ZGRkZGRiIvPgoJCTxwYXRoIGQ9Ik00Ny41NSw0OC4zMjljLTEzLjIwNS0wLjA0NS0yNC4wMzMtMTAuOTkyLTIzLjk1Ni0yNC4yMThDMjMuNjcsMTAuNzM5LDM0LjUwNS0wLjAzNyw0Ny44NCwwICAgIGMxMy4zNjIsMC4wMzYsMjQuMDg3LDEwLjk2NywyNC4wMiwyNC40NzhDNzEuNzkyLDM3LjY3Nyw2MC44ODksNDguMzc1LDQ3LjU1LDQ4LjMyOXogTTU5LjU1MSwyNC4xNDMgICAgYy0wLjAyMy02LjU2Ny01LjI1My0xMS43OTUtMTEuODA3LTExLjgwMWMtNi42MDktMC4wMDctMTEuODg2LDUuMzE2LTExLjgzNSwxMS45NDNjMC4wNDksNi41NDIsNS4zMjQsMTEuNzMzLDExLjg5NiwxMS43MDkgICAgQzU0LjM1NywzNS45NzEsNTkuNTczLDMwLjcwOSw1OS41NTEsMjQuMTQzeiIgZmlsbD0iI0ZGRkZGRiIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=" width="50" height="20" />
1642
+ </div>
1643
+ </a>
1644
  <?php } ?>
1645
  </div>
1646
  <?php }
1647
  //}
1648
  }
 
 
 
 
 
 
 
 
 
1649
 
1650
  // 25. Yoast meta Support
1651
  function ampforwp_custom_yoast_meta(){
2220
  add_filter( 'get_the_archive_title', 'ampforwp_editable_archvies_title' );
2221
  function ampforwp_editable_archvies_title($title) {
2222
  global $redux_builder_amp;
2223
+ $ampforwp_is_amp_endpoint = ampforwp_is_amp_endpoint();
2224
+
2225
+ if ( $ampforwp_is_amp_endpoint){
2226
+ if ( is_category() ) {
2227
+ $title = single_cat_title( ampforwp_translation($redux_builder_amp['amp-translator-archive-cat-text'], 'Category (archive title)').' ', false );
2228
+ } elseif ( is_tag() ) {
2229
+ $title = single_tag_title( ampforwp_translation($redux_builder_amp['amp-translator-archive-tag-text'], 'Tag (archive title)').' ', false );
2230
+ }
2231
+ }
2232
  return $title;
2233
  }
2234
 
2314
 
2315
  // 41. Rewrite URL only on save #511
2316
  function ampforwp_auto_flush_on_save($redux_builder_amp) {
2317
+ if ( $redux_builder_amp['amp-on-off-for-all-pages'] == 1 || $redux_builder_amp['ampforwp-archive-support'] == 1 || $redux_builder_amp['fb-instant-article-switch'] == 1 ) {
2318
  global $wp_rewrite;
2319
  $wp_rewrite->flush_rules();
2320
  }
2618
  $structured_data_width = $featured_image_array[1];
2619
  $structured_data_height = $featured_image_array[2];
2620
  }
2621
+ // Frontpage Author
2622
+ $structured_data_author = '';
2623
+ $structured_data_author = get_userdata($static_page_data->post_author );
2624
+ if ( $structured_data_author ) {
2625
+ $structured_data_author = $structured_data_author->display_name ;
2626
+ } else {
2627
+ $structured_data_author = "admin";
2628
+ }
2629
+ $metadata['author']['name'] = $structured_data_author;
2630
  }
2631
  else{
2632
  if( ampforwp_get_blog_details() == true ) {
2973
  function ampforwp_gist_shortcode_generator($atts) {
2974
  extract(shortcode_atts(array(
2975
  'id' =>'' ,
2976
+ 'layout' => 'fixed-height',
2977
  'height' => 200,
2978
  ), $atts));
2979
  if ( empty ( $height ) ) {
2984
  height="'. $height .'">
2985
  </amp-gist>';
2986
  }
2987
+
2988
+ // Code updated and added the JS proper way #336
2989
+ add_filter('amp_post_template_data','ampforwp_add_amp_gist_script', 100);
2990
+ function ampforwp_add_amp_gist_script( $data ){
2991
+ global $redux_builder_amp;
2992
+ $content = "";
2993
+
2994
+ $content = $data['post'];
2995
+ if( $content ){
2996
+ $content = $content->post_content;
2997
+
2998
+ if( is_single() ) {
2999
+ if( has_shortcode( $content, 'amp-gist' ) ){
3000
+ if ( empty( $data['amp_component_scripts']['amp-gist'] ) ) {
3001
+ $data['amp_component_scripts']['amp-gist'] = 'https://cdn.ampproject.org/v0/amp-gist-0.1.js';
3002
+ }
3003
+ }
3004
+ }
3005
+ }
3006
+
3007
+ return $data;
3008
  }
3009
 
3010
+
3011
  // 62. Adding Meta viewport via hook instead of direct #878
3012
  add_action( 'amp_post_template_head','ampforwp_add_meta_viewport', 9);
3013
  function ampforwp_add_meta_viewport() {
3095
  </div>
3096
  <!-- .comment-author -->
3097
  <div class="comment-metadata">
3098
+ <a href="<?php echo untrailingslashit( htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ) ?>">
3099
  <?php printf( ampforwp_translation( ('%1$s '. ampforwp_translation($redux_builder_amp['amp-translator-at-text'],'at').' %2$s'), '%1$s at %2$s') , get_comment_date(), get_comment_time())?>
3100
  </a>
3101
  <?php edit_comment_link( ampforwp_translation( $redux_builder_amp['amp-translator-Edit-text'], 'Edit' ) ) ?>
3692
  $desc = '';
3693
  $post_id = '';
3694
  $genesis_description = '';
3695
+ if( $redux_builder_amp['ampforwp-seo-yoast-description'] && class_exists('WPSEO_Frontend') ){
3696
+ // general Description of everywhere
3697
+ $front = WPSEO_Frontend::get_instance();
3698
+ $desc = addslashes( strip_tags( $front->metadesc( false ) ) );
3699
+
3700
+ // Static front page
3701
+ // Code for Custom Frontpage Yoast SEO Description
3702
+ //WPML Static Front Page Support for title and description with Yoast #1143
3703
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
3704
+ if( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) && is_plugin_active('wordpress-seo/wp-seo.php')){
3705
+
3706
+ $post_id = get_option( 'page_on_front' );
3707
+ }
3708
+ else {
3709
+ $post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
3710
+ }
 
3711
 
3712
+ if ( class_exists('WPSEO_Meta') ) {
3713
+ if ( is_home() && $redux_builder_amp['amp-frontpage-select-option'] ) {
3714
+ $desc = addslashes( strip_tags( WPSEO_Meta::get_value('metadesc', $post_id ) ) );
 
3715
  }
3716
+ }
3717
  // for search
3718
  if( is_search() ) {
3719
  $desc = addslashes( ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query() );
4014
  function ampforwp_get_blog_details( $param = "" ) {
4015
  global $redux_builder_amp;
4016
  $current_url = '';
4017
+ $output = '';
4018
+ $slug = '';
4019
+ $title = '';
4020
+ $blog_id = '';
4021
  $current_url_in_pieces = array();
4022
  if(is_home() && $redux_builder_amp['amp-frontpage-select-option'] == 1 && get_option('show_on_front') == 'page'){
4023
  $current_url = home_url( $GLOBALS['wp']->request );
4024
  $current_url_in_pieces = explode( '/', $current_url );
4025
  $page_for_posts = get_option( 'page_for_posts' );
4026
+ if( $page_for_posts ){
4027
+ $post = get_post($page_for_posts);
4028
+ if ( $post ) {
4029
+ $slug = $post->post_name;
4030
+ $title = $post->post_title;
4031
+ $blog_id = $post->ID;
4032
+ }
4033
+ switch ($param) {
4034
+ case 'title':
4035
+ $output = $title;
4036
+ break;
4037
+ case 'name':
4038
+ $output = $slug;
4039
+ break;
4040
+ case 'id':
4041
+ $output = $blog_id;
4042
+ break;
4043
+ default:
4044
+ if( in_array( $slug , $current_url_in_pieces , true ) ){
4045
+ $output = true;
4046
+ }
4047
+ else
4048
+ $output = false;
4049
+ break;
4050
+ }
4051
  }
4052
+ else
4053
+ $output = false;
4054
  }
4055
  return $output;
4056
  }
4057
  }
4058
  // 78. Saved Custom Post Types for AMP in Options for Structured Data
4059
+ add_action("redux/options/redux_builder_amp/saved",'ampforwp_save_custom_post_types_sd', 10, 1);
4060
+ if(! function_exists('ampforwp_save_custom_post_types_sd') ) {
4061
+ function ampforwp_save_custom_post_types_sd( $redux_builder_amp ){
4062
  global $redux_builder_amp;
4063
+ $post_types = array();
4064
  $saved_custom_posts = array();
4065
+ $count_current_pt = "";
4066
+ $count_saved_pt = "";
4067
+ $array_1 = "";
4068
+ $array_2 = "";
4069
 
4070
  $saved_custom_posts = get_option('ampforwp_custom_post_types');
4071
+ $post_types = ampforwp_get_all_post_types();
4072
+
4073
 
4074
  if (empty($post_types)) {
4075
  $post_types = array();
4081
  if ( empty( $saved_custom_posts ) ) {
4082
  $saved_custom_posts = array();
4083
  }
4084
+
4085
+ $count_current_pt = count( $post_types );
4086
+ $count_saved_pt = count( $saved_custom_posts );
4087
+
4088
+ if ( $count_current_pt > $count_saved_pt) {
4089
+
4090
+ $array_1 = $post_types;
4091
+ $array_2 = $saved_custom_posts;
4092
+ } else {
4093
+ $array_1 = $saved_custom_posts;
4094
+ $array_2 = $post_types;
4095
+ }
4096
+
4097
+ if( array_diff( $array_1, $array_2 ) ){
4098
  update_option('ampforwp_custom_post_types', $post_types);
4099
  }
4100
 
4110
  * As it is not the best practice to add css directly into admin head
4111
  * for more info please check the issue #1082 in github
4112
  */
 
4113
  // 81. Duplicate Featured Image Support
4114
  add_filter('ampforwp_allow_featured_image', 'ampforwp_enable_post_and_featured_image');
4115
  function ampforwp_enable_post_and_featured_image($show_image){
4122
  return $show_image;
4123
  }
4124
  // 82. Grab Featured Image from The Content
4125
+ function ampforwp_get_featured_image_from_content($featured_image = "") {
4126
  global $post, $posts;
4127
  $image_url = '';
4128
  $output = '';
4130
  $amp_html_sanitizer = '';
4131
  $amp_html = '';
4132
  $image_html = '';
4133
+ $featured_image_output = '';
4134
  ob_start();
4135
  ob_end_clean();
4136
  // Match all the images from the content
4137
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
4138
  //Grab the First Image
4139
  if ( $matches[0] ) {
4140
+ $image_url = $matches[1][0];
4141
  $image_html = $matches[0][0];
4142
  // Sanitize it
4143
  $amp_html_sanitizer = new AMPFORWP_Content( $image_html, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array() ) ) );
4144
  $amp_html = $amp_html_sanitizer->get_amp_content();
4145
  }
4146
+ switch ($featured_image) {
4147
+ case 'image':
4148
+ $featured_image_output = $amp_html;
4149
+ break;
4150
+
4151
+ case 'url':
4152
+ $featured_image_output = $image_url;
4153
+ break;
4154
+
4155
+ default:
4156
+ $featured_image_output = $amp_html;
4157
+ break;
4158
+ }
4159
+ return $featured_image_output;
4160
  }
4161
 
4162
  // 83. Advance Analytics(Google Analytics)
4400
  $buffer .= $process.$asis;
4401
  }
4402
  $buffer = str_replace(array (chr(10) . '<script', chr(10) . '<style', '*/' . chr(10), 'M1N1FY-ST4RT'), array('<script', '<style', '*/', ''), $buffer);
4403
+ $minify_html_xhtml = 'no';
4404
+ $minify_html_relative = 'no';
4405
+ $minify_html_scheme = 'no';
4406
  if ( $minify_html_xhtml == 'yes' && strtolower( substr( ltrim( $buffer ), 0, 15 ) ) == '<!doctype html>' )
4407
  $buffer = str_replace( ' />', '>', $buffer );
4408
  if ( $minify_html_relative == 'yes' )
4414
 
4415
  return $content_buffer;
4416
 
4417
+ }
4418
+
4419
+ // 87. Post Thumbnail
4420
+ // Checker for Post Thumbnail
4421
+ if( !function_exists('ampforwp_has_post_thumbnail')){
4422
+ function ampforwp_has_post_thumbnail(){
4423
+ global $post, $redux_builder_amp;
4424
+ if(has_post_thumbnail()){
4425
+ return true;
4426
+ }
4427
+ elseif(ampforwp_is_custom_field_featured_image() && ampforwp_cf_featured_image_src()){
4428
+ return true;
4429
+ }
4430
+ elseif(isset($redux_builder_amp['ampforwp-featured-image-from-content']) && $redux_builder_amp['ampforwp-featured-image-from-content'] == true){
4431
+ return true;
4432
+ }
4433
+ else
4434
+ return false;
4435
+ }
4436
+ }
4437
+ // Get Post Thumbnail URL
4438
+ if( !function_exists('ampforwp_get_post_thumbnail')){
4439
+ function ampforwp_get_post_thumbnail(){
4440
+ global $post, $redux_builder_amp;
4441
+ $thumb_url = '';
4442
+ if ( has_post_thumbnail()) {
4443
+ $thumb_id = get_post_thumbnail_id();
4444
+ $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
4445
+ $thumb_url = $thumb_url_array[0];
4446
+ }
4447
+ elseif(ampforwp_is_custom_field_featured_image()){
4448
+ $thumb_url = ampforwp_cf_featured_image_src();
4449
+ }
4450
+ elseif($redux_builder_amp['ampforwp-featured-image-from-content'] == true){
4451
+ $thumb_url = ampforwp_get_featured_image_from_content('url');
4452
+ }
4453
+ return $thumb_url;
4454
+ }
4455
+ }
4456
+
4457
+ // 88. Author Details
4458
+ // Author Page URL
4459
+ if( ! function_exists( 'ampforwp_get_author_page_url' ) ){
4460
+ function ampforwp_get_author_page_url(){
4461
+ global $redux_builder_amp, $post;
4462
+ $author_id = '';
4463
+ $author_page_url = '';
4464
+ $author_id = get_the_author_meta( 'ID' );
4465
+ $author_page_url = get_author_posts_url( $author_id );
4466
+ // If Archive support is enabled
4467
+ if( isset($redux_builder_amp['ampforwp-archive-support'] ) && $redux_builder_amp['ampforwp-archive-support'] ){
4468
+ $author_page_url = user_trailingslashit( $author_page_url . AMPFORWP_AMP_QUERY_VAR );
4469
+ }
4470
+ return $author_page_url;
4471
+ }
4472
+ }
4473
+ // Author Meta
4474
+ if( ! function_exists( 'ampforwp_get_author_details' ) ){
4475
+ function ampforwp_get_author_details( $post_author , $params='' ){
4476
+ global $redux_builder_amp, $post;
4477
+ $post_author_url = '';
4478
+ $post_author_url = ampforwp_get_author_page_url();
4479
+ switch ($params) {
4480
+ case 'meta-info':
4481
+ if( isset($redux_builder_amp['ampforwp-author-page-url']) && $redux_builder_amp['ampforwp-author-page-url'] ) {
4482
+ return '<span class="amp-wp-author author vcard"><a href="'.esc_url($post_author_url).'">'.esc_html( $post_author->display_name ).'</a></span>';
4483
+ }
4484
+ else {
4485
+ return '<span class="amp-wp-author author vcard">' .esc_html( $post_author->display_name ).'</span>';
4486
+ }
4487
+ break;
4488
+
4489
+ case 'meta-taxonomy':
4490
+ if( isset($redux_builder_amp['ampforwp-author-page-url']) && $redux_builder_amp['ampforwp-author-page-url'] ) {
4491
+ return '<a href="' . esc_url($post_author_url) . ' "><strong>' . esc_html( $post_author->display_name ) . ' </strong></a>:';
4492
+ }
4493
+ else{
4494
+ return '<strong> ' . esc_html( $post_author->display_name) . ' </strong>:';
4495
+ }
4496
+ break;
4497
+ }
4498
+ }
4499
+ }
4500
+
4501
+ // 89. Facebook Pixel
4502
+
4503
+ add_action('amp_post_template_footer','ampforwp_facebook_pixel',11);
4504
+ function ampforwp_facebook_pixel() {
4505
+
4506
+ Global $redux_builder_amp;
4507
+ if( isset($redux_builder_amp['amp-fb-pixel']) && $redux_builder_amp['amp-fb-pixel'] ){
4508
+ $amp_pixel = '<amp-pixel src="https://www.facebook.com/tr?id='.$redux_builder_amp['amp-fb-pixel-id'].'&ev=PageView&noscript=1"></amp-pixel>';
4509
+ echo $amp_pixel;
4510
+
4511
+ }
4512
+ }
4513
+ //90. Set Header last modified information
4514
+ add_action('template_redirect', 'ampforwp_addAmpLastModifiedHeader');
4515
+ function ampforwp_addAmpLastModifiedHeader($headers) {
4516
+
4517
+ //Check if we are in a single post of any type (archive pages has not modified date)
4518
+ $ampforwp_is_amp_endpoint = ampforwp_is_amp_endpoint();
4519
+
4520
+ if( is_singular() && $ampforwp_is_amp_endpoint ) {
4521
+ $post_id = get_queried_object_id();
4522
+ if( $post_id ) {
4523
+ header("Last-Modified: " . get_the_modified_time("D, d M Y H:i:s", $post_id) );
4524
+ }
4525
+ }
4526
+ }
4527
+ // 91. Comment Author Gravatar URL
4528
+ if( ! function_exists('ampforwp_get_comments_gravatar') ){
4529
+ function ampforwp_get_comments_gravatar( $comment ) {
4530
+ $gravatar_exists = '';
4531
+ $gravatar_exists = ampforwp_comment_gravatar_checker($comment->comment_author_email);
4532
+ if($gravatar_exists == true){
4533
+ return get_avatar_url( $comment, apply_filters( 'ampforwp_get_comments_gravatar', '60' ), '' );
4534
+ }
4535
+ else
4536
+ return;
4537
+ }
4538
+ }
4539
+ // Gravatar Checker
4540
+ if( ! function_exists('ampforwp_comment_gravatar_checker') ){
4541
+ function ampforwp_comment_gravatar_checker($email) {
4542
+ // Craft a potential url and test its headers
4543
+ $hash = md5(strtolower(trim($email)));
4544
+ $uri = 'http://www.gravatar.com/avatar/' . $hash . '?d=404';
4545
+ $headers = @get_headers($uri);
4546
+ // If its 404
4547
+ if (!preg_match("|200|", $headers[0])) {
4548
+ $has_valid_avatar = FALSE;
4549
+ }
4550
+ // Else if it is 200
4551
+ else {
4552
+ $has_valid_avatar = TRUE;
4553
+ }
4554
+ return $has_valid_avatar;
4555
+ }
4556
+ }
4557
+ // 92. View AMP in Admin Bar
4558
+ add_action( 'wp_before_admin_bar_render', 'ampforwp_view_amp_admin_bar' );
4559
+ if( ! function_exists( 'ampforwp_view_amp_admin_bar' ) ) {
4560
+ function ampforwp_view_amp_admin_bar( ) {
4561
+ global $wp_admin_bar, $post, $wp_post_types, $redux_builder_amp;
4562
+ $post_type_title = '';
4563
+ $supported_amp_post_types = array();
4564
+
4565
+ // Get all post types supported by AMP
4566
+ $supported_amp_post_types = ampforwp_get_all_post_types();
4567
+ // Check for Admin
4568
+ if ( is_admin() ) {
4569
+ $current_screen = get_current_screen();
4570
+ // Check for Screen base, user ability to read and visibility
4571
+ if ('post' == $current_screen->base
4572
+ && 'add' != $current_screen->action
4573
+ && current_user_can('read_post', $post->ID )
4574
+ && ( $wp_post_types[$post->post_type]->public )
4575
+ && ( $wp_post_types[$post->post_type]->show_in_admin_bar ) ) {
4576
+ // Check if current post type is AMPed or not
4577
+ if( $supported_amp_post_types && in_array($post->post_type, $supported_amp_post_types) ){
4578
+ // If AMP on Posts or Pages is off then do nothing
4579
+ if($post->post_type == 'post' && !$redux_builder_amp['amp-on-off-for-all-posts'] || $post->post_type == 'page' && !$redux_builder_amp['amp-on-off-for-all-pages']) {
4580
+ return;
4581
+ }
4582
+ $post_type_title = ucfirst($post->post_type);
4583
+ $wp_admin_bar->add_node(array(
4584
+ 'id' => 'ampforwp-view-amp',
4585
+ 'title' => 'View ' . $post_type_title . ' (AMP)' ,
4586
+ 'href' => user_trailingslashit( trailingslashit( get_permalink( $post->ID ) ) . AMPFORWP_AMP_QUERY_VAR )
4587
+ ));
4588
+ }
4589
+ }
4590
+ }
4591
+ }
4592
+ }
4593
+ //93. added AMP url purifire for amphtml
4594
+ function ampforwp_url_purifier($url){
4595
+ global $wp_query;
4596
+ $get_permalink_structure = "";
4597
+ $endpoint = "";
4598
+ $queried_var = "";
4599
+ $quried_value = "";
4600
+ $endpoint = AMPFORWP_AMP_QUERY_VAR;
4601
+ $get_permalink_structure = get_option('permalink_structure');
4602
+
4603
+ if ( empty( $get_permalink_structure ) ) {
4604
+ $endpoint = '?' . $endpoint;
4605
+ if (is_home() || is_archive() ) {
4606
+ $url = trailingslashit($url) . $endpoint;
4607
+ }
4608
+ if ( is_archive() ) {
4609
+
4610
+ if ( is_archive() ) {
4611
+ $queried_var = 'm';
4612
+ }
4613
+ if ( is_tag() ) {
4614
+ $queried_var = 'tag';
4615
+ }
4616
+ if ( is_category() ) {
4617
+ $queried_var = 'cat';
4618
+ }
4619
+ if ( is_author() ) {
4620
+ $queried_var = 'author';
4621
+ }
4622
+ $quried_value = get_query_var($queried_var);
4623
+ $url = $url .'&'. $queried_var .'='. $quried_value;
4624
+ }
4625
+ } else {
4626
+ if ( is_home() || is_archive() ) {
4627
+ $url = user_trailingslashit( trailingslashit($url) . $endpoint );
4628
+ }
4629
+ }
4630
+ //var_dump($url); die;
4631
+ return $url;
4632
  }
templates/instant-articles/instant-article-sanitizer.php CHANGED
@@ -12,6 +12,8 @@ if(class_exists("DOMDocument")){
12
  add_filter( 'fbia_content_dom','resize_images');
13
  // The empty P tags class should run last
14
  add_filter( 'fbia_content_dom','no_empty_p_tags');
 
 
15
  }
16
  function headlines($content){
17
  // Replace h3, h4, h5, h6 with h2
@@ -227,6 +229,28 @@ function no_empty_p_tags($DOMDocument){
227
 
228
  return $DOMDocument;
229
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
 
231
  function get_ia_placement_id(){
232
  global $redux_builder_amp;
12
  add_filter( 'fbia_content_dom','resize_images');
13
  // The empty P tags class should run last
14
  add_filter( 'fbia_content_dom','no_empty_p_tags');
15
+ // Wrap the Tables and Iframes inside Figure
16
+ add_filter( 'fbia_content_dom','ampforwp_fbia_wrap_elements');
17
  }
18
  function headlines($content){
19
  // Replace h3, h4, h5, h6 with h2
229
 
230
  return $DOMDocument;
231
  }
232
+ function ampforwp_fbia_wrap_elements( $DOMDocument ){
233
+
234
+ $figure_object = $DOMDocument->createElement( 'figure' );
235
+ $figure_object->setAttribute( 'class', 'op-interactive' );
236
+
237
+ // The elements to wrap.
238
+ $elements_to_wrap = array( 'iframe', 'table' );
239
+
240
+ foreach ( $elements_to_wrap as $element_to_wrap ) {
241
+
242
+ foreach ( $elements = $DOMDocument->getElementsByTagName( $element_to_wrap ) as $element ) {
243
+ if ( 'figure' !== $element->parentNode->tagName ) {
244
+
245
+ $figure_template = clone $figure_object;
246
+ $element->parentNode->replaceChild( $figure_template, $element );
247
+ $figure_template->appendChild( $element );
248
+
249
+ }
250
+ }
251
+ }
252
+ return $DOMDocument;
253
+ }
254
 
255
  function get_ia_placement_id(){
256
  global $redux_builder_amp;
templates/structured-data.php CHANGED
@@ -49,3 +49,30 @@ function ampforwp_structured_data_type( $metadata ){
49
 
50
  return $metadata;
51
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  return $metadata;
51
  }
52
+ // VideoObject
53
+ add_filter( 'amp_post_template_metadata', 'ampforwp_structured_data_video_thumb', 20, 1 );
54
+ if( ! function_exists('ampforwp_structured_data_video_thumb') ){
55
+ function ampforwp_structured_data_video_thumb( $metadata ){
56
+ global $redux_builder_amp, $post;
57
+ if($metadata['@type'] == 'VideoObject'){
58
+ $post_image_id = '';
59
+ $post_image_id = get_post_thumbnail_id( get_the_ID() );
60
+ $post_image = wp_get_attachment_image_src( $post_image_id, 'full' );
61
+ $structured_data_video_thumb_url = '';
62
+ // If there's no featured image, take default from settings
63
+ if ( $post_image == false) {
64
+ if (! empty( $redux_builder_amp['amporwp-structured-data-video-thumb-url']['url'] ) ) {
65
+ $structured_data_video_thumb_url = $redux_builder_amp['amporwp-structured-data-video-thumb-url']['url'];
66
+ }
67
+ }
68
+ // If featured image is present, take it as thumbnail
69
+ else{
70
+ $structured_data_video_thumb_url = $post_image[0];
71
+ }
72
+ $metadata['name'] = $metadata['headline'];
73
+ $metadata['uploadDate'] = $metadata['datePublished'];
74
+ $metadata['thumbnailUrl'] = $structured_data_video_thumb_url;
75
+ }
76
+ return $metadata;
77
+ }
78
+ }