Version Description
- View more details at https://ampforwp.com/disqus-comments-in-amp/
- Disqus Comments in AMP Support Added [New Feature] - This feature can be enabled from Dashboard > AMP Options > Disqus Comments
- AMP WooCommerce supported tag was missing after the last update. [Bug fix]
- Homepage & Related Posts was displaying private and protected posts, which is now fixed [Bug fix]
- Next previous links added in Design 1 [Enhancement]
- Invalid Post Time displaying in the homepage of Design 1 [Bug fix]
- Twitter share now includes the twitter handle of the author with setting in options [Enhancement]
- Emoji in comments leads to AMP errors was fixed [Bug fix]
- Date are now displayed on archives in Design 1 [Enhancement]
- When RTL enabled logo merges with nav bar was fixed [Bug fix]
- Jetpack Photon compatibility added [3rd Party Compatibility]
Download this release
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 0.9.41 |
Comparing to | |
See all releases |
Code changes from version 0.9.40 to 0.9.41
- accelerated-moblie-pages.php +3 -2
- includes/options/admin-config.php +48 -40
- readme.txt +17 -3
- templates/design-manager/design-1/archive.php +9 -1
- templates/design-manager/design-1/elements/comments.php +6 -1
- templates/design-manager/design-1/elements/content.php +43 -4
- templates/design-manager/design-1/elements/related-posts.php +6 -2
- templates/design-manager/design-1/elements/social-icons.php +3 -1
- templates/design-manager/design-1/frontpage.php +8 -2
- templates/design-manager/design-1/index.php +10 -3
- templates/design-manager/design-1/style.php +23 -1
- templates/design-manager/design-2/elements/comments.php +6 -1
- templates/design-manager/design-2/elements/related-posts.php +5 -1
- templates/design-manager/design-2/elements/social-icons.php +7 -5
- templates/design-manager/design-2/frontpage.php +8 -2
- templates/design-manager/design-2/index.php +3 -1
- templates/design-manager/design-2/style.php +22 -0
- templates/features.php +26 -12
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.
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/5
|
@@ -14,8 +14,9 @@ License: GPL2
|
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
define('AMPFORWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
|
|
|
17 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
18 |
-
define('AMPFORWP_VERSION','0.9.
|
19 |
|
20 |
// Rewrite the Endpoints after the plugin is activate, as priority is set to 11
|
21 |
function ampforwp_add_custom_post_support() {
|
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.41
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/5
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
define('AMPFORWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
|
17 |
+
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
|
18 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
19 |
+
define('AMPFORWP_VERSION','0.9.41');
|
20 |
|
21 |
// Rewrite the Endpoints after the plugin is activate, as priority is set to 11
|
22 |
function ampforwp_add_custom_post_support() {
|
includes/options/admin-config.php
CHANGED
@@ -720,6 +720,14 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
720 |
'title' => __('Twitter', 'redux-framework-demo'),
|
721 |
'default' => 1,
|
722 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
723 |
// GooglePlus ON/OFF
|
724 |
array(
|
725 |
'id' => 'enable-single-gplus-share',
|
@@ -988,46 +996,46 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
988 |
|
989 |
|
990 |
// Disqus Comments
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
|
1032 |
|
1033 |
|
720 |
'title' => __('Twitter', 'redux-framework-demo'),
|
721 |
'default' => 1,
|
722 |
),
|
723 |
+
array(
|
724 |
+
'id' => 'enable-single-twitter-share-handle',
|
725 |
+
'type' => 'text',
|
726 |
+
'title' => __('Twitter Handle', 'redux-framework-demo'),
|
727 |
+
'required' => array('enable-single-twitter-share', '=' , '1'),
|
728 |
+
'placeholder' => 'Eg: @xyx',
|
729 |
+
'default' => '',
|
730 |
+
),
|
731 |
// GooglePlus ON/OFF
|
732 |
array(
|
733 |
'id' => 'enable-single-gplus-share',
|
996 |
|
997 |
|
998 |
// Disqus Comments
|
999 |
+
Redux::setSection( $opt_name, array(
|
1000 |
+
'title' => __( 'Disqus Comments', 'redux-framework-demo' ),
|
1001 |
+
'desc' => '<a href="https://github.com/disqus/disqus-install-examples/tree/master/google-amp"> Link to Official Disqus documentation. </a>',
|
1002 |
+
'id' => 'disqus-comments',
|
1003 |
+
'subsection' => true,
|
1004 |
+
'fields' => array(
|
1005 |
+
array(
|
1006 |
+
'id' => 'ampforwp-disqus-comments-support',
|
1007 |
+
'type' => 'switch',
|
1008 |
+
'title' => __('Disqus comments Support', 'redux-framework-demo'),
|
1009 |
+
'subtitle' => __('Enable/Disable Disqus comments using this switch.', 'redux-framework-demo'),
|
1010 |
+
'default' => 0
|
1011 |
+
),
|
1012 |
+
array(
|
1013 |
+
'id' => 'ampforwp-disqus-comments-name',
|
1014 |
+
'type' => 'text',
|
1015 |
+
'title' => __('Disqus Name', 'redux-framework-demo'),
|
1016 |
+
'subtitle' => __('Eg: https://xyz.disqus.com', 'redux-framework-demo'),
|
1017 |
+
'required' => array('ampforwp-disqus-comments-support', '=' , '1'),
|
1018 |
+
),
|
1019 |
+
|
1020 |
+
array(
|
1021 |
+
'id' => 'ampforwp-disqus-host-position',
|
1022 |
+
'type' => 'switch',
|
1023 |
+
'title' => __('Host Disqus Comments through AMPforWP Servers', 'redux-framework-demo'),
|
1024 |
+
'subtitle' => __('Use AMPforWP secure servers to serve Comments file. Recommended if your site is non HTTPS', 'redux-framework-demo'),
|
1025 |
+
'default' => 1,
|
1026 |
+
'required' => array('ampforwp-disqus-comments-support', '=' , '1'),
|
1027 |
+
),
|
1028 |
+
|
1029 |
+
array(
|
1030 |
+
'id' => 'ampforwp-disqus-host-file',
|
1031 |
+
'type' => 'text',
|
1032 |
+
'title' => __('Disqus Host File', 'redux-framework-demo'),
|
1033 |
+
'subtitle' => __('<a href="#"> Click here to know, How to Setup Disqus Host file on your servers </a>', 'redux-framework-demo'),
|
1034 |
+
'placeholder' => 'https://comments.example.com/disqus.php',
|
1035 |
+
'required' => array('ampforwp-disqus-host-position', '=' , '0'),
|
1036 |
+
),
|
1037 |
+
)
|
1038 |
+
) );
|
1039 |
|
1040 |
|
1041 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/5
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.7.2
|
7 |
-
Stable tag: 0.9.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -29,12 +29,13 @@ AMP for WP automatically adds Accelerated Mobile Pages (Google AMP Project) func
|
|
29 |
|
30 |
= Features: =
|
31 |
|
|
|
32 |
* NEW - Google Tag Manager Support
|
33 |
* NEW - Page, Category & Tags Support Added
|
34 |
* NEW - Custom AMP Editor - Which allows you to override your Content that you had written in Post or page, so you can add the different content just for AMP.
|
35 |
* NEW - Mobile Redirection - More than 50% of your traffic is from mobile and you aren’t doing anything to improve their user experience, which means you are falling behind on SEO and it can result in lower SERPS. Lightning fast mobile version means faster User experience means more engagement which directly results in the lower bounce rate.
|
36 |
-
*
|
37 |
-
*
|
38 |
* Drag & Drop Page builder Added
|
39 |
* 2 Designs Added
|
40 |
* Yoast SEO support on AMP pages and other SEO plugins
|
@@ -124,6 +125,19 @@ You can contact me using this url: http://ampforwp.com/contact/
|
|
124 |
|
125 |
== Changelog ==
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
= 0.9.40 =
|
128 |
* View more details at https://ampforwp.com/0-9-40-released-biggest-stability-update/
|
129 |
* Proper endpoints added [Improvement]
|
4 |
Donate link: https://www.paypal.me/Kaludi/5
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.7.2
|
7 |
+
Stable tag: 0.9.41
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
29 |
|
30 |
= Features: =
|
31 |
|
32 |
+
* NEW - Disqus Comments Support
|
33 |
* NEW - Google Tag Manager Support
|
34 |
* NEW - Page, Category & Tags Support Added
|
35 |
* NEW - Custom AMP Editor - Which allows you to override your Content that you had written in Post or page, so you can add the different content just for AMP.
|
36 |
* NEW - Mobile Redirection - More than 50% of your traffic is from mobile and you aren’t doing anything to improve their user experience, which means you are falling behind on SEO and it can result in lower SERPS. Lightning fast mobile version means faster User experience means more engagement which directly results in the lower bounce rate.
|
37 |
+
* Custom Post Type Support
|
38 |
+
* Star Ratings
|
39 |
* Drag & Drop Page builder Added
|
40 |
* 2 Designs Added
|
41 |
* Yoast SEO support on AMP pages and other SEO plugins
|
125 |
|
126 |
== Changelog ==
|
127 |
|
128 |
+
= 0.9.41 =
|
129 |
+
* View more details at https://ampforwp.com/disqus-comments-in-amp/
|
130 |
+
* Disqus Comments in AMP Support Added [New Feature] - This feature can be enabled from Dashboard > AMP Options > Disqus Comments
|
131 |
+
* AMP WooCommerce supported tag was missing after the last update. [Bug fix]
|
132 |
+
* Homepage & Related Posts was displaying private and protected posts, which is now fixed [Bug fix]
|
133 |
+
* Next previous links added in Design 1 [Enhancement]
|
134 |
+
* Invalid Post Time displaying in the homepage of Design 1 [Bug fix]
|
135 |
+
* Twitter share now includes the twitter handle of the author with setting in options [Enhancement]
|
136 |
+
* Emoji in comments leads to AMP errors was fixed [Bug fix]
|
137 |
+
* Date are now displayed on archives in Design 1 [Enhancement]
|
138 |
+
* When RTL enabled logo merges with nav bar was fixed [Bug fix]
|
139 |
+
* Jetpack Photon compatibility added [3rd Party Compatibility]
|
140 |
+
|
141 |
= 0.9.40 =
|
142 |
* View more details at https://ampforwp.com/0-9-40-released-biggest-stability-update/
|
143 |
* Proper endpoints added [Improvement]
|
templates/design-manager/design-1/archive.php
CHANGED
@@ -43,7 +43,15 @@
|
|
43 |
<a href="<?php echo trailingslashit($ampforwp_post_url) . AMP_QUERY_VAR ;?>"><?php the_title() ?></a>
|
44 |
</h1>
|
45 |
|
46 |
-
<div class="amp-wp-content-loop">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
<?php if ( has_post_thumbnail() ) { ?>
|
49 |
<?php
|
43 |
<a href="<?php echo trailingslashit($ampforwp_post_url) . AMP_QUERY_VAR ;?>"><?php the_title() ?></a>
|
44 |
</h1>
|
45 |
|
46 |
+
<div class="amp-wp-content-loop">
|
47 |
+
|
48 |
+
<div class="amp-wp-meta">
|
49 |
+
<time> <?php
|
50 |
+
printf( _x( '%1$s '. $redux_builder_amp['amp-translator-ago-date-text'], '%2$s = human-readable time difference', 'wpdocs_textdomain' ),
|
51 |
+
human_time_diff( get_the_time( 'U' ),
|
52 |
+
current_time( 'timestamp' ) ) ); ?>
|
53 |
+
</time>
|
54 |
+
</div>
|
55 |
|
56 |
<?php if ( has_post_thumbnail() ) { ?>
|
57 |
<?php
|
templates/design-manager/design-1/elements/comments.php
CHANGED
@@ -44,7 +44,12 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
44 |
</footer>
|
45 |
<!-- .comment-meta -->
|
46 |
<div class="comment-content">
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
48 |
</div>
|
49 |
<!-- .comment-content -->
|
50 |
</article>
|
44 |
</footer>
|
45 |
<!-- .comment-meta -->
|
46 |
<div class="comment-content">
|
47 |
+
<p><?php
|
48 |
+
$pattern = "~[^a-zA-Z0-9_ !@#$%^&*();\\\/|<>\"'+.,:?=-]~";
|
49 |
+
$emoji_content = get_comment_text();
|
50 |
+
$emoji_free_comments = preg_replace($pattern,'',$emoji_content);
|
51 |
+
echo $emoji_free_comments; ?>
|
52 |
+
</p>
|
53 |
</div>
|
54 |
<!-- .comment-content -->
|
55 |
</article>
|
templates/design-manager/design-1/elements/content.php
CHANGED
@@ -1,16 +1,55 @@
|
|
1 |
<div class="amp-wp-article-content"> <?php
|
2 |
|
3 |
-
do_action('ampforwp_inside_post_content_before');
|
4 |
$amp_custom_content_enable = get_post_meta( $this->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
|
5 |
|
6 |
// Normal Front Page Content
|
7 |
if ( ! $amp_custom_content_enable ) {
|
8 |
echo $this->get( 'post_amp_content' ); // amphtml content; no kses
|
9 |
} else {
|
10 |
-
// Custom/Alternative AMP content added through post meta
|
11 |
echo $this->get( 'ampforwp_amp_content' );
|
12 |
-
}
|
13 |
-
|
14 |
do_action('ampforwp_inside_post_content_after') ?>
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
</div>
|
1 |
<div class="amp-wp-article-content"> <?php
|
2 |
|
3 |
+
do_action('ampforwp_inside_post_content_before');
|
4 |
$amp_custom_content_enable = get_post_meta( $this->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
|
5 |
|
6 |
// Normal Front Page Content
|
7 |
if ( ! $amp_custom_content_enable ) {
|
8 |
echo $this->get( 'post_amp_content' ); // amphtml content; no kses
|
9 |
} else {
|
10 |
+
// Custom/Alternative AMP content added through post meta
|
11 |
echo $this->get( 'ampforwp_amp_content' );
|
12 |
+
}
|
13 |
+
|
14 |
do_action('ampforwp_inside_post_content_after') ?>
|
15 |
|
16 |
+
<!--Post Next-Previous Links-->
|
17 |
+
<?php global $redux_builder_amp;
|
18 |
+
if($redux_builder_amp['enable-single-next-prev']) { ?>
|
19 |
+
<!--IF Starts here-->
|
20 |
+
<div class="amp-wp-content post-pagination-meta">
|
21 |
+
<div id="pagination">
|
22 |
+
|
23 |
+
<!--Next Link code-->
|
24 |
+
<div class="next">
|
25 |
+
<?php $next_post = get_next_post();
|
26 |
+
if (!empty( $next_post )) {
|
27 |
+
$next_text = $next_post->post_title;
|
28 |
+
?>
|
29 |
+
<a href="<?php echo trailingslashit(get_permalink( $next_post->ID )) . AMP_QUERY_VAR; ?>"><?php echo apply_filters('ampforwp_next_link',$next_text ); ?> »</a> <?php
|
30 |
+
} ?>
|
31 |
+
</div>
|
32 |
+
<!--Next Link code-->
|
33 |
+
|
34 |
+
<!--Prev Link code-->
|
35 |
+
<div class="prev">
|
36 |
+
<?php $prev_post = get_previous_post();
|
37 |
+
if (!empty( $prev_post )) {
|
38 |
+
$prev_text = $prev_post->post_title;
|
39 |
+
?>
|
40 |
+
<a href="<?php echo trailingslashit(get_permalink( $prev_post->ID )). AMP_QUERY_VAR; ?>"> « <?php echo apply_filters('ampforwp_prev_link',$prev_text ); ?></a> <?php
|
41 |
+
} ?>
|
42 |
+
</div>
|
43 |
+
<!--Prev Link code-->
|
44 |
+
|
45 |
+
<!--Clearfix code-->
|
46 |
+
<div class="clearfix"></div>
|
47 |
+
<!--Clearfix code-->
|
48 |
+
|
49 |
+
</div>
|
50 |
+
</div>
|
51 |
+
<!--IF Ends here-->
|
52 |
+
<?php } ?>
|
53 |
+
<!--Post Next-Previous Links End here-->
|
54 |
+
|
55 |
</div>
|
templates/design-manager/design-1/elements/related-posts.php
CHANGED
@@ -15,7 +15,9 @@
|
|
15 |
'category__in' => $category_ids,
|
16 |
'post__not_in' => array($post->ID),
|
17 |
'posts_per_page'=> $int_number_of_related_posts,
|
18 |
-
'ignore_sticky_posts'=>1
|
|
|
|
|
19 |
);
|
20 |
}
|
21 |
} //end of block for categories
|
@@ -29,7 +31,9 @@
|
|
29 |
'tag__in' => $tag_ids,
|
30 |
'post__not_in' => array($post->ID),
|
31 |
'posts_per_page'=> $int_number_of_related_posts,
|
32 |
-
'ignore_sticky_posts'=>1
|
|
|
|
|
33 |
);
|
34 |
}
|
35 |
}//end of block for tags
|
15 |
'category__in' => $category_ids,
|
16 |
'post__not_in' => array($post->ID),
|
17 |
'posts_per_page'=> $int_number_of_related_posts,
|
18 |
+
'ignore_sticky_posts'=>1,
|
19 |
+
'has_password' => false ,
|
20 |
+
'post_status'=> 'publish'
|
21 |
);
|
22 |
}
|
23 |
} //end of block for categories
|
31 |
'tag__in' => $tag_ids,
|
32 |
'post__not_in' => array($post->ID),
|
33 |
'posts_per_page'=> $int_number_of_related_posts,
|
34 |
+
'ignore_sticky_posts'=>1,
|
35 |
+
'has_password' => false ,
|
36 |
+
'post_status'=> 'publish'
|
37 |
);
|
38 |
}
|
39 |
}//end of block for tags
|
templates/design-manager/design-1/elements/social-icons.php
CHANGED
@@ -3,11 +3,13 @@
|
|
3 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
4 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="50" height="28"></amp-social-share>
|
5 |
<?php } ?>
|
6 |
-
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
|
|
|
7 |
<amp-social-share type="twitter"
|
8 |
width="50"
|
9 |
height="28"
|
10 |
data-param-url="CANONICAL_URL"
|
|
|
11 |
></amp-social-share>
|
12 |
<?php } ?>
|
13 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
3 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
4 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="50" height="28"></amp-social-share>
|
5 |
<?php } ?>
|
6 |
+
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
|
7 |
+
$data_param_data = $redux_builder_amp['enable-single-twitter-share-handle'];?>
|
8 |
<amp-social-share type="twitter"
|
9 |
width="50"
|
10 |
height="28"
|
11 |
data-param-url="CANONICAL_URL"
|
12 |
+
data-param-text=<?php echo $data_param_data ?>
|
13 |
></amp-social-share>
|
14 |
<?php } ?>
|
15 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
templates/design-manager/design-1/frontpage.php
CHANGED
@@ -62,8 +62,14 @@ $template = new AMP_Post_Template( $post_id );?>
|
|
62 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
63 |
<amp-social-share type="facebook" width="50" height="28"></amp-social-share>
|
64 |
<?php } ?>
|
65 |
-
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
<?php } ?>
|
68 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
69 |
<amp-social-share type="gplus" width="50" height="28"></amp-social-share>
|
62 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
63 |
<amp-social-share type="facebook" width="50" height="28"></amp-social-share>
|
64 |
<?php } ?>
|
65 |
+
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
|
66 |
+
$data_param_data = $redux_builder_amp['enable-single-twitter-share-handle']; ?>
|
67 |
+
<amp-social-share type="twitter"
|
68 |
+
width="50"
|
69 |
+
height="28"
|
70 |
+
data-param-url="CANONICAL_URL"
|
71 |
+
data-param-text=<?php echo $data_param_data ?>
|
72 |
+
></amp-social-share>
|
73 |
<?php } ?>
|
74 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
75 |
<amp-social-share type="gplus" width="50" height="28"></amp-social-share>
|
templates/design-manager/design-1/index.php
CHANGED
@@ -45,7 +45,9 @@
|
|
45 |
'orderby' => 'date',
|
46 |
'ignore_sticky_posts' => 1,
|
47 |
'paged' => esc_attr($paged),
|
48 |
-
'post__not_in' => $exclude_ids
|
|
|
|
|
49 |
);
|
50 |
$filtered_args = apply_filters('ampforwp_query_args', $args);
|
51 |
$q = new WP_Query( $filtered_args ); ?>
|
@@ -60,8 +62,13 @@
|
|
60 |
|
61 |
<div class="amp-wp-content-loop">
|
62 |
<div class="amp-wp-meta">
|
63 |
-
<?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-author'
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
|
67 |
<?php if ( has_post_thumbnail() ) { ?>
|
45 |
'orderby' => 'date',
|
46 |
'ignore_sticky_posts' => 1,
|
47 |
'paged' => esc_attr($paged),
|
48 |
+
'post__not_in' => $exclude_ids,
|
49 |
+
'has_password' => false ,
|
50 |
+
'post_status'=> 'publish'
|
51 |
);
|
52 |
$filtered_args = apply_filters('ampforwp_query_args', $args);
|
53 |
$q = new WP_Query( $filtered_args ); ?>
|
62 |
|
63 |
<div class="amp-wp-content-loop">
|
64 |
<div class="amp-wp-meta">
|
65 |
+
<?php $this->load_parts( apply_filters( 'amp_post_template_meta_parts', array( 'meta-author') ) ); ?>
|
66 |
+
<time> <?php
|
67 |
+
printf( _x( '%1$s '. $redux_builder_amp['amp-translator-ago-date-text'], '%2$s = human-readable time difference', 'wpdocs_textdomain' ),
|
68 |
+
human_time_diff( get_the_time( 'U' ),
|
69 |
+
current_time( 'timestamp' ) ) ); ?>
|
70 |
+
</time>
|
71 |
+
</div>
|
72 |
|
73 |
|
74 |
<?php if ( has_post_thumbnail() ) { ?>
|
templates/design-manager/design-1/style.php
CHANGED
@@ -524,7 +524,7 @@ amp-carousel > amp-img > img {
|
|
524 |
padding:0
|
525 |
}
|
526 |
.comments_list ul.children{
|
527 |
-
padding-bottom:10px;
|
528 |
margin-left: 4%;
|
529 |
width: 96%;
|
530 |
}
|
@@ -736,6 +736,28 @@ amp-carousel > amp-img > img {
|
|
736 |
.amp-ad-wrapper.amp_ad_1 {
|
737 |
padding-top : 20px;
|
738 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
739 |
/* Custom Style Code */
|
740 |
<?php echo $redux_builder_amp['css_editor'];
|
741 |
} ?>
|
524 |
padding:0
|
525 |
}
|
526 |
.comments_list ul.children{
|
527 |
+
padding-bottom:10px;
|
528 |
margin-left: 4%;
|
529 |
width: 96%;
|
530 |
}
|
736 |
.amp-ad-wrapper.amp_ad_1 {
|
737 |
padding-top : 20px;
|
738 |
}
|
739 |
+
|
740 |
+
<?php //style for RTL
|
741 |
+
if( is_rtl() ) { ?>
|
742 |
+
/* stlye for RTL languages */
|
743 |
+
.amp-wp-header .amp-wp-site-icon{
|
744 |
+
position: relative;
|
745 |
+
float: left;
|
746 |
+
}
|
747 |
+
|
748 |
+
.amp-wp-header .nav_container{
|
749 |
+
float: left;
|
750 |
+
right: initial;
|
751 |
+
left: -11px;
|
752 |
+
}
|
753 |
+
|
754 |
+
.amp-wp-header .amp-wp-site-icon{
|
755 |
+
top: -3px;
|
756 |
+
right: initial;
|
757 |
+
left: -11px;
|
758 |
+
}
|
759 |
+
<?php } ?>
|
760 |
+
|
761 |
/* Custom Style Code */
|
762 |
<?php echo $redux_builder_amp['css_editor'];
|
763 |
} ?>
|
templates/design-manager/design-2/elements/comments.php
CHANGED
@@ -44,7 +44,12 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
44 |
</footer>
|
45 |
<!-- .comment-meta -->
|
46 |
<div class="comment-content">
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
48 |
</div>
|
49 |
<!-- .comment-content -->
|
50 |
</article>
|
44 |
</footer>
|
45 |
<!-- .comment-meta -->
|
46 |
<div class="comment-content">
|
47 |
+
<p><?php
|
48 |
+
$pattern = "~[^a-zA-Z0-9_ !@#$%^&*();\\\/|<>\"'+.,:?=-]~";
|
49 |
+
$emoji_content = get_comment_text();
|
50 |
+
$emoji_free_comments = preg_replace($pattern,'',$emoji_content);
|
51 |
+
echo $emoji_free_comments; ?>
|
52 |
+
</p>
|
53 |
</div>
|
54 |
<!-- .comment-content -->
|
55 |
</article>
|
templates/design-manager/design-2/elements/related-posts.php
CHANGED
@@ -14,7 +14,9 @@
|
|
14 |
'category__in' => $category_ids,
|
15 |
'post__not_in' => array($post->ID),
|
16 |
'posts_per_page'=> $int_number_of_related_posts,
|
17 |
-
'ignore_sticky_posts'=>1
|
|
|
|
|
18 |
);
|
19 |
}
|
20 |
} //end of block for categories
|
@@ -29,6 +31,8 @@
|
|
29 |
'post__not_in' => array($post->ID),
|
30 |
'posts_per_page'=> $int_number_of_related_posts,
|
31 |
'ignore_sticky_posts'=>1,
|
|
|
|
|
32 |
);
|
33 |
}
|
34 |
}//end of block for tags
|
14 |
'category__in' => $category_ids,
|
15 |
'post__not_in' => array($post->ID),
|
16 |
'posts_per_page'=> $int_number_of_related_posts,
|
17 |
+
'ignore_sticky_posts'=>1,
|
18 |
+
'has_password' => false ,
|
19 |
+
'post_status'=> 'publish'
|
20 |
);
|
21 |
}
|
22 |
} //end of block for categories
|
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 tags
|
templates/design-manager/design-2/elements/social-icons.php
CHANGED
@@ -3,12 +3,14 @@
|
|
3 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
4 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="50" height="28"></amp-social-share>
|
5 |
<?php } ?>
|
6 |
-
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
|
|
|
7 |
<amp-social-share type="twitter"
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
12 |
<?php } ?>
|
13 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
14 |
<amp-social-share type="gplus" width="50" height="28"></amp-social-share>
|
3 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
4 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="50" height="28"></amp-social-share>
|
5 |
<?php } ?>
|
6 |
+
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
|
7 |
+
$data_param_data = $redux_builder_amp['enable-single-twitter-share-handle'];?>
|
8 |
<amp-social-share type="twitter"
|
9 |
+
width="50"
|
10 |
+
height="28"
|
11 |
+
data-param-url="CANONICAL_URL"
|
12 |
+
data-param-text=<?php echo $data_param_data ?>
|
13 |
+
></amp-social-share>
|
14 |
<?php } ?>
|
15 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
16 |
<amp-social-share type="gplus" width="50" height="28"></amp-social-share>
|
templates/design-manager/design-2/frontpage.php
CHANGED
@@ -59,8 +59,14 @@ $template = new AMP_Post_Template( $post_id );?>
|
|
59 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
60 |
<amp-social-share type="facebook" width="50" height="28"></amp-social-share>
|
61 |
<?php } ?>
|
62 |
-
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
<?php } ?>
|
65 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
66 |
<amp-social-share type="gplus" width="50" height="28"></amp-social-share>
|
59 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
60 |
<amp-social-share type="facebook" width="50" height="28"></amp-social-share>
|
61 |
<?php } ?>
|
62 |
+
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
|
63 |
+
$data_param_data = $redux_builder_amp['enable-single-twitter-share-handle'];?>
|
64 |
+
<amp-social-share type="twitter"
|
65 |
+
width="50"
|
66 |
+
height="28"
|
67 |
+
data-param-url="CANONICAL_URL"
|
68 |
+
data-param-text=<?php echo $data_param_data ?>
|
69 |
+
></amp-social-share>
|
70 |
<?php } ?>
|
71 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
72 |
<amp-social-share type="gplus" width="50" height="28"></amp-social-share>
|
templates/design-manager/design-2/index.php
CHANGED
@@ -45,7 +45,9 @@
|
|
45 |
'orderby' => 'date',
|
46 |
'ignore_sticky_posts' => 1,
|
47 |
'paged' => esc_attr($paged),
|
48 |
-
'post__not_in' => $exclude_ids
|
|
|
|
|
49 |
);
|
50 |
$filtered_args = apply_filters('ampforwp_query_args', $args);
|
51 |
$q = new WP_Query( $filtered_args ); ?>
|
45 |
'orderby' => 'date',
|
46 |
'ignore_sticky_posts' => 1,
|
47 |
'paged' => esc_attr($paged),
|
48 |
+
'post__not_in' => $exclude_ids,
|
49 |
+
'has_password' => false ,
|
50 |
+
'post_status'=> 'publish'
|
51 |
);
|
52 |
$filtered_args = apply_filters('ampforwp_query_args', $args);
|
53 |
$q = new WP_Query( $filtered_args ); ?>
|
templates/design-manager/design-2/style.php
CHANGED
@@ -805,6 +805,28 @@ amp-user-notification button {
|
|
805 |
.amp-wp-article-content img {
|
806 |
max-width: 100%;
|
807 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
808 |
/* Custom Style Code */
|
809 |
<?php echo $redux_builder_amp['css_editor'];
|
810 |
} ?>
|
805 |
.amp-wp-article-content img {
|
806 |
max-width: 100%;
|
807 |
}
|
808 |
+
|
809 |
+
<?php //style for RTL
|
810 |
+
if( is_rtl() ) { ?>
|
811 |
+
/* stlye for RTL languages */
|
812 |
+
.amp-wp-header .amp-wp-site-icon{
|
813 |
+
position: relative;
|
814 |
+
float: left;
|
815 |
+
}
|
816 |
+
|
817 |
+
.amp-wp-header .nav_container{
|
818 |
+
float: left;
|
819 |
+
right: initial;
|
820 |
+
left: -11px;
|
821 |
+
}
|
822 |
+
|
823 |
+
.amp-wp-header .amp-wp-site-icon{
|
824 |
+
top: -3px;
|
825 |
+
right: initial;
|
826 |
+
left: -11px;
|
827 |
+
}
|
828 |
+
<?php } ?>
|
829 |
+
|
830 |
/* Custom Style Code */
|
831 |
<?php echo $redux_builder_amp['css_editor'];
|
832 |
} ?>
|
templates/features.php
CHANGED
@@ -96,9 +96,6 @@
|
|
96 |
if( is_page() && !$redux_builder_amp['amp-on-off-for-all-pages'] ) {
|
97 |
return;
|
98 |
}
|
99 |
-
if( is_page() && !$redux_builder_amp['amp-on-off-for-all-pages'] ) {
|
100 |
-
return;
|
101 |
-
}
|
102 |
|
103 |
if ( is_home() || is_front_page() || is_archive() ){
|
104 |
global $wp;
|
@@ -121,6 +118,13 @@
|
|
121 |
}
|
122 |
}
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
$type = get_post_type();
|
125 |
$supported_amp_post_types = in_array( $type , $supported_types );
|
126 |
|
@@ -137,7 +141,7 @@
|
|
137 |
array_splice( $explode_path, -2, 0, $inserted );
|
138 |
$impode_url = implode('/', $explode_path);
|
139 |
|
140 |
-
$amp_url = $new_url . $impode_url ;
|
141 |
}
|
142 |
|
143 |
if( $supported_amp_post_types ) {
|
@@ -920,12 +924,14 @@ function ampforwp_sticky_social_icons(){
|
|
920 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
921 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="50" height="28"></amp-social-share>
|
922 |
<?php } ?>
|
923 |
-
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
|
|
|
|
929 |
<?php } ?>
|
930 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
931 |
<amp-social-share type="gplus" width="50" height="28"></amp-social-share>
|
@@ -1159,7 +1165,7 @@ add_action('amp_init','social_sharing_removal_code', 9);
|
|
1159 |
|
1160 |
|
1161 |
//35. Disqus Comments Support
|
1162 |
-
|
1163 |
function ampforwp_add_disqus_support() {
|
1164 |
|
1165 |
global $redux_builder_amp;
|
@@ -1189,10 +1195,18 @@ function ampforwp_add_disqus_support() {
|
|
1189 |
}
|
1190 |
}
|
1191 |
|
1192 |
-
|
1193 |
function ampforwp_add_disqus_scripts( $data ) {
|
1194 |
if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
|
1195 |
$data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
|
1196 |
}
|
1197 |
return $data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1198 |
}
|
96 |
if( is_page() && !$redux_builder_amp['amp-on-off-for-all-pages'] ) {
|
97 |
return;
|
98 |
}
|
|
|
|
|
|
|
99 |
|
100 |
if ( is_home() || is_front_page() || is_archive() ){
|
101 |
global $wp;
|
118 |
}
|
119 |
}
|
120 |
|
121 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
122 |
+
if( is_plugin_active( 'amp-woocommerce/amp-woocommerce.php' ) ) {
|
123 |
+
if( !in_array("product", $supported_types) ){
|
124 |
+
$supported_types[]= 'product';
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
$type = get_post_type();
|
129 |
$supported_amp_post_types = in_array( $type , $supported_types );
|
130 |
|
141 |
array_splice( $explode_path, -2, 0, $inserted );
|
142 |
$impode_url = implode('/', $explode_path);
|
143 |
|
144 |
+
$amp_url = $new_url . $impode_url ;
|
145 |
}
|
146 |
|
147 |
if( $supported_amp_post_types ) {
|
924 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
925 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="50" height="28"></amp-social-share>
|
926 |
<?php } ?>
|
927 |
+
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) {
|
928 |
+
$data_param_data = $redux_builder_amp['enable-single-twitter-share-handle'];?>
|
929 |
+
<amp-social-share type="twitter"
|
930 |
+
width="50"
|
931 |
+
height="28"
|
932 |
+
data-param-url="CANONICAL_URL"
|
933 |
+
data-param-text=<?php echo $data_param_data ?>
|
934 |
+
></amp-social-share>
|
935 |
<?php } ?>
|
936 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
937 |
<amp-social-share type="gplus" width="50" height="28"></amp-social-share>
|
1165 |
|
1166 |
|
1167 |
//35. Disqus Comments Support
|
1168 |
+
add_action('ampforwp_post_after_design_elements','ampforwp_add_disqus_support');
|
1169 |
function ampforwp_add_disqus_support() {
|
1170 |
|
1171 |
global $redux_builder_amp;
|
1195 |
}
|
1196 |
}
|
1197 |
|
1198 |
+
add_filter( 'amp_post_template_data', 'ampforwp_add_disqus_scripts' );
|
1199 |
function ampforwp_add_disqus_scripts( $data ) {
|
1200 |
if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
|
1201 |
$data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
|
1202 |
}
|
1203 |
return $data;
|
1204 |
+
}
|
1205 |
+
|
1206 |
+
//ref https://ethitter.com/2013/07/disable-jetpacks-photon-module-in-specific-situations/
|
1207 |
+
add_action('amp_init','ampforwp_photon_remove');
|
1208 |
+
function ampforwp_photon_remove(){
|
1209 |
+
if ( class_exists( 'Jetpack_Photon' ) ) {
|
1210 |
+
$photon_removed = remove_filter( 'image_downsize', array( Jetpack_Photon::instance(), 'filter_image_downsize' ) );
|
1211 |
+
}
|
1212 |
}
|