Version Description
(13th September 2018)
Download this release
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 0.9.97.15 |
Comparing to | |
See all releases |
Code changes from version 0.9.97.14 to 0.9.97.15
- README.md +25 -1
- accelerated-moblie-pages.php +19 -15
- components/breadcrumb/breadcrumb.php +36 -20
- components/logo/logo.php +4 -4
- components/loop/loop.php +23 -17
- feeds/instant-article-feed.php +36 -21
- images/rlp-1.png +0 -0
- images/rlp-2.png +0 -0
- images/rlp-3.png +0 -0
- includes/amp-consent/consent.php +0 -3
- includes/options/admin-config.php +145 -6
- includes/options/redux-core/assets/css/redux-fields.css +6 -0
- includes/options/redux-core/inc/fields/image_select/field_image_select.css +7 -1
- includes/thirdparty-compatibility.php +17 -10
- readme.txt +25 -1
- templates/design-manager/design-1/elements/bread-crumbs.php +35 -17
- templates/design-manager/design-1/style.php +6 -1
- templates/design-manager/design-2/elements/bread-crumbs.php +34 -17
- templates/design-manager/design-2/style.php +6 -1
- templates/design-manager/design-3/elements/bread-crumbs.php +34 -17
- templates/design-manager/design-3/style.php +6 -1
- templates/design-manager/swift/functions.php +129 -36
- templates/design-manager/swift/single.php +47 -128
- templates/design-manager/swift/style.php +93 -12
- templates/features.php +174 -66
- templates/instant-articles/instant-article.php +76 -20
README.md
CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.9.8
|
7 |
-
Stable tag: 0.9.97.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -183,6 +183,30 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
183 |
|
184 |
== Changelog ==
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
= 0.9.97.14 (4th September 2018) =
|
187 |
* Added: Adobe Analytics Support #887
|
188 |
* Fixed: Same Icons loading for some extensions #2172
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.9.8
|
7 |
+
Stable tag: 0.9.97.15
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
183 |
|
184 |
== Changelog ==
|
185 |
|
186 |
+
= 0.9.97.15 (13th September 2018) =
|
187 |
+
* Fixed: Pagination is not working on date archive #2289
|
188 |
+
* Added: Options to show Social Icons in different places in Swift #1722
|
189 |
+
* Fixed: Localization string for "% days ago" not working for non-Latin languages #1491
|
190 |
+
* Added: Social Share by Supsystic Compatibility #1509
|
191 |
+
* Fixed: Duplicate h1 tags in Design One #1522
|
192 |
+
* Added: 3 Appearance option for Related Posts in Swift theme #1545
|
193 |
+
* Fixed: RTL not working with Footer properly #1655
|
194 |
+
* Fixed: Proper implementation of the property of all in one SEO pro to avoid fatal error #2500
|
195 |
+
* Fixed: Notice: Undefined index: extension in thirdparty-compatibility.php on line 401 - 406 #2496
|
196 |
+
* Fixed: Wrong url in Non-Amp Version link on blog posts page and category archives #2424
|
197 |
+
* Fixed: The Consent.php path is getting index in Webmaster tool #2518
|
198 |
+
* Added: Option to add custom things in Instant Articles #1089
|
199 |
+
* Added: Show/hide Instant Article on specific posts #1297
|
200 |
+
* Added: Facebook Instant Articles (FBIA) Crawler Ingestion (ia:markup_url) tag #1474
|
201 |
+
* Added: Facebook Instant Articles Meta Tag #1486
|
202 |
+
* Added: Related posts for instant articles #1634
|
203 |
+
* Added: Option to remove Author info from Instant Articles #1483
|
204 |
+
* Added: Facebook Instant Articles in each Catagory #1524
|
205 |
+
* Added: Custom Facebook Instant Articles Ad option #1475
|
206 |
+
* Fixed: Pagination not working after changing the pagination base #1485
|
207 |
+
* Added: Breadcrumb with tag #1305
|
208 |
+
* Fixed: Enabled WordPress Comments by default #1501
|
209 |
+
|
210 |
= 0.9.97.14 (4th September 2018) =
|
211 |
* Added: Adobe Analytics Support #887
|
212 |
* Fixed: Same Icons loading for some extensions #2172
|
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.97.
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
@@ -19,7 +19,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
|
|
19 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
20 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
21 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
22 |
-
define('AMPFORWP_VERSION','0.9.97.
|
23 |
// any changes to AMP_QUERY_VAR should be refelected here
|
24 |
function ampforwp_generate_endpoint(){
|
25 |
$ampforwp_slug = '';
|
@@ -81,7 +81,7 @@ function ampforwp_get_the_page_id_blog_page(){
|
|
81 |
|
82 |
// Add Custom Rewrite Rule to make sure pagination & redirection is working correctly
|
83 |
function ampforwp_add_custom_rewrite_rules() {
|
84 |
-
global $redux_builder_amp;
|
85 |
// For Homepage
|
86 |
add_rewrite_rule(
|
87 |
'amp/?$',
|
@@ -90,7 +90,7 @@ function ampforwp_add_custom_rewrite_rules() {
|
|
90 |
);
|
91 |
// For Homepage with Pagination
|
92 |
add_rewrite_rule(
|
93 |
-
'amp/
|
94 |
'index.php?amp=1&paged=$matches[1]',
|
95 |
'top'
|
96 |
);
|
@@ -98,13 +98,13 @@ function ampforwp_add_custom_rewrite_rules() {
|
|
98 |
// For /Blog page with Pagination
|
99 |
if( ampforwp_name_blog_page() ) {
|
100 |
add_rewrite_rule(
|
101 |
-
ampforwp_name_blog_page(). '/amp/
|
102 |
'index.php?amp=1&paged=$matches[1]&page_id=' .ampforwp_get_the_page_id_blog_page(),
|
103 |
'top'
|
104 |
);
|
105 |
// Pagination to work with Extensions like.hml
|
106 |
add_rewrite_rule(
|
107 |
-
ampforwp_name_blog_page(). '(.+?)/amp/
|
108 |
'index.php?amp=1&paged=$matches[2]&page_id=' .ampforwp_get_the_page_id_blog_page(),
|
109 |
'top'
|
110 |
);
|
@@ -117,7 +117,7 @@ function ampforwp_add_custom_rewrite_rules() {
|
|
117 |
'top'
|
118 |
);
|
119 |
add_rewrite_rule(
|
120 |
-
'author\/([^/]+)\/amp\/
|
121 |
'index.php?amp=1&author_name=$matches[1]&paged=$matches[2]',
|
122 |
'top'
|
123 |
);
|
@@ -137,7 +137,7 @@ function ampforwp_add_custom_rewrite_rules() {
|
|
137 |
);
|
138 |
// For category pages with Pagination
|
139 |
add_rewrite_rule(
|
140 |
-
$rewrite_category.'/(.+?)\/amp\/
|
141 |
'index.php?amp=1&category_name=$matches[1]&paged=$matches[2]',
|
142 |
'top'
|
143 |
);
|
@@ -148,7 +148,7 @@ function ampforwp_add_custom_rewrite_rules() {
|
|
148 |
$permalink_structure = preg_replace('/\//', '', $permalink_structure);
|
149 |
if ( $permalink_structure ) {
|
150 |
add_rewrite_rule(
|
151 |
-
$permalink_structure.'\/'.$rewrite_category.'\/(.+?)\/amp\/
|
152 |
'index.php?amp=1&category_name=$matches[1]&paged=$matches[2]',
|
153 |
'top'
|
154 |
);
|
@@ -168,19 +168,24 @@ function ampforwp_add_custom_rewrite_rules() {
|
|
168 |
);
|
169 |
// For tag pages with Pagination
|
170 |
add_rewrite_rule(
|
171 |
-
$rewrite_tag.'\/(.+?)\/amp\/
|
172 |
'index.php?amp=1&tag=$matches[1]&paged=$matches[2]',
|
173 |
'top'
|
174 |
);
|
175 |
// For tag pages with Pagination (Custom Permalink Structure)
|
176 |
if ( $permalink_structure ) {
|
177 |
add_rewrite_rule(
|
178 |
-
$permalink_structure.'\/'.$rewrite_tag.'\/(.+?)\/amp\/
|
179 |
'index.php?amp=1&tag=$matches[1]&paged=$matches[2]',
|
180 |
'top'
|
181 |
);
|
182 |
}
|
183 |
-
|
|
|
|
|
|
|
|
|
|
|
184 |
//Rewrite rule for custom Taxonomies
|
185 |
$args = array(
|
186 |
'public' => true,
|
@@ -190,7 +195,6 @@ function ampforwp_add_custom_rewrite_rules() {
|
|
190 |
$operator = 'and'; // 'and' or 'or'
|
191 |
$taxonomies = get_taxonomies( $args, $output, $operator );
|
192 |
|
193 |
-
|
194 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
195 |
if(!is_plugin_active('amp-woocommerce-pro/amp-woocommerce.php' )) {
|
196 |
if( class_exists( 'WooCommerce' ) ) {
|
@@ -213,7 +217,7 @@ function ampforwp_add_custom_rewrite_rules() {
|
|
213 |
);
|
214 |
// For Custom Taxonomies with pages
|
215 |
add_rewrite_rule(
|
216 |
-
$taxonomy.'\/(.+?)\/amp\/
|
217 |
'index.php?amp&'.$taxonomy.'=$matches[1]&paged=$matches[2]',
|
218 |
'top'
|
219 |
);
|
@@ -221,7 +225,7 @@ function ampforwp_add_custom_rewrite_rules() {
|
|
221 |
}
|
222 |
}
|
223 |
}
|
224 |
-
add_action( 'init', 'ampforwp_add_custom_rewrite_rules' );
|
225 |
// add re-write rule for Products
|
226 |
add_action( 'init', 'ampforwp_custom_rewrite_rules_for_product_category' );
|
227 |
if ( ! function_exists('ampforwp_custom_rewrite_rules_for_product_category') ) {
|
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.97.15
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
19 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
20 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
21 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
22 |
+
define('AMPFORWP_VERSION','0.9.97.15');
|
23 |
// any changes to AMP_QUERY_VAR should be refelected here
|
24 |
function ampforwp_generate_endpoint(){
|
25 |
$ampforwp_slug = '';
|
81 |
|
82 |
// Add Custom Rewrite Rule to make sure pagination & redirection is working correctly
|
83 |
function ampforwp_add_custom_rewrite_rules() {
|
84 |
+
global $redux_builder_amp, $wp_rewrite;
|
85 |
// For Homepage
|
86 |
add_rewrite_rule(
|
87 |
'amp/?$',
|
90 |
);
|
91 |
// For Homepage with Pagination
|
92 |
add_rewrite_rule(
|
93 |
+
'amp/'.$wp_rewrite->pagination_base.'/([0-9]{1,})/?$',
|
94 |
'index.php?amp=1&paged=$matches[1]',
|
95 |
'top'
|
96 |
);
|
98 |
// For /Blog page with Pagination
|
99 |
if( ampforwp_name_blog_page() ) {
|
100 |
add_rewrite_rule(
|
101 |
+
ampforwp_name_blog_page(). '/amp/'.$wp_rewrite->pagination_base.'/([0-9]{1,})/?$',
|
102 |
'index.php?amp=1&paged=$matches[1]&page_id=' .ampforwp_get_the_page_id_blog_page(),
|
103 |
'top'
|
104 |
);
|
105 |
// Pagination to work with Extensions like.hml
|
106 |
add_rewrite_rule(
|
107 |
+
ampforwp_name_blog_page(). '(.+?)/amp/'.$wp_rewrite->pagination_base.'/([0-9]{1,})/?$',
|
108 |
'index.php?amp=1&paged=$matches[2]&page_id=' .ampforwp_get_the_page_id_blog_page(),
|
109 |
'top'
|
110 |
);
|
117 |
'top'
|
118 |
);
|
119 |
add_rewrite_rule(
|
120 |
+
'author\/([^/]+)\/amp\/'.$wp_rewrite->pagination_base.'\/?([0-9]{1,})\/?$',
|
121 |
'index.php?amp=1&author_name=$matches[1]&paged=$matches[2]',
|
122 |
'top'
|
123 |
);
|
137 |
);
|
138 |
// For category pages with Pagination
|
139 |
add_rewrite_rule(
|
140 |
+
$rewrite_category.'/(.+?)\/amp\/'.$wp_rewrite->pagination_base.'\/?([0-9]{1,})\/?$',
|
141 |
'index.php?amp=1&category_name=$matches[1]&paged=$matches[2]',
|
142 |
'top'
|
143 |
);
|
148 |
$permalink_structure = preg_replace('/\//', '', $permalink_structure);
|
149 |
if ( $permalink_structure ) {
|
150 |
add_rewrite_rule(
|
151 |
+
$permalink_structure.'\/'.$rewrite_category.'\/(.+?)\/amp\/'.$wp_rewrite->pagination_base.'\/?([0-9]{1,})\/?$',
|
152 |
'index.php?amp=1&category_name=$matches[1]&paged=$matches[2]',
|
153 |
'top'
|
154 |
);
|
168 |
);
|
169 |
// For tag pages with Pagination
|
170 |
add_rewrite_rule(
|
171 |
+
$rewrite_tag.'\/(.+?)\/amp\/'.$wp_rewrite->pagination_base.'\/?([0-9]{1,})\/?$',
|
172 |
'index.php?amp=1&tag=$matches[1]&paged=$matches[2]',
|
173 |
'top'
|
174 |
);
|
175 |
// For tag pages with Pagination (Custom Permalink Structure)
|
176 |
if ( $permalink_structure ) {
|
177 |
add_rewrite_rule(
|
178 |
+
$permalink_structure.'\/'.$rewrite_tag.'\/(.+?)\/amp\/'.$wp_rewrite->pagination_base.'\/?([0-9]{1,})\/?$',
|
179 |
'index.php?amp=1&tag=$matches[1]&paged=$matches[2]',
|
180 |
'top'
|
181 |
);
|
182 |
}
|
183 |
+
// Rewrite rule for date archive with pagination #2289
|
184 |
+
add_rewrite_rule(
|
185 |
+
'([0-9]{4})/([0-9]{1,2})/amp/'.$wp_rewrite->pagination_base.'/?([0-9]{1,})/?$',
|
186 |
+
'index.php?year=$matches[1]&monthnum=$matches[2]&=1&paged=$matches[3]',
|
187 |
+
'top'
|
188 |
+
);
|
189 |
//Rewrite rule for custom Taxonomies
|
190 |
$args = array(
|
191 |
'public' => true,
|
195 |
$operator = 'and'; // 'and' or 'or'
|
196 |
$taxonomies = get_taxonomies( $args, $output, $operator );
|
197 |
|
|
|
198 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
199 |
if(!is_plugin_active('amp-woocommerce-pro/amp-woocommerce.php' )) {
|
200 |
if( class_exists( 'WooCommerce' ) ) {
|
217 |
);
|
218 |
// For Custom Taxonomies with pages
|
219 |
add_rewrite_rule(
|
220 |
+
$taxonomy.'\/(.+?)\/amp\/'.$wp_rewrite->pagination_base.'\/?([0-9]{1,})\/?$',
|
221 |
'index.php?amp&'.$taxonomy.'=$matches[1]&paged=$matches[2]',
|
222 |
'top'
|
223 |
);
|
225 |
}
|
226 |
}
|
227 |
}
|
228 |
+
add_action( 'init', 'ampforwp_add_custom_rewrite_rules', 25 );
|
229 |
// add re-write rule for Products
|
230 |
add_action( 'init', 'ampforwp_custom_rewrite_rules_for_product_category' );
|
231 |
if ( ! function_exists('ampforwp_custom_rewrite_rules_for_product_category') ) {
|
components/breadcrumb/breadcrumb.php
CHANGED
@@ -77,29 +77,45 @@
|
|
77 |
echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><span class="bread-cat bread-custom-post-type-' . $post_type . '">' . $post_type_object->labels->name . '</span></li>';
|
78 |
}
|
79 |
}
|
80 |
-
|
81 |
-
|
82 |
-
$
|
83 |
-
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
|
|
100 |
}
|
101 |
}
|
102 |
-
|
|
|
103 |
// If it's a custom post type within a custom taxonomy
|
104 |
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
|
105 |
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
|
77 |
echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><span class="bread-cat bread-custom-post-type-' . $post_type . '">' . $post_type_object->labels->name . '</span></li>';
|
78 |
}
|
79 |
}
|
80 |
+
/*Breadcrumb with tags Start*/
|
81 |
+
$tags_breadcrumbs = '';
|
82 |
+
if($redux_builder_amp['ampforwp-bread-crumb-type'] == 'tags'){
|
83 |
+
$post_tags = wp_get_post_tags($post->ID);
|
84 |
+
if(!empty($post_tags)){
|
85 |
+
foreach( $post_tags as $post_obj){
|
86 |
+
$tag_name = $post_obj->name;
|
87 |
+
$tag_id = $post_obj->term_id;
|
88 |
+
$tag_name = $post_obj->name;
|
89 |
+
$tag_link = get_tag_link($tag_id);
|
90 |
+
$tags_breadcrumbs .= '<li class="item-tag item-tag-' . $tag_id . ' item-tag-' . $tag_name . '"><a class="bread-tag bread-tag-' . $tag_id . ' bread-tag-' . $tag_name . '" href="' . esc_url(ampforwp_url_controller( $tag_link, $archive_non_amp )) . '" title="' . $tag_name . '">' . $tag_name . '</a></li>';
|
91 |
+
}
|
92 |
+
echo $tags_breadcrumbs;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
if($redux_builder_amp['ampforwp-bread-crumb-type'] == 'category'){
|
96 |
+
// Get post category info
|
97 |
+
$category = get_the_category();
|
98 |
+
if(!empty($category)) {
|
99 |
|
100 |
+
// Get last category post is in
|
101 |
+
$last_category = array_values($category);
|
102 |
+
$last_category = end($last_category);
|
103 |
+
$category_name = get_category($last_category);
|
104 |
+
// Get parent any categories and create array
|
105 |
+
$get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, ','),',');
|
106 |
+
$cat_parents = explode(',',$get_cat_parents);
|
107 |
+
|
108 |
+
// Loop through parent categories and store in variable $cat_display
|
109 |
+
$cat_display = '';
|
110 |
+
foreach($cat_parents as $parents) {
|
111 |
+
$cat_id = get_cat_ID( $parents);
|
112 |
+
$cat_link = get_category_link($cat_id);
|
113 |
+
$cat_display .= '<li class="item-cat item-cat-' . $cat_id . '"><a class="bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $parents. '" href="'. esc_url(ampforwp_url_controller( $cat_link, $archive_non_amp )).'" title="' . $parents . '">' . $parents . '</a></li>';
|
114 |
+
}
|
115 |
}
|
116 |
}
|
117 |
+
/*Breadcrumb with tags End*/
|
118 |
+
|
119 |
// If it's a custom post type within a custom taxonomy
|
120 |
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
|
121 |
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
|
components/logo/logo.php
CHANGED
@@ -29,10 +29,10 @@ function ampforwp_framework_get_logo(){
|
|
29 |
$alt = $logo_url = "";
|
30 |
$alt = ampforwp_default_logo('alt');
|
31 |
$logo_url = __( $redux_builder_amp['opt-media']['url'], 'accelerated-mobile-pages' );
|
32 |
-
?><a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?>><amp-img src="<?php echo esc_url( $logo_url ); ?>" width="<?php echo ampforwp_default_logo('width'); ?>" height="<?php echo ampforwp_default_logo('height'); ?>" alt="<?php echo esc_attr($alt); ?>" class="amp-logo" layout="responsive"></amp-img></a><?php } else { ?>
|
33 |
-
<
|
34 |
-
|
35 |
-
?></div>
|
36 |
<?php }
|
37 |
|
38 |
add_action('amp_post_template_css','amp_framework_logo_styles',11);
|
29 |
$alt = $logo_url = "";
|
30 |
$alt = ampforwp_default_logo('alt');
|
31 |
$logo_url = __( $redux_builder_amp['opt-media']['url'], 'accelerated-mobile-pages' );
|
32 |
+
?><a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?>><amp-img src="<?php echo esc_url( $logo_url ); ?>" width="<?php echo ampforwp_default_logo('width'); ?>" height="<?php echo ampforwp_default_logo('height'); ?>" alt="<?php echo esc_attr($alt); ?>" class="amp-logo" layout="responsive"></amp-img></a><?php } else { if(is_single()){ ?>
|
33 |
+
<h2> <?php } else{?><h1><?php }?>
|
34 |
+
<a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> ><?php bloginfo('name'); ?></a><?php if(is_single()){?></h2><?php } else{?></h1><?php }
|
35 |
+
} ?></div>
|
36 |
<?php }
|
37 |
|
38 |
add_action('amp_post_template_css','amp_framework_logo_styles',11);
|
components/loop/loop.php
CHANGED
@@ -82,27 +82,33 @@ function call_loops_standard($data=array()){
|
|
82 |
$paged = 1;
|
83 |
}
|
84 |
|
|
|
|
|
85 |
if ( is_archive() ) {
|
86 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
87 |
$qobj = get_queried_object();
|
|
|
|
|
|
|
|
|
88 |
$args = array(
|
89 |
'post_type' => $post_type,
|
90 |
'orderby' => 'date',
|
91 |
'ignore_sticky_posts' => 1,
|
92 |
'tax_query' => array(
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
'paged'
|
103 |
-
'post__not_in'
|
104 |
-
'has_password'
|
105 |
-
'post_status'=> 'publish'
|
106 |
);
|
107 |
}
|
108 |
if ( is_home() ) {
|
@@ -139,8 +145,8 @@ function call_loops_standard($data=array()){
|
|
139 |
'ignore_sticky_posts' => 1,
|
140 |
'paged' => esc_attr($paged),
|
141 |
'post__not_in' => $exclude_ids,
|
142 |
-
'has_password'
|
143 |
-
'post_status'=> 'publish'
|
144 |
);
|
145 |
}
|
146 |
if( is_single() ) {
|
@@ -153,8 +159,8 @@ function call_loops_standard($data=array()){
|
|
153 |
'ignore_sticky_posts' => 1,
|
154 |
'paged' => esc_attr($paged),
|
155 |
'post__not_in' => $exclude_ids,
|
156 |
-
'has_password'
|
157 |
-
'post_status'=> 'publish'
|
158 |
);
|
159 |
}
|
160 |
if( isset( $data['post_to_show'] ) && $data['post_to_show']>0 ){
|
82 |
$paged = 1;
|
83 |
}
|
84 |
|
85 |
+
$qobj_taxonomy = $qobj_term_id = "";
|
86 |
+
|
87 |
if ( is_archive() ) {
|
88 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
89 |
$qobj = get_queried_object();
|
90 |
+
if ( $qobj ){
|
91 |
+
$qobj_taxonomy = $qobj->taxonomy;
|
92 |
+
$qobj_term_id = $qobj->term_id;
|
93 |
+
}
|
94 |
$args = array(
|
95 |
'post_type' => $post_type,
|
96 |
'orderby' => 'date',
|
97 |
'ignore_sticky_posts' => 1,
|
98 |
'tax_query' => array(
|
99 |
+
array(
|
100 |
+
'taxonomy' => $qobj_taxonomy,
|
101 |
+
'field' => 'id',
|
102 |
+
'terms' => $qobj_term_id,
|
103 |
+
// using a slug is also possible
|
104 |
+
// 'field' => 'slug',
|
105 |
+
// 'terms' => $qobj->name
|
106 |
+
)
|
107 |
+
),
|
108 |
+
'paged' => esc_attr($paged),
|
109 |
+
'post__not_in' => $exclude_ids,
|
110 |
+
'has_password' => false ,
|
111 |
+
'post_status' => 'publish'
|
112 |
);
|
113 |
}
|
114 |
if ( is_home() ) {
|
145 |
'ignore_sticky_posts' => 1,
|
146 |
'paged' => esc_attr($paged),
|
147 |
'post__not_in' => $exclude_ids,
|
148 |
+
'has_password' => false ,
|
149 |
+
'post_status' => 'publish'
|
150 |
);
|
151 |
}
|
152 |
if( is_single() ) {
|
159 |
'ignore_sticky_posts' => 1,
|
160 |
'paged' => esc_attr($paged),
|
161 |
'post__not_in' => $exclude_ids,
|
162 |
+
'has_password' => false ,
|
163 |
+
'post_status' => 'publish'
|
164 |
);
|
165 |
}
|
166 |
if( isset( $data['post_to_show'] ) && $data['post_to_show']>0 ){
|
feeds/instant-article-feed.php
CHANGED
@@ -12,34 +12,48 @@
|
|
12 |
<description><?php bloginfo_rss("description") ?></description>
|
13 |
<lastBuildDate><?php echo mysql2date('c', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
|
14 |
<language><?php bloginfo_rss( 'language' ); ?></language>
|
15 |
-
|
16 |
<?php
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
<item>
|
38 |
<title><?php the_title_rss() ?></title>
|
39 |
<link><?php the_permalink_rss() ?></link>
|
40 |
<guid><?php the_guid(); ?></guid>
|
41 |
<pubDate><?php echo mysql2date('c', get_post_time('c', true), false); ?></pubDate>
|
42 |
-
|
|
|
|
|
43 |
<description><?php the_excerpt_rss(); ?></description>
|
44 |
<content:encoded>
|
45 |
<![CDATA[
|
@@ -52,5 +66,6 @@
|
|
52 |
</item>
|
53 |
|
54 |
<?php endwhile; ?>
|
|
|
55 |
</channel>
|
56 |
</rss>
|
12 |
<description><?php bloginfo_rss("description") ?></description>
|
13 |
<lastBuildDate><?php echo mysql2date('c', get_lastpostmodified('GMT'), false); ?></lastBuildDate>
|
14 |
<language><?php bloginfo_rss( 'language' ); ?></language>
|
|
|
15 |
<?php
|
16 |
+
global $redux_builder_amp;
|
17 |
+
$number_of_articles = $exclude_ids = '';
|
18 |
+
if( isset( $redux_builder_amp['ampforwp-fb-instant-article-posts'] ) && $redux_builder_amp['ampforwp-fb-instant-article-posts'] ){
|
19 |
+
$number_of_articles = $redux_builder_amp['ampforwp-fb-instant-article-posts'];
|
20 |
+
$number_of_articles = round( abs( floatval( $number_of_articles ) ) );
|
21 |
+
}
|
22 |
+
else{
|
23 |
+
$number_of_articles = -1;
|
24 |
+
}
|
25 |
+
$exclude_ids = get_option('ampforwp_ia_exclude_post');
|
26 |
+
$ia_args = array(
|
27 |
+
'post__not_in' => $exclude_ids,
|
28 |
+
'post_status' => 'publish',
|
29 |
+
'ignore_sticky_posts' => true,
|
30 |
+
'posts_per_page' => $number_of_articles,
|
31 |
+
);
|
32 |
+
if ( is_category() ) {
|
33 |
+
$ia_args['category__in'] = get_queried_object_id();
|
34 |
+
}
|
35 |
+
if ( is_tag() ) {
|
36 |
+
$ia_args['tag__in'] = get_queried_object_id();
|
37 |
+
}
|
38 |
+
if ( is_tax() ) {
|
39 |
+
$tax_object = get_queried_object();
|
40 |
+
$ia_args['post_type'] = get_post_type();
|
41 |
+
$ia_args['tax_query']['taxonomy'] = $tax_object->taxonomy;
|
42 |
+
$ia_args['tax_query']['field'] = 'id';
|
43 |
+
$ia_args['tax_query']['terms'] = $tax_object->term_id;
|
44 |
+
}
|
45 |
+
$ia_query = new WP_Query( $ia_args );
|
46 |
+
while( $ia_query->have_posts() ) :
|
47 |
+
$ia_query->the_post(); ?>
|
48 |
|
49 |
<item>
|
50 |
<title><?php the_title_rss() ?></title>
|
51 |
<link><?php the_permalink_rss() ?></link>
|
52 |
<guid><?php the_guid(); ?></guid>
|
53 |
<pubDate><?php echo mysql2date('c', get_post_time('c', true), false); ?></pubDate>
|
54 |
+
<?php if ( true == $redux_builder_amp['ampforwp-instant-article-author-meta'] ) { ?>
|
55 |
+
<author><?php the_author() ?></author>
|
56 |
+
<?php } ?>
|
57 |
<description><?php the_excerpt_rss(); ?></description>
|
58 |
<content:encoded>
|
59 |
<![CDATA[
|
66 |
</item>
|
67 |
|
68 |
<?php endwhile; ?>
|
69 |
+
<?php wp_reset_postdata(); ?>
|
70 |
</channel>
|
71 |
</rss>
|
images/rlp-1.png
ADDED
Binary file
|
images/rlp-2.png
ADDED
Binary file
|
images/rlp-3.png
ADDED
Binary file
|
includes/amp-consent/consent.php
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
echo '{"promptIfUnknown": true}' ;
|
3 |
-
?>
|
|
|
|
|
|
includes/options/admin-config.php
CHANGED
@@ -3035,6 +3035,7 @@ $forms_support[] = array(
|
|
3035 |
'id' => 'wordpress-comments-support',
|
3036 |
'tooltip-subtitle' => __('Enable/Disable WordPress comments using this switch.', 'accelerated-mobile-pages'),
|
3037 |
'type' => 'switch',
|
|
|
3038 |
),
|
3039 |
array(
|
3040 |
'class' => 'child_opt child_opt_arrow',
|
@@ -3230,18 +3231,23 @@ Redux::setSection( $opt_name, array(
|
|
3230 |
'title' => __('Facebook Instant Articles Feed URL', 'accelerated-mobile-pages'),
|
3231 |
'required' => array('fb-instant-article-switch', '=', 1)
|
3232 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3233 |
|
3234 |
array(
|
3235 |
-
'required' => array('fb-instant-article-switch', '=', 1),
|
3236 |
'id' => 'amp-fbia_2',
|
3237 |
'type' => 'section',
|
3238 |
-
'title' => __('
|
3239 |
'indent' => true,
|
3240 |
'layout_type' => 'accordion',
|
3241 |
'accordion-open'=> 1,
|
|
|
3242 |
),
|
3243 |
-
|
3244 |
-
|
3245 |
array(
|
3246 |
'id' => 'ampforwp-fb-instant-article-posts',
|
3247 |
'type' => 'text',
|
@@ -3251,15 +3257,35 @@ Redux::setSection( $opt_name, array(
|
|
3251 |
'required' => array('fb-instant-article-switch', '=', 1),
|
3252 |
'default' => '50'
|
3253 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3254 |
array(
|
3255 |
'id' => 'ampforwp-instant-article-author-bio',
|
3256 |
'type' => 'switch',
|
3257 |
-
'title' => __('Bio', 'accelerated-mobile-pages'),
|
3258 |
'default' => 0,
|
3259 |
'true' => 'true',
|
3260 |
'false' => 'false',
|
3261 |
'tooltip-subtitle' => __('Enable/Disable Author Bio', 'accelerated-mobile-pages'),
|
3262 |
'required' => array('fb-instant-article-switch', '=', 1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3263 |
),
|
3264 |
array(
|
3265 |
'id' => 'fb-instant-article-ads',
|
@@ -3271,13 +3297,40 @@ Redux::setSection( $opt_name, array(
|
|
3271 |
'desc' => __('Switch this on to enable advertising on Instant Article pages.', 'accelerated-mobile-pages'),
|
3272 |
'required' => array('fb-instant-article-switch', '=', 1)
|
3273 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3274 |
array(
|
3275 |
'id' => 'fb-instant-article-ad-id',
|
3276 |
'type' => 'text',
|
3277 |
'title' => __('Enter your Audience Network Placement ID', 'accelerated-mobile-pages'),
|
3278 |
'tooltip-subtitle' => __('You can find out more about this <a href="https://developers.facebook.com/docs/instant-articles/monetization/audience-network">here</a>. ', 'accelerated-mobile-pages'),
|
3279 |
'desc' => __('<a href="https://ampforwp.com/tutorials/article/how-to-enter-audience-network-placement-id-of-advertisement-in-the-instant-article/" target="_blank">Click here</a> on how to get Audience Network Placement Id.', 'accelerated-mobile-pages'),
|
3280 |
-
'required' => array('fb-instant-article-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3281 |
),
|
3282 |
array(
|
3283 |
'id' => 'fb-instant-article-ad-density-setup',
|
@@ -3308,6 +3361,37 @@ Redux::setSection( $opt_name, array(
|
|
3308 |
'tooltip-subtitle' => __('Do not enter iframe tag. Find out more about support <a href="https://developers.facebook.com/docs/instant-articles/analytics">here</a> ', 'accelerated-mobile-pages'),
|
3309 |
'required' => array('fb-instant-article-analytics', '=', 1)
|
3310 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3311 |
),
|
3312 |
)
|
3313 |
);
|
@@ -5419,6 +5503,20 @@ $single_page_options = array(
|
|
5419 |
'default' => '1',
|
5420 |
'title' => __('Breadcrumbs', 'accelerated-mobile-pages'),
|
5421 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5422 |
//Categories ON/OFF
|
5423 |
array(
|
5424 |
'id' => 'ampforwp-cats-single',
|
@@ -5515,6 +5613,34 @@ $single_page_options = array(
|
|
5515 |
'title' => __( 'Related Posts', 'accelerated-mobile-pages' ),
|
5516 |
'default' => 1,
|
5517 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5518 |
array(
|
5519 |
'id' => 'ampforwp-single-select-type-of-related',
|
5520 |
'type' => 'select',
|
@@ -6310,6 +6436,19 @@ $single_page_options = array(
|
|
6310 |
'layout_type' => 'accordion',
|
6311 |
'accordion-open'=> 1,
|
6312 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6313 |
// Facebook Like
|
6314 |
array(
|
6315 |
'id' => 'ampforwp-facebook-like-button',
|
3035 |
'id' => 'wordpress-comments-support',
|
3036 |
'tooltip-subtitle' => __('Enable/Disable WordPress comments using this switch.', 'accelerated-mobile-pages'),
|
3037 |
'type' => 'switch',
|
3038 |
+
'default' => 1,
|
3039 |
),
|
3040 |
array(
|
3041 |
'class' => 'child_opt child_opt_arrow',
|
3231 |
'title' => __('Facebook Instant Articles Feed URL', 'accelerated-mobile-pages'),
|
3232 |
'required' => array('fb-instant-article-switch', '=', 1)
|
3233 |
),
|
3234 |
+
array(
|
3235 |
+
'id' => 'fb-instant-page-id',
|
3236 |
+
'type' => 'text',
|
3237 |
+
'title' => __('Facebook Page ID', 'accelerated-mobile-pages'),
|
3238 |
+
'desc' => __('Follow <a href="https://www.facebook.com/instant_articles/signup" target="_blank">these instructions</a> to sign up to Instant Articles and get your Facebook Page ID.', 'accelerated-mobile-pages'),
|
3239 |
+
'required' => array('fb-instant-article-switch', '=', 1)
|
3240 |
+
),
|
3241 |
|
3242 |
array(
|
|
|
3243 |
'id' => 'amp-fbia_2',
|
3244 |
'type' => 'section',
|
3245 |
+
'title' => __('Facebook Instant Articles Settings', 'accelerated-mobile-pages'),
|
3246 |
'indent' => true,
|
3247 |
'layout_type' => 'accordion',
|
3248 |
'accordion-open'=> 1,
|
3249 |
+
'required' => array('fb-instant-article-switch', '=', 1),
|
3250 |
),
|
|
|
|
|
3251 |
array(
|
3252 |
'id' => 'ampforwp-fb-instant-article-posts',
|
3253 |
'type' => 'text',
|
3257 |
'required' => array('fb-instant-article-switch', '=', 1),
|
3258 |
'default' => '50'
|
3259 |
),
|
3260 |
+
array(
|
3261 |
+
'id' => 'ampforwp-instant-article-author-meta',
|
3262 |
+
'type' => 'switch',
|
3263 |
+
'title' => __('Author Meta', 'accelerated-mobile-pages'),
|
3264 |
+
'default' => 1,
|
3265 |
+
'true' => 'true',
|
3266 |
+
'false' => 'false',
|
3267 |
+
'tooltip-subtitle' => __('Enable/Disable Author Meta', 'accelerated-mobile-pages'),
|
3268 |
+
'required' => array('fb-instant-article-switch', '=', 1)
|
3269 |
+
),
|
3270 |
array(
|
3271 |
'id' => 'ampforwp-instant-article-author-bio',
|
3272 |
'type' => 'switch',
|
3273 |
+
'title' => __('Author Bio', 'accelerated-mobile-pages'),
|
3274 |
'default' => 0,
|
3275 |
'true' => 'true',
|
3276 |
'false' => 'false',
|
3277 |
'tooltip-subtitle' => __('Enable/Disable Author Bio', 'accelerated-mobile-pages'),
|
3278 |
'required' => array('fb-instant-article-switch', '=', 1)
|
3279 |
+
),
|
3280 |
+
array(
|
3281 |
+
'id' => 'ampforwp-ia-related-articles',
|
3282 |
+
'type' => 'switch',
|
3283 |
+
'title' => __('Related Articles', 'accelerated-mobile-pages'),
|
3284 |
+
'default' => 0,
|
3285 |
+
'true' => 'true',
|
3286 |
+
'false' => 'false',
|
3287 |
+
'tooltip-subtitle' => __('Show/Hide Related Articles', 'accelerated-mobile-pages'),
|
3288 |
+
'required' => array('fb-instant-article-switch', '=', 1)
|
3289 |
),
|
3290 |
array(
|
3291 |
'id' => 'fb-instant-article-ads',
|
3297 |
'desc' => __('Switch this on to enable advertising on Instant Article pages.', 'accelerated-mobile-pages'),
|
3298 |
'required' => array('fb-instant-article-switch', '=', 1)
|
3299 |
),
|
3300 |
+
array(
|
3301 |
+
'id' => 'fb-instant-article-ad-type',
|
3302 |
+
'type' => 'select',
|
3303 |
+
'title' => __('Select Advertisement Format', 'accelerated-mobile-pages'),
|
3304 |
+
'default' => '1',
|
3305 |
+
'desc' => __('Select the type of advertising on Instant Article pages you want to display.', 'accelerated-mobile-pages'),
|
3306 |
+
'options' => array(
|
3307 |
+
'1' => 'Facebook Audience Network',
|
3308 |
+
'2' => 'Custom iframe URL',
|
3309 |
+
'3' => 'Custom Embed Code'
|
3310 |
+
),
|
3311 |
+
'required' => array('fb-instant-article-ads', '=', 1)
|
3312 |
+
),
|
3313 |
array(
|
3314 |
'id' => 'fb-instant-article-ad-id',
|
3315 |
'type' => 'text',
|
3316 |
'title' => __('Enter your Audience Network Placement ID', 'accelerated-mobile-pages'),
|
3317 |
'tooltip-subtitle' => __('You can find out more about this <a href="https://developers.facebook.com/docs/instant-articles/monetization/audience-network">here</a>. ', 'accelerated-mobile-pages'),
|
3318 |
'desc' => __('<a href="https://ampforwp.com/tutorials/article/how-to-enter-audience-network-placement-id-of-advertisement-in-the-instant-article/" target="_blank">Click here</a> on how to get Audience Network Placement Id.', 'accelerated-mobile-pages'),
|
3319 |
+
'required' => array('fb-instant-article-ad-type', '=', '1')
|
3320 |
+
),
|
3321 |
+
array(
|
3322 |
+
'id' => 'fb-instant-article-custom-iframe-ad',
|
3323 |
+
'type' => 'text',
|
3324 |
+
'placeholder'=> 'https://www.adserver.com/ss',
|
3325 |
+
'title' => __('Enter your Custom iframe ad source URL'),
|
3326 |
+
'required' => array('fb-instant-article-ad-type', '=', '2')
|
3327 |
+
),
|
3328 |
+
array(
|
3329 |
+
'id' => 'fb-instant-article-custom-embed-ad',
|
3330 |
+
'type' => 'textarea',
|
3331 |
+
'placeholder'=> '',
|
3332 |
+
'title' => __('Enter your Custom Embed ad code'),
|
3333 |
+
'required' => array('fb-instant-article-ad-type', '=', '3')
|
3334 |
),
|
3335 |
array(
|
3336 |
'id' => 'fb-instant-article-ad-density-setup',
|
3361 |
'tooltip-subtitle' => __('Do not enter iframe tag. Find out more about support <a href="https://developers.facebook.com/docs/instant-articles/analytics">here</a> ', 'accelerated-mobile-pages'),
|
3362 |
'required' => array('fb-instant-article-analytics', '=', 1)
|
3363 |
),
|
3364 |
+
array(
|
3365 |
+
'id' => 'fb-instant-crawler-ingestion',
|
3366 |
+
'type' => 'switch',
|
3367 |
+
'title' => __('Crawler Ingestion', 'accelerated-mobile-pages'),
|
3368 |
+
'tooltip-subtitle' => __('Add ia:markup meta tag. Find out more about<a href="https://developers.facebook.com/docs/instant-articles/crawler-ingestion" target="_blank">here</a> ', 'accelerated-mobile-pages'),
|
3369 |
+
'required' => array('fb-instant-article-switch', '=', 1)
|
3370 |
+
),
|
3371 |
+
array(
|
3372 |
+
'id' => 'fbia-header-text-area',
|
3373 |
+
'type' => 'textarea',
|
3374 |
+
'title' => __('Custom HTML in Head Tag', 'accelerated-mobile-pages'),
|
3375 |
+
'desc' => __('Add custom HTML in Head Tag in Instant Articles Markup. Click <a href="https://developers.facebook.com/docs/instant-articles/guides/articlecreate" target="_blank">here</a> for more info on Instant Articles Markup', 'accelerated-mobile-pages'),
|
3376 |
+
'default' => '',
|
3377 |
+
'required' => array('fb-instant-article-switch', '=', 1)
|
3378 |
+
),
|
3379 |
+
array(
|
3380 |
+
'id' => 'fbia-body-text-area',
|
3381 |
+
'type' => 'textarea',
|
3382 |
+
'title' => __('Custom HTML in Body Tag', 'accelerated-mobile-pages'),
|
3383 |
+
'desc' => __('Add custom HTML in Body Tag in Instant Articles Markup. Click <a href="https://developers.facebook.com/docs/instant-articles/guides/articlecreate" target="_blank">here</a> for more info on Instant Articles Markup', 'accelerated-mobile-pages'),
|
3384 |
+
'default' => '',
|
3385 |
+
'required' => array('fb-instant-article-switch', '=', 1)
|
3386 |
+
),
|
3387 |
+
array(
|
3388 |
+
'id' => 'fbia-footer-text-area',
|
3389 |
+
'type' => 'textarea',
|
3390 |
+
'title' => __('Custom HTML in Footer Tag', 'accelerated-mobile-pages'),
|
3391 |
+
'desc' => __('Add custom HTML in Footer Tag in Instant Articles Markup. Click <a href="https://developers.facebook.com/docs/instant-articles/guides/articlecreate" target="_blank">here</a> for more info on Instant Articles Markup', 'accelerated-mobile-pages'),
|
3392 |
+
'default' => '',
|
3393 |
+
'required' => array('fb-instant-article-switch', '=', 1)
|
3394 |
+
),
|
3395 |
),
|
3396 |
)
|
3397 |
);
|
5503 |
'default' => '1',
|
5504 |
'title' => __('Breadcrumbs', 'accelerated-mobile-pages'),
|
5505 |
),
|
5506 |
+
//Breadcrumb for Tags
|
5507 |
+
array(
|
5508 |
+
'class' => 'child_opt child_opt_arrow',
|
5509 |
+
'id' => 'ampforwp-bread-crumb-type',
|
5510 |
+
'type' => 'select',
|
5511 |
+
'tooltip-subtitle' => __('Select option to enable breadcrumb with tags or category','accelerated-mobile-pages'),
|
5512 |
+
'title' => __('Select Breadcrumb Type', 'accelerated-mobile-pages'),
|
5513 |
+
'options' => array(
|
5514 |
+
'tags' => 'Tags',
|
5515 |
+
'category' => 'Category',
|
5516 |
+
),
|
5517 |
+
'default' => 'category',
|
5518 |
+
'required' => array('ampforwp-bread-crumb' , '=' , 1),
|
5519 |
+
),
|
5520 |
//Categories ON/OFF
|
5521 |
array(
|
5522 |
'id' => 'ampforwp-cats-single',
|
5613 |
'title' => __( 'Related Posts', 'accelerated-mobile-pages' ),
|
5614 |
'default' => 1,
|
5615 |
),
|
5616 |
+
array(
|
5617 |
+
'id' => 'rp_design_type',
|
5618 |
+
'title' => __('Related Post Designs', 'accelerated-mobile-pages'),
|
5619 |
+
'class' => 'child_opt child_opt_arrow',
|
5620 |
+
'type' => 'image_select',
|
5621 |
+
'options'=> array(
|
5622 |
+
'1' => array(
|
5623 |
+
'alt'=>' Single Design 1 ',
|
5624 |
+
'img' =>AMPFORWP_PLUGIN_DIR_URI.'/images/rlp-1.png'
|
5625 |
+
),
|
5626 |
+
'2' => array(
|
5627 |
+
'alt'=>' Single Design With Sidebar ',
|
5628 |
+
'img' =>AMPFORWP_PLUGIN_DIR_URI.'/images/rlp-2.png'
|
5629 |
+
),
|
5630 |
+
// '3' => array(
|
5631 |
+
// 'alt'=>' Single Design With Sidebar ',
|
5632 |
+
// 'img' =>AMPFORWP_PLUGIN_DIR_URI.'/images/rlp-3.png'
|
5633 |
+
// ),
|
5634 |
+
|
5635 |
+
),
|
5636 |
+
'default'=> '1',
|
5637 |
+
// 'max-width' => 200,
|
5638 |
+
// 'max-height'=> 60,
|
5639 |
+
'required' => array( array('amp-design-selector', '=' , '4'),
|
5640 |
+
array('ampforwp-single-related-posts-switch', '=' , '1'),
|
5641 |
+
array('single-design-type', '=' , '1')
|
5642 |
+
),
|
5643 |
+
),
|
5644 |
array(
|
5645 |
'id' => 'ampforwp-single-select-type-of-related',
|
5646 |
'type' => 'select',
|
6436 |
'layout_type' => 'accordion',
|
6437 |
'accordion-open'=> 1,
|
6438 |
),
|
6439 |
+
// Social Icons Position [Swift] #1722
|
6440 |
+
array(
|
6441 |
+
'id' => 'swift-social-position',
|
6442 |
+
'type' => 'select',
|
6443 |
+
'title' => __( 'Position', 'accelerated-mobile-pages' ),
|
6444 |
+
'options' => array(
|
6445 |
+
'default' => 'Single Sidebar (left side)',
|
6446 |
+
'above-content' => 'Above Content',
|
6447 |
+
'below-content' => 'Below Content'
|
6448 |
+
),
|
6449 |
+
'default' => 'default',
|
6450 |
+
'required' => array(array('amp-design-selector', '=', '4') )
|
6451 |
+
),
|
6452 |
// Facebook Like
|
6453 |
array(
|
6454 |
'id' => 'ampforwp-facebook-like-button',
|
includes/options/redux-core/assets/css/redux-fields.css
CHANGED
@@ -104,3 +104,9 @@
|
|
104 |
width:45% ;
|
105 |
padding:0px 15px;
|
106 |
}
|
|
|
|
|
|
|
|
|
|
|
|
104 |
width:45% ;
|
105 |
padding:0px 15px;
|
106 |
}
|
107 |
+
/*** Related Post Desings ***/
|
108 |
+
#redux_builder_amp-rp_design_type ul{
|
109 |
+
display: grid;
|
110 |
+
grid-template-columns: 1fr 1fr;
|
111 |
+
grid-gap: 30px;
|
112 |
+
}
|
includes/options/redux-core/inc/fields/image_select/field_image_select.css
CHANGED
@@ -2,4 +2,10 @@
|
|
2 |
#redux_builder_amp-menu-type .redux-image-select li, #redux_builder_amp-single-design-type .redux-image-select li{
|
3 |
width:40%;
|
4 |
padding-right:30px;
|
5 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
2 |
#redux_builder_amp-menu-type .redux-image-select li, #redux_builder_amp-single-design-type .redux-image-select li{
|
3 |
width:40%;
|
4 |
padding-right:30px;
|
5 |
+
}
|
6 |
+
/*** Related Post Desings ***/
|
7 |
+
#redux_builder_amp-rp_design_type ul{
|
8 |
+
display: grid;
|
9 |
+
grid-template-columns: 1fr 1fr 1fr;
|
10 |
+
grid-gap: 30px;
|
11 |
+
}
|
includes/thirdparty-compatibility.php
CHANGED
@@ -394,24 +394,31 @@ if(!function_exists('ampforwp_findInternalUrl')){
|
|
394 |
if(isset($redux_builder_amp['convert-internal-nonamplinks-to-amp']) && ! $redux_builder_amp['convert-internal-nonamplinks-to-amp']){
|
395 |
return $url;
|
396 |
}
|
397 |
-
$
|
398 |
-
$skip_media_extensions
|
399 |
-
$
|
400 |
-
$skip_media_extensions
|
401 |
-
|
402 |
-
|
|
|
|
|
|
|
403 |
}
|
404 |
$skip_media_extensions = apply_filters( 'ampforwp_internal_links_skip_media', $skip_media_extensions );
|
405 |
-
|
406 |
-
if(
|
407 |
-
|
|
|
|
|
408 |
}
|
409 |
if($url=='#'){ return $url; }
|
410 |
|
411 |
if(!ampforwp_isexternal($url) && ampforwp_is_amp_inURL($url)===false){
|
412 |
// Skip the URL's that have edit link to it
|
413 |
$parts = parse_url($url);
|
414 |
-
|
|
|
|
|
415 |
if ( (isset( $query['action'] ) && $query['action']) || (isset( $query['amp'] ) && $query['amp'] ) ) {
|
416 |
return $url;
|
417 |
}
|
394 |
if(isset($redux_builder_amp['convert-internal-nonamplinks-to-amp']) && ! $redux_builder_amp['convert-internal-nonamplinks-to-amp']){
|
395 |
return $url;
|
396 |
}
|
397 |
+
$get_skip_media_path = array();
|
398 |
+
$skip_media_extensions = array();
|
399 |
+
$get_skip_media_path = pathinfo($url);
|
400 |
+
$skip_media_extensions = array('jpg','jpeg','gif','png');
|
401 |
+
|
402 |
+
if ( isset( $get_skip_media_path['extension'] ) ){
|
403 |
+
if (! in_array( $get_skip_media_path['extension'], $skip_media_extensions ) ){
|
404 |
+
$skip_media_extensions[] = $get_skip_media_path['extension'];
|
405 |
+
}
|
406 |
}
|
407 |
$skip_media_extensions = apply_filters( 'ampforwp_internal_links_skip_media', $skip_media_extensions );
|
408 |
+
|
409 |
+
if ( isset( $get_skip_media_path['extension'] ) ){
|
410 |
+
if( in_array( $get_skip_media_path['extension'], $skip_media_extensions ) ) {
|
411 |
+
return $url;
|
412 |
+
}
|
413 |
}
|
414 |
if($url=='#'){ return $url; }
|
415 |
|
416 |
if(!ampforwp_isexternal($url) && ampforwp_is_amp_inURL($url)===false){
|
417 |
// Skip the URL's that have edit link to it
|
418 |
$parts = parse_url($url);
|
419 |
+
if ( isset($parts['query']) && $parts['query']) {
|
420 |
+
parse_str($parts['query'], $query);
|
421 |
+
}
|
422 |
if ( (isset( $query['action'] ) && $query['action']) || (isset( $query['amp'] ) && $query['amp'] ) ) {
|
423 |
return $url;
|
424 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.9.8
|
7 |
-
Stable tag: 0.9.97.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -183,6 +183,30 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
183 |
|
184 |
== Changelog ==
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
= 0.9.97.14 (4th September 2018) =
|
187 |
* Added: Adobe Analytics Support #887
|
188 |
* Fixed: Same Icons loading for some extensions #2172
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.9.8
|
7 |
+
Stable tag: 0.9.97.15
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
183 |
|
184 |
== Changelog ==
|
185 |
|
186 |
+
= 0.9.97.15 (13th September 2018) =
|
187 |
+
* Fixed: Pagination is not working on date archive #2289
|
188 |
+
* Added: Options to show Social Icons in different places in Swift #1722
|
189 |
+
* Fixed: Localization string for "% days ago" not working for non-Latin languages #1491
|
190 |
+
* Added: Social Share by Supsystic Compatibility #1509
|
191 |
+
* Fixed: Duplicate h1 tags in Design One #1522
|
192 |
+
* Added: 3 Appearance option for Related Posts in Swift theme #1545
|
193 |
+
* Fixed: RTL not working with Footer properly #1655
|
194 |
+
* Fixed: Proper implementation of the property of all in one SEO pro to avoid fatal error #2500
|
195 |
+
* Fixed: Notice: Undefined index: extension in thirdparty-compatibility.php on line 401 - 406 #2496
|
196 |
+
* Fixed: Wrong url in Non-Amp Version link on blog posts page and category archives #2424
|
197 |
+
* Fixed: The Consent.php path is getting index in Webmaster tool #2518
|
198 |
+
* Added: Option to add custom things in Instant Articles #1089
|
199 |
+
* Added: Show/hide Instant Article on specific posts #1297
|
200 |
+
* Added: Facebook Instant Articles (FBIA) Crawler Ingestion (ia:markup_url) tag #1474
|
201 |
+
* Added: Facebook Instant Articles Meta Tag #1486
|
202 |
+
* Added: Related posts for instant articles #1634
|
203 |
+
* Added: Option to remove Author info from Instant Articles #1483
|
204 |
+
* Added: Facebook Instant Articles in each Catagory #1524
|
205 |
+
* Added: Custom Facebook Instant Articles Ad option #1475
|
206 |
+
* Fixed: Pagination not working after changing the pagination base #1485
|
207 |
+
* Added: Breadcrumb with tag #1305
|
208 |
+
* Fixed: Enabled WordPress Comments by default #1501
|
209 |
+
|
210 |
= 0.9.97.14 (4th September 2018) =
|
211 |
* Added: Adobe Analytics Support #887
|
212 |
* Fixed: Same Icons loading for some extensions #2172
|
templates/design-manager/design-1/elements/bread-crumbs.php
CHANGED
@@ -78,29 +78,47 @@ if ( isset($redux_builder_amp['ampforwp-bread-crumb']) && 1 == $redux_builder_am
|
|
78 |
echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><span class="bread-cat bread-custom-post-type-' . $post_type . '">' . $post_type_object->labels->name . '</span></li>';
|
79 |
}
|
80 |
}
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
// Get post category info
|
83 |
$category = get_the_category();
|
84 |
|
85 |
-
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
101 |
}
|
102 |
}
|
103 |
-
|
|
|
104 |
// If it's a custom post type within a custom taxonomy
|
105 |
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
|
106 |
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
|
78 |
echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><span class="bread-cat bread-custom-post-type-' . $post_type . '">' . $post_type_object->labels->name . '</span></li>';
|
79 |
}
|
80 |
}
|
81 |
+
/*Breadcrumb with tags Start*/
|
82 |
+
$tags_breadcrumbs = '';
|
83 |
+
if($redux_builder_amp['ampforwp-bread-crumb-type'] == 'tags'){
|
84 |
+
$post_tags = wp_get_post_tags($post->ID);
|
85 |
+
if(!empty($post_tags)){
|
86 |
+
foreach( $post_tags as $post_obj){
|
87 |
+
$tag_name = $post_obj->name;
|
88 |
+
$tag_id = $post_obj->term_id;
|
89 |
+
$tag_name = $post_obj->name;
|
90 |
+
$tag_link = get_tag_link($tag_id);
|
91 |
+
$tags_breadcrumbs .= '<li class="item-tag item-tag-' . $tag_id . ' item-tag-' . $tag_name . '"><a class="bread-tag bread-tag-' . $tag_id . ' bread-tag-' . $tag_name . '" href="' . esc_url(ampforwp_url_controller( $tag_link, $archive_non_amp )) . '" title="' . $tag_name . '">' . $tag_name . '</a></li>';
|
92 |
+
}
|
93 |
+
echo $tags_breadcrumbs;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
if($redux_builder_amp['ampforwp-bread-crumb-type'] == 'category'){
|
98 |
// Get post category info
|
99 |
$category = get_the_category();
|
100 |
|
101 |
+
if(!empty($category)) {
|
102 |
|
103 |
+
// Get last category post is in
|
104 |
+
$last_category = array_values($category);
|
105 |
+
$last_category = end($last_category);
|
106 |
+
$category_name = get_category($last_category);
|
107 |
+
// Get parent any categories and create array
|
108 |
+
$get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, ','),',');
|
109 |
+
$cat_parents = explode(',',$get_cat_parents);
|
110 |
+
|
111 |
+
// Loop through parent categories and store in variable $cat_display
|
112 |
+
$cat_display = '';
|
113 |
+
foreach($cat_parents as $parents) {
|
114 |
+
$cat_id = get_cat_ID( $parents);
|
115 |
+
$cat_link = get_category_link($cat_id);
|
116 |
+
$cat_display .= '<li class="item-cat item-cat-' . $cat_id . '"><a class="bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $parents. '" href="'. esc_url(ampforwp_url_controller( $cat_link, $archive_non_amp )).'" title="' . $parents . '">' . $parents . '</a></li>';
|
117 |
+
}
|
118 |
}
|
119 |
}
|
120 |
+
/*Breadcrumb with tags End*/
|
121 |
+
|
122 |
// If it's a custom post type within a custom taxonomy
|
123 |
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
|
124 |
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
|
templates/design-manager/design-1/style.php
CHANGED
@@ -148,7 +148,7 @@ table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, le
|
|
148 |
.amp-wp-header .ampforwp-search-nav-wrapper{ padding: 0; }
|
149 |
.ampforwp-search-nav-wrapper .searchmenu{ margin-top: 20px; }
|
150 |
.headerlogo a, [class*=icono-]{ top:0; }
|
151 |
-
.amp-logo h1{font-size: 1em; font-weight: 400; line-height: 1.75em; margin: 0;}
|
152 |
.amp-logo{display:inline-block}
|
153 |
.amp-wp-header a, .headerlogo a, [class*=icono-] {color: <?php echo sanitize_hex_color( $header_color ); ?>;text-decoration: none;}
|
154 |
@media screen and (min-width: 650px) { table {display: inline-table;} }
|
@@ -176,6 +176,11 @@ header, amp-sidebar, article, footer{ direction: rtl;}
|
|
176 |
.comment-author{float: right;}
|
177 |
.amp-ad-wrapper,.amp-wp-article amp-ad{ direction: ltr; }
|
178 |
amp-carousel{direction: ltr;} .tt-lb{float:right;margin-left:5px;}
|
|
|
|
|
|
|
|
|
|
|
179 |
<?php } ?>
|
180 |
<?php if ($redux_builder_amp['ampforwp-callnow-button']) { ?>
|
181 |
.callnow{ position: relative; top: -27px; right: 100px; }
|
148 |
.amp-wp-header .ampforwp-search-nav-wrapper{ padding: 0; }
|
149 |
.ampforwp-search-nav-wrapper .searchmenu{ margin-top: 20px; }
|
150 |
.headerlogo a, [class*=icono-]{ top:0; }
|
151 |
+
.amp-logo <?php if(is_single()){ ?> h2 <?php } else{?>h1<?php }?>{font-size: 1em; font-weight: 400; line-height: 1.75em; margin: 0;}
|
152 |
.amp-logo{display:inline-block}
|
153 |
.amp-wp-header a, .headerlogo a, [class*=icono-] {color: <?php echo sanitize_hex_color( $header_color ); ?>;text-decoration: none;}
|
154 |
@media screen and (min-width: 650px) { table {display: inline-table;} }
|
176 |
.comment-author{float: right;}
|
177 |
.amp-ad-wrapper,.amp-wp-article amp-ad{ direction: ltr; }
|
178 |
amp-carousel{direction: ltr;} .tt-lb{float:right;margin-left:5px;}
|
179 |
+
.amp-wp-content.widget-wrapper{margin:20px auto;}
|
180 |
+
.amp_widget_above_the_footer{direction:rtl;}
|
181 |
+
@media(max-width:768px){
|
182 |
+
.amp-wp-content.widget-wrapper{margin: 15px;}
|
183 |
+
}
|
184 |
<?php } ?>
|
185 |
<?php if ($redux_builder_amp['ampforwp-callnow-button']) { ?>
|
186 |
.callnow{ position: relative; top: -27px; right: 100px; }
|
templates/design-manager/design-2/elements/bread-crumbs.php
CHANGED
@@ -78,29 +78,46 @@ if ( isset($redux_builder_amp['ampforwp-bread-crumb']) && 1 == $redux_builder_am
|
|
78 |
echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><span class="bread-cat bread-custom-post-type-' . $post_type . '">' . $post_type_object->labels->name . '</span></li>';
|
79 |
}
|
80 |
}
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
// Get post category info
|
83 |
$category = get_the_category();
|
84 |
|
85 |
-
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
101 |
}
|
102 |
}
|
103 |
-
|
104 |
// If it's a custom post type within a custom taxonomy
|
105 |
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
|
106 |
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
|
78 |
echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><span class="bread-cat bread-custom-post-type-' . $post_type . '">' . $post_type_object->labels->name . '</span></li>';
|
79 |
}
|
80 |
}
|
81 |
+
/*Breadcrumb with tags Start*/
|
82 |
+
$tags_breadcrumbs = '';
|
83 |
+
if($redux_builder_amp['ampforwp-bread-crumb-type'] == 'tags'){
|
84 |
+
$post_tags = wp_get_post_tags($post->ID);
|
85 |
+
if(!empty($post_tags)){
|
86 |
+
foreach( $post_tags as $post_obj){
|
87 |
+
$tag_name = $post_obj->name;
|
88 |
+
$tag_id = $post_obj->term_id;
|
89 |
+
$tag_name = $post_obj->name;
|
90 |
+
$tag_link = get_tag_link($tag_id);
|
91 |
+
$tags_breadcrumbs .= '<li class="item-tag item-tag-' . $tag_id . ' item-tag-' . $tag_name . '"><a class="bread-tag bread-tag-' . $tag_id . ' bread-tag-' . $tag_name . '" href="' . esc_url(ampforwp_url_controller( $tag_link, $archive_non_amp )) . '" title="' . $tag_name . '">' . $tag_name . '</a></li>';
|
92 |
+
}
|
93 |
+
echo $tags_breadcrumbs;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
if($redux_builder_amp['ampforwp-bread-crumb-type'] == 'category'){
|
98 |
// Get post category info
|
99 |
$category = get_the_category();
|
100 |
|
101 |
+
if(!empty($category)) {
|
102 |
|
103 |
+
// Get last category post is in
|
104 |
+
$last_category = array_values($category);
|
105 |
+
$last_category = end($last_category);
|
106 |
+
$category_name = get_category($last_category);
|
107 |
+
// Get parent any categories and create array
|
108 |
+
$get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, ','),',');
|
109 |
+
$cat_parents = explode(',',$get_cat_parents);
|
110 |
+
|
111 |
+
// Loop through parent categories and store in variable $cat_display
|
112 |
+
$cat_display = '';
|
113 |
+
foreach($cat_parents as $parents) {
|
114 |
+
$cat_id = get_cat_ID( $parents);
|
115 |
+
$cat_link = get_category_link($cat_id);
|
116 |
+
$cat_display .= '<li class="item-cat item-cat-' . $cat_id . '"><a class="bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $parents. '" href="'. esc_url(ampforwp_url_controller( $cat_link, $archive_non_amp )).'" title="' . $parents . '">' . $parents . '</a></li>';
|
117 |
+
}
|
118 |
}
|
119 |
}
|
120 |
+
/*Breadcrumb with tags End*/
|
121 |
// If it's a custom post type within a custom taxonomy
|
122 |
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
|
123 |
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
|
templates/design-manager/design-2/style.php
CHANGED
@@ -109,7 +109,7 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
|
|
109 |
/* Header */
|
110 |
header.container{line-height: 0;}
|
111 |
#header{ background: #fff; text-align: center;padding:17px 0px 17px 0px;display: inline-block;width: 100%;position:relative}
|
112 |
-
#header h1{ text-align: center; font-size: 20px; font-weight: bold; line-height: 1; padding: 4px 3px; margin: 0; }
|
113 |
.amp-logo{left: 0;right: 0;display:inline-block}
|
114 |
.amp-logo amp-img{ margin: 15px 0px 10px 0px; }
|
115 |
.amp-logo amp-img{margin: 0 auto;}
|
@@ -286,6 +286,11 @@ main .amp-archive-heading { direction:rtl }
|
|
286 |
.amp-ad-wrapper, .amp-wp-article amp-ad{ direction: ltr; }
|
287 |
.toggle-navigationv2 ul li a { padding: 15px 8px; width: 95%;}
|
288 |
amp-carousel{direction: ltr;} .tt-lb{float:right;margin-left:5px;}
|
|
|
|
|
|
|
|
|
|
|
289 |
<?php } ?>
|
290 |
.amp-wp-tax-tag a, a, .amp-wp-author, .headerlogo a, [class*=icono-] { color: <?php echo sanitize_hex_color( $header_background_color ); ?>;; }
|
291 |
body a {color: <?php echo $redux_builder_amp['amp-opt-color-rgba-link-design2']['color'];?> }
|
109 |
/* Header */
|
110 |
header.container{line-height: 0;}
|
111 |
#header{ background: #fff; text-align: center;padding:17px 0px 17px 0px;display: inline-block;width: 100%;position:relative}
|
112 |
+
#header <?php if(is_single()){ ?> h2 <?php } else{?>h1<?php }?>{ text-align: center; font-size: 20px; font-weight: bold; line-height: 1; padding: 4px 3px; margin: 0; }
|
113 |
.amp-logo{left: 0;right: 0;display:inline-block}
|
114 |
.amp-logo amp-img{ margin: 15px 0px 10px 0px; }
|
115 |
.amp-logo amp-img{margin: 0 auto;}
|
286 |
.amp-ad-wrapper, .amp-wp-article amp-ad{ direction: ltr; }
|
287 |
.toggle-navigationv2 ul li a { padding: 15px 8px; width: 95%;}
|
288 |
amp-carousel{direction: ltr;} .tt-lb{float:right;margin-left:5px;}
|
289 |
+
.amp-wp-content.widget-wrapper{margin:20px auto;}
|
290 |
+
.amp_widget_above_the_footer{direction:rtl;}
|
291 |
+
@media(max-width:768px){
|
292 |
+
.amp-wp-content.widget-wrapper{margin: 15px;}
|
293 |
+
}
|
294 |
<?php } ?>
|
295 |
.amp-wp-tax-tag a, a, .amp-wp-author, .headerlogo a, [class*=icono-] { color: <?php echo sanitize_hex_color( $header_background_color ); ?>;; }
|
296 |
body a {color: <?php echo $redux_builder_amp['amp-opt-color-rgba-link-design2']['color'];?> }
|
templates/design-manager/design-3/elements/bread-crumbs.php
CHANGED
@@ -78,29 +78,46 @@ if ( isset($redux_builder_amp['ampforwp-bread-crumb']) && 1 == $redux_builder_am
|
|
78 |
echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><span class="bread-cat bread-custom-post-type-' . $post_type . '">' . $post_type_object->labels->name . '</span></li>';
|
79 |
}
|
80 |
}
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
// Get post category info
|
83 |
$category = get_the_category();
|
84 |
|
85 |
-
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
101 |
}
|
102 |
}
|
103 |
-
|
104 |
// If it's a custom post type within a custom taxonomy
|
105 |
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
|
106 |
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
|
78 |
echo '<li class="item-cat item-custom-post-type-' . $post_type . '"><span class="bread-cat bread-custom-post-type-' . $post_type . '">' . $post_type_object->labels->name . '</span></li>';
|
79 |
}
|
80 |
}
|
81 |
+
/*Breadcrumb with tags Start*/
|
82 |
+
$tags_breadcrumbs = '';
|
83 |
+
if($redux_builder_amp['ampforwp-bread-crumb-type'] == 'tags'){
|
84 |
+
$post_tags = wp_get_post_tags($post->ID);
|
85 |
+
if(!empty($post_tags)){
|
86 |
+
foreach( $post_tags as $post_obj){
|
87 |
+
$tag_name = $post_obj->name;
|
88 |
+
$tag_id = $post_obj->term_id;
|
89 |
+
$tag_name = $post_obj->name;
|
90 |
+
$tag_link = get_tag_link($tag_id);
|
91 |
+
$tags_breadcrumbs .= '<li class="item-tag item-tag-' . $tag_id . ' item-tag-' . $tag_name . '"><a class="bread-tag bread-tag-' . $tag_id . ' bread-tag-' . $tag_name . '" href="' . esc_url(ampforwp_url_controller( $tag_link, $archive_non_amp )) . '" title="' . $tag_name . '">' . $tag_name . '</a></li>';
|
92 |
+
}
|
93 |
+
echo $tags_breadcrumbs;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
if($redux_builder_amp['ampforwp-bread-crumb-type'] == 'category'){
|
98 |
// Get post category info
|
99 |
$category = get_the_category();
|
100 |
|
101 |
+
if(!empty($category)) {
|
102 |
|
103 |
+
// Get last category post is in
|
104 |
+
$last_category = array_values($category);
|
105 |
+
$last_category = end($last_category);
|
106 |
+
$category_name = get_category($last_category);
|
107 |
+
// Get parent any categories and create array
|
108 |
+
$get_cat_parents = rtrim(get_category_parents($last_category->term_id, false, ','),',');
|
109 |
+
$cat_parents = explode(',',$get_cat_parents);
|
110 |
+
|
111 |
+
// Loop through parent categories and store in variable $cat_display
|
112 |
+
$cat_display = '';
|
113 |
+
foreach($cat_parents as $parents) {
|
114 |
+
$cat_id = get_cat_ID( $parents);
|
115 |
+
$cat_link = get_category_link($cat_id);
|
116 |
+
$cat_display .= '<li class="item-cat item-cat-' . $cat_id . '"><a class="bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $parents. '" href="'. esc_url(ampforwp_url_controller( $cat_link, $archive_non_amp )).'" title="' . $parents . '">' . $parents . '</a></li>';
|
117 |
+
}
|
118 |
}
|
119 |
}
|
120 |
+
/*Breadcrumb with tags End*/
|
121 |
// If it's a custom post type within a custom taxonomy
|
122 |
$taxonomy_exists = taxonomy_exists($custom_taxonomy);
|
123 |
if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {
|
templates/design-manager/design-3/style.php
CHANGED
@@ -112,7 +112,7 @@ header{ padding-bottom:50px; }
|
|
112 |
header{ padding-bottom:0px; }
|
113 |
#headerwrap{ position: relative;}
|
114 |
<?php } ?>
|
115 |
-
#header h1{ text-align: center; font-size: 16px; position: relative; font-weight: bold; line-height: 50px; padding: 0; margin: 0; text-transform: uppercase }
|
116 |
main .amp-wp-content{ font-size: 18px; line-height: 29px; color:#111 }
|
117 |
.single-post main .amp-wp-article-content h1{ font-size:2em}
|
118 |
.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; }
|
@@ -386,6 +386,11 @@ amp-carousel{direction: ltr;}
|
|
386 |
@keyframes opening{ 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(-60%, 0, 0) scale(0.8); } }
|
387 |
@keyframes closing{ 0% { transform: translate3d(-60%, 0, 0) scale(0.8); } 100% { transform: translate3d(0, 0, 0) scale(1); } }
|
388 |
@keyframes closingFix{ 0% { max-height: 100vh; overflow: hidden; } 100% { max-height: none; overflow: visible; } }
|
|
|
|
|
|
|
|
|
|
|
389 |
<?php } ?>
|
390 |
|
391 |
a { color: <?php echo esc_attr($redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']) ?> }
|
112 |
header{ padding-bottom:0px; }
|
113 |
#headerwrap{ position: relative;}
|
114 |
<?php } ?>
|
115 |
+
#header <?php if(is_single()){ ?> h2 <?php } else{?>h1<?php }?>{ text-align: center; font-size: 16px; position: relative; font-weight: bold; line-height: 50px; padding: 0; margin: 0; text-transform: uppercase }
|
116 |
main .amp-wp-content{ font-size: 18px; line-height: 29px; color:#111 }
|
117 |
.single-post main .amp-wp-article-content h1{ font-size:2em}
|
118 |
.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; }
|
386 |
@keyframes opening{ 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(-60%, 0, 0) scale(0.8); } }
|
387 |
@keyframes closing{ 0% { transform: translate3d(-60%, 0, 0) scale(0.8); } 100% { transform: translate3d(0, 0, 0) scale(1); } }
|
388 |
@keyframes closingFix{ 0% { max-height: 100vh; overflow: hidden; } 100% { max-height: none; overflow: visible; } }
|
389 |
+
.amp-wp-content.widget-wrapper{margin:20px auto;}
|
390 |
+
.amp_widget_above_the_footer{direction:rtl;}
|
391 |
+
@media(max-width:768px){
|
392 |
+
.amp-wp-content.widget-wrapper{margin: 15px;}
|
393 |
+
}
|
394 |
<?php } ?>
|
395 |
|
396 |
a { color: <?php echo esc_attr($redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']) ?> }
|
templates/design-manager/swift/functions.php
CHANGED
@@ -37,43 +37,136 @@ add_amp_theme_support('AMP-post-pagination');
|
|
37 |
// Icons example
|
38 |
add_amp_icon( array( 'widgets', 'search', 'shopping-cart' ) );
|
39 |
|
|
|
40 |
function ampforwp_swift_social_icons(){
|
41 |
-
global $redux_builder_amp;
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
// Remove default sticky social from Swift
|
78 |
remove_action('amp_post_template_footer','ampforwp_sticky_social_icons');
|
79 |
remove_action('amp_post_template_css','amp_social_styles',11);
|
37 |
// Icons example
|
38 |
add_amp_icon( array( 'widgets', 'search', 'shopping-cart' ) );
|
39 |
|
40 |
+
// Swift Social Icons
|
41 |
function ampforwp_swift_social_icons(){
|
42 |
+
global $redux_builder_amp; ?>
|
43 |
+
<div class="ss-ic">
|
44 |
+
<span class="shr-txt"><?php echo ampforwp_translation($redux_builder_amp['amp-translator-share-text'], 'Share' ); ?></span>
|
45 |
+
<ul>
|
46 |
+
<?php if($redux_builder_amp['enable-single-facebook-share']){?>
|
47 |
+
<li>
|
48 |
+
<a class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>"></a>
|
49 |
+
</li>
|
50 |
+
<?php } ?>
|
51 |
+
<?php if($redux_builder_amp['enable-single-twitter-share']){?>
|
52 |
+
<li>
|
53 |
+
<a class="s_tw" target="_blank" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>&text=<?php echo esc_attr(rawurlencode(get_the_title())); ?>">
|
54 |
+
</a>
|
55 |
+
</li>
|
56 |
+
<?php } ?>
|
57 |
+
<?php if($redux_builder_amp['enable-single-gplus-share']){?>
|
58 |
+
<li>
|
59 |
+
<a class="s_gp" target="_blank" href="https://plus.google.com/share?url=<?php the_permalink(); ?>"></a>
|
60 |
+
</li>
|
61 |
+
<?php } ?>
|
62 |
+
<?php if($redux_builder_amp['enable-single-email-share']){?>
|
63 |
+
<li>
|
64 |
+
<a class="s_em" target="_blank" href="mailto:?subject=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&body=<?php the_permalink(); ?>"></a>
|
65 |
+
</li>
|
66 |
+
<?php } ?>
|
67 |
+
<?php if($redux_builder_amp['enable-single-pinterest-share']){
|
68 |
+
$image = '';
|
69 |
+
if (ampforwp_has_post_thumbnail( ) ){
|
70 |
+
$image = ampforwp_get_post_thumbnail( 'url', 'full' );
|
71 |
+
}?>
|
72 |
+
<li>
|
73 |
+
<a class="s_pt" target="_blank" href="https://pinterest.com/pin/create/button/?media=<?php echo esc_url($image); ?>&url=<?php esc_url(the_permalink()); ?>&description=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
74 |
+
</li>
|
75 |
+
<?php } ?>
|
76 |
+
<?php if($redux_builder_amp['enable-single-linkedin-share']){?>
|
77 |
+
<li>
|
78 |
+
<a class="s_lk" target="_blank" href="https://www.linkedin.com/shareArticle?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
79 |
+
</li>
|
80 |
+
<?php } ?>
|
81 |
+
<?php if($redux_builder_amp['enable-single-whatsapp-share']){?>
|
82 |
+
<li>
|
83 |
+
<a class="s_wp" target="_blank" href="whatsapp://send?text=<?php the_permalink(); ?>" data-action="share/whatsapp/share"></a>
|
84 |
+
</li>
|
85 |
+
<?php } ?>
|
86 |
+
<?php if($redux_builder_amp['enable-single-vk-share']){?>
|
87 |
+
<li>
|
88 |
+
<a class="s_vk" target="_blank" href="http://vk.com/share.php?url=<?php the_permalink(); ?>"></a>
|
89 |
+
</li>
|
90 |
+
<?php } ?>
|
91 |
+
<?php if($redux_builder_amp['enable-single-odnoklassniki-share']){?>
|
92 |
+
<li>
|
93 |
+
<a class="s_od" target="_blank" href="https://ok.ru/dk?st.cmd=addShare&st._surl=<?php the_permalink(); ?>"></a>
|
94 |
+
</li>
|
95 |
+
<?php } ?>
|
96 |
+
<?php if($redux_builder_amp['enable-single-reddit-share']){?>
|
97 |
+
<li>
|
98 |
+
<a class="s_rd" target="_blank" href="https://reddit.com/submit?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
99 |
+
</li>
|
100 |
+
<?php } ?>
|
101 |
+
<?php if($redux_builder_amp['enable-single-tumblr-share']){?>
|
102 |
+
<li>
|
103 |
+
<a class="s_tb" target="_blank" href="https://www.tumblr.com/widgets/share/tool?canonicalUrl=<?php the_permalink(); ?>"></a>
|
104 |
+
</li>
|
105 |
+
<?php } ?>
|
106 |
+
<?php if($redux_builder_amp['enable-single-telegram-share']){?>
|
107 |
+
<li>
|
108 |
+
<a class="s_tg" target="_blank" href="https://telegram.me/share/url?url=<?php the_permalink(); ?>&text=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
109 |
+
</li>
|
110 |
+
<?php } ?>
|
111 |
+
<?php if($redux_builder_amp['enable-single-digg-share']){?>
|
112 |
+
<li>
|
113 |
+
<a class="s_dg" target="_blank" href="http://digg.com/submit?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
114 |
+
</li>
|
115 |
+
<?php } ?>
|
116 |
+
<?php if($redux_builder_amp['enable-single-stumbleupon-share']){?>
|
117 |
+
<li>
|
118 |
+
<a class="s_su" target="_blank" href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
119 |
+
</li>
|
120 |
+
<?php } ?>
|
121 |
+
<?php if($redux_builder_amp['enable-single-wechat-share']){?>
|
122 |
+
<li>
|
123 |
+
<a class="s_wc" target="_blank" href="http://api.addthis.com/oexchange/0.8/forward/wechat/offer?url=<?php the_permalink(); ?>"></a>
|
124 |
+
</li>
|
125 |
+
<?php } ?>
|
126 |
+
<?php if($redux_builder_amp['enable-single-viber-share']){?>
|
127 |
+
<li>
|
128 |
+
<a class="s_vb" target="_blank" href="viber://forward?text=<?php the_permalink(); ?>"></a>
|
129 |
+
</li>
|
130 |
+
<?php } ?>
|
131 |
+
<?php if ( isset($redux_builder_amp['enable-single-yummly-share']) && $redux_builder_amp['enable-single-yummly-share']){?>
|
132 |
+
<li>
|
133 |
+
<a class="s_ym" target="_blank" href="http://www.yummly.com/urb/verify?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&yumtype=button"></a>
|
134 |
+
</li>
|
135 |
+
<?php } ?>
|
136 |
+
<?php if ( isset($redux_builder_amp['enable-single-hatena-bookmarks']) && $redux_builder_amp['enable-single-hatena-bookmarks']){?>
|
137 |
+
<li>
|
138 |
+
<a class="s_hb" target="_blank" href="http://b.hatena.ne.jp/entry/<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
139 |
+
</li>
|
140 |
+
<?php } ?>
|
141 |
+
<?php if ( isset($redux_builder_amp['enable-single-pocket-share']) && $redux_builder_amp['enable-single-pocket-share']){?>
|
142 |
+
<li>
|
143 |
+
<a class="s_pk" target="_blank" href="https://getpocket.com/save?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
144 |
+
</li>
|
145 |
+
<?php } ?>
|
146 |
+
<?php if($redux_builder_amp['ampforwp-facebook-like-button']){?>
|
147 |
+
<li>
|
148 |
+
<?php if( ampforwp_is_non_amp() && isset($redux_builder_amp['ampforwp-amp-convert-to-wp']) && $redux_builder_amp['ampforwp-amp-convert-to-wp']) { ?>
|
149 |
+
<div class="fb-like"
|
150 |
+
data-href="<?php echo esc_url(get_the_permalink());?>"
|
151 |
+
data-layout="button_count"
|
152 |
+
data-action="like"
|
153 |
+
data-show-faces="true">
|
154 |
+
</div>
|
155 |
+
<?php }
|
156 |
+
else { ?>
|
157 |
+
<amp-facebook-like width=90 height=28
|
158 |
+
layout="fixed"
|
159 |
+
data-size="large"
|
160 |
+
data-layout="button_count"
|
161 |
+
data-href="<?php echo esc_url(get_the_permalink());?>">
|
162 |
+
</amp-facebook-like>
|
163 |
+
<?php } ?>
|
164 |
+
</li>
|
165 |
+
<?php } ?>
|
166 |
+
|
167 |
+
</ul>
|
168 |
+
</div>
|
169 |
+
<?php }
|
170 |
// Remove default sticky social from Swift
|
171 |
remove_action('amp_post_template_footer','ampforwp_sticky_social_icons');
|
172 |
remove_action('amp_post_template_css','amp_social_styles',11);
|
templates/design-manager/swift/single.php
CHANGED
@@ -25,9 +25,15 @@
|
|
25 |
<div class="cntr">
|
26 |
<div class="sp-rl">
|
27 |
<div class="sp-rt">
|
|
|
|
|
|
|
28 |
<div class="cntn-wrp artl-cnt">
|
29 |
<?php amp_content(); ?>
|
30 |
</div>
|
|
|
|
|
|
|
31 |
<?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>
|
32 |
<?php if( $redux_builder_amp['amp-author-description'] ) { ?>
|
33 |
<?php amp_author_box(
|
@@ -46,132 +52,9 @@
|
|
46 |
</div>
|
47 |
<?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>
|
48 |
<div class="sp-lt">
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
<?php if($redux_builder_amp['enable-single-facebook-share']){?>
|
53 |
-
<li>
|
54 |
-
<a title="facebook share" class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>"></a>
|
55 |
-
</li>
|
56 |
-
<?php } ?>
|
57 |
-
<?php if($redux_builder_amp['enable-single-twitter-share']){?>
|
58 |
-
<li>
|
59 |
-
<a title="twitter share" class="s_tw" target="_blank" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>&text=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>">
|
60 |
-
</a>
|
61 |
-
</li>
|
62 |
-
<?php } ?>
|
63 |
-
<?php if($redux_builder_amp['enable-single-gplus-share']){?>
|
64 |
-
<li>
|
65 |
-
<a title="google plus share" class="s_gp" target="_blank" href="https://plus.google.com/share?url=<?php the_permalink(); ?>"></a>
|
66 |
-
</li>
|
67 |
-
<?php } ?>
|
68 |
-
<?php if($redux_builder_amp['enable-single-email-share']){?>
|
69 |
-
<li>
|
70 |
-
<a title="mail" class="s_em" target="_blank" href="mailto:?subject=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&body=<?php the_permalink(); ?>"></a>
|
71 |
-
</li>
|
72 |
-
<?php } ?>
|
73 |
-
<?php if($redux_builder_amp['enable-single-pinterest-share']){
|
74 |
-
$image = '';
|
75 |
-
if (ampforwp_has_post_thumbnail( ) ){
|
76 |
-
$image = ampforwp_get_post_thumbnail( 'url', 'full' );
|
77 |
-
}?>
|
78 |
-
<li>
|
79 |
-
<a title="pinterest share" class="s_pt" target="_blank" href="https://pinterest.com/pin/create/button/?media=<?php echo esc_url($image); ?>&url=<?php esc_url(the_permalink()); ?>&description=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
80 |
-
</li>
|
81 |
-
<?php } ?>
|
82 |
-
<?php if($redux_builder_amp['enable-single-linkedin-share']){?>
|
83 |
-
<li>
|
84 |
-
<a title="linkedin share" class="s_lk" target="_blank" href="https://www.linkedin.com/shareArticle?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
85 |
-
</li>
|
86 |
-
<?php } ?>
|
87 |
-
<?php if($redux_builder_amp['enable-single-whatsapp-share']){?>
|
88 |
-
<li>
|
89 |
-
<a title="whatsapp share" class="s_wp" target="_blank" href="whatsapp://send?text=<?php the_permalink(); ?>" data-action="share/whatsapp/share"></a>
|
90 |
-
</li>
|
91 |
-
<?php } ?>
|
92 |
-
<?php if($redux_builder_amp['enable-single-vk-share']){?>
|
93 |
-
<li>
|
94 |
-
<a title="vkontakte share" class="s_vk" target="_blank" href="http://vk.com/share.php?url=<?php the_permalink(); ?>"></a>
|
95 |
-
</li>
|
96 |
-
<?php } ?>
|
97 |
-
<?php if($redux_builder_amp['enable-single-odnoklassniki-share']){?>
|
98 |
-
<li>
|
99 |
-
<a title="odnoklassniki share" class="s_od" target="_blank" href="https://ok.ru/dk?st.cmd=addShare&st._surl=<?php the_permalink(); ?>"></a>
|
100 |
-
</li>
|
101 |
-
<?php } ?>
|
102 |
-
<?php if($redux_builder_amp['enable-single-reddit-share']){?>
|
103 |
-
<li>
|
104 |
-
<a title="reddit share" class="s_rd" target="_blank" href="https://reddit.com/submit?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
105 |
-
</li>
|
106 |
-
<?php } ?>
|
107 |
-
<?php if($redux_builder_amp['enable-single-tumblr-share']){?>
|
108 |
-
<li>
|
109 |
-
<a title="tumblr share" class="s_tb" target="_blank" href="https://www.tumblr.com/widgets/share/tool?canonicalUrl=<?php the_permalink(); ?>"></a>
|
110 |
-
</li>
|
111 |
-
<?php } ?>
|
112 |
-
<?php if($redux_builder_amp['enable-single-telegram-share']){?>
|
113 |
-
<li>
|
114 |
-
<a title="telegram share" class="s_tg" target="_blank" href="https://telegram.me/share/url?url=<?php the_permalink(); ?>&text=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
115 |
-
</li>
|
116 |
-
<?php } ?>
|
117 |
-
<?php if($redux_builder_amp['enable-single-digg-share']){?>
|
118 |
-
<li>
|
119 |
-
<a title="digg share" class="s_dg" target="_blank" href="http://digg.com/submit?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
120 |
-
</li>
|
121 |
-
<?php } ?>
|
122 |
-
<?php if($redux_builder_amp['enable-single-stumbleupon-share']){?>
|
123 |
-
<li>
|
124 |
-
<a title="stumbleupon share" class="s_su" target="_blank" href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
125 |
-
</li>
|
126 |
-
<?php } ?>
|
127 |
-
<?php if($redux_builder_amp['enable-single-wechat-share']){?>
|
128 |
-
<li>
|
129 |
-
<a title="wechat share" class="s_wc" target="_blank" href="http://api.addthis.com/oexchange/0.8/forward/wechat/offer?url=<?php the_permalink(); ?>"></a>
|
130 |
-
</li>
|
131 |
-
<?php } ?>
|
132 |
-
<?php if($redux_builder_amp['enable-single-viber-share']){?>
|
133 |
-
<li>
|
134 |
-
<a title="viber share" class="s_vb" target="_blank" href="viber://forward?text=<?php the_permalink(); ?>"></a>
|
135 |
-
</li>
|
136 |
-
<?php } ?>
|
137 |
-
<?php if ( isset($redux_builder_amp['enable-single-yummly-share']) && $redux_builder_amp['enable-single-yummly-share']){?>
|
138 |
-
<li>
|
139 |
-
<a title="yummly share" class="s_ym" target="_blank" href="http://www.yummly.com/urb/verify?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>&yumtype=button"></a>
|
140 |
-
</li>
|
141 |
-
<?php } ?>
|
142 |
-
<?php if ( isset($redux_builder_amp['enable-single-hatena-bookmarks']) && $redux_builder_amp['enable-single-hatena-bookmarks']){?>
|
143 |
-
<li>
|
144 |
-
<a title="hatena share" class="s_hb" target="_blank" href="http://b.hatena.ne.jp/entry/<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
145 |
-
</li>
|
146 |
-
<?php } ?>
|
147 |
-
<?php if ( isset($redux_builder_amp['enable-single-pocket-share']) && $redux_builder_amp['enable-single-pocket-share']){?>
|
148 |
-
<li>
|
149 |
-
<a title="pocket share" class="s_pk" target="_blank" href="https://getpocket.com/save?url=<?php the_permalink(); ?>&title=<?php echo esc_attr(htmlspecialchars(get_the_title())); ?>"></a>
|
150 |
-
</li>
|
151 |
-
<?php } ?>
|
152 |
-
<?php if($redux_builder_amp['ampforwp-facebook-like-button']){?>
|
153 |
-
<li>
|
154 |
-
<?php if( ampforwp_is_non_amp() && isset($redux_builder_amp['ampforwp-amp-convert-to-wp']) && $redux_builder_amp['ampforwp-amp-convert-to-wp']) { ?>
|
155 |
-
<div class="fb-like"
|
156 |
-
data-href="<?php echo esc_url(get_the_permalink());?>"
|
157 |
-
data-layout="button_count"
|
158 |
-
data-action="like"
|
159 |
-
data-show-faces="true">
|
160 |
-
</div>
|
161 |
-
<?php }
|
162 |
-
else { ?>
|
163 |
-
<amp-facebook-like width=90 height=28
|
164 |
-
layout="fixed"
|
165 |
-
data-size="large"
|
166 |
-
data-layout="button_count"
|
167 |
-
data-href="<?php echo esc_url(get_the_permalink());?>">
|
168 |
-
</amp-facebook-like>
|
169 |
-
<?php } ?>
|
170 |
-
</li>
|
171 |
-
<?php } ?>
|
172 |
-
|
173 |
-
</ul>
|
174 |
-
</div>
|
175 |
<?php if( isset($redux_builder_amp['amp-author-name']) && $redux_builder_amp['amp-author-name'] ) { ?>
|
176 |
<div class="sp-athr">
|
177 |
<span class="athr-tx"><?php echo ampforwp_translation($redux_builder_amp['amp-translator-published-by'], 'Published by' ); ?></span>
|
@@ -182,11 +65,13 @@
|
|
182 |
<div class="tags">
|
183 |
<?php amp_tags_list();?>
|
184 |
</div>
|
185 |
-
<?php }
|
|
|
186 |
if( true == $redux_builder_amp['swift-date'] ) { ?>
|
187 |
<div class="post-date">
|
188 |
<?php amp_date(); ?><?php edit_post_link(); ?>
|
189 |
</div>
|
|
|
190 |
<?php }
|
191 |
if ( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] ) {
|
192 |
$my_query = ampforwp_related_post_loop_query();
|
@@ -220,7 +105,7 @@
|
|
220 |
} ?>
|
221 |
</ul>
|
222 |
</div>
|
223 |
-
<?php wp_reset_postdata(); } ?>
|
224 |
</div>
|
225 |
<?php } ?>
|
226 |
</div>
|
@@ -229,6 +114,40 @@
|
|
229 |
<?php }
|
230 |
do_action("ampforwp_single_design_type_handle");
|
231 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
<?php if($redux_builder_amp['single-design-type'] == '1' && isset($redux_builder_amp['ampforwp-swift-recent-posts']) && $redux_builder_amp['ampforwp-swift-recent-posts']=='1' && !checkAMPforPageBuilderStatus(get_the_ID()) ) { ?>
|
233 |
<div class="r-pf">
|
234 |
<div class="cntr">
|
25 |
<div class="cntr">
|
26 |
<div class="sp-rl">
|
27 |
<div class="sp-rt">
|
28 |
+
<?php if (isset($redux_builder_amp['swift-social-position']) && 'above-content' == $redux_builder_amp['swift-social-position']){
|
29 |
+
ampforwp_swift_social_icons();
|
30 |
+
} ?>
|
31 |
<div class="cntn-wrp artl-cnt">
|
32 |
<?php amp_content(); ?>
|
33 |
</div>
|
34 |
+
<?php if (isset($redux_builder_amp['swift-social-position']) && 'below-content' == $redux_builder_amp['swift-social-position']){
|
35 |
+
ampforwp_swift_social_icons();
|
36 |
+
} ?>
|
37 |
<?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>
|
38 |
<?php if( $redux_builder_amp['amp-author-description'] ) { ?>
|
39 |
<?php amp_author_box(
|
52 |
</div>
|
53 |
<?php if(!checkAMPforPageBuilderStatus(get_the_ID())){ ?>
|
54 |
<div class="sp-lt">
|
55 |
+
<?php if (isset($redux_builder_amp['swift-social-position']) && 'default' == $redux_builder_amp['swift-social-position']){
|
56 |
+
ampforwp_swift_social_icons();
|
57 |
+
} ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
<?php if( isset($redux_builder_amp['amp-author-name']) && $redux_builder_amp['amp-author-name'] ) { ?>
|
59 |
<div class="sp-athr">
|
60 |
<span class="athr-tx"><?php echo ampforwp_translation($redux_builder_amp['amp-translator-published-by'], 'Published by' ); ?></span>
|
65 |
<div class="tags">
|
66 |
<?php amp_tags_list();?>
|
67 |
</div>
|
68 |
+
<?php } ?>
|
69 |
+
<?php if($redux_builder_amp['rp_design_type'] == '1'){
|
70 |
if( true == $redux_builder_amp['swift-date'] ) { ?>
|
71 |
<div class="post-date">
|
72 |
<?php amp_date(); ?><?php edit_post_link(); ?>
|
73 |
</div>
|
74 |
+
|
75 |
<?php }
|
76 |
if ( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] ) {
|
77 |
$my_query = ampforwp_related_post_loop_query();
|
105 |
} ?>
|
106 |
</ul>
|
107 |
</div>
|
108 |
+
<?php wp_reset_postdata(); } }?>
|
109 |
</div>
|
110 |
<?php } ?>
|
111 |
</div>
|
114 |
<?php }
|
115 |
do_action("ampforwp_single_design_type_handle");
|
116 |
?>
|
117 |
+
<?php if($redux_builder_amp['rp_design_type'] == '2' || $redux_builder_amp['rp_design_type'] == '3'){
|
118 |
+
if ( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_builder_amp['ampforwp-single-related-posts-switch'] ) {
|
119 |
+
$my_query = ampforwp_related_post_loop_query();
|
120 |
+
if( $my_query->have_posts() ) { $r_count = 1;?>
|
121 |
+
<div class="srp">
|
122 |
+
<div class="cntr">
|
123 |
+
<?php ampforwp_related_post(); ?>
|
124 |
+
<ul class="clearfix">
|
125 |
+
<?php
|
126 |
+
while( $my_query->have_posts() ) {
|
127 |
+
$my_query->the_post();
|
128 |
+
?>
|
129 |
+
<li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
|
130 |
+
<?php if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) { if(ampforwp_has_post_thumbnail()){?>
|
131 |
+
<div class="rlp-image">
|
132 |
+
<?php ampforwp_get_relatedpost_image('full',array('image_crop'=>'true','image_crop_width'=>220,'image_crop_height'=>134) );?>
|
133 |
+
</div>
|
134 |
+
<?php } } ?>
|
135 |
+
<div class="rlp-cnt">
|
136 |
+
<?php $argsdata = array(
|
137 |
+
'show_author' => false,
|
138 |
+
'show_excerpt' =>false
|
139 |
+
);
|
140 |
+
ampforwp_get_relatedpost_content($argsdata); ?>
|
141 |
+
</div>
|
142 |
+
</li><?php
|
143 |
+
do_action('ampforwp_between_related_post',$r_count);
|
144 |
+
$r_count++;
|
145 |
+
}
|
146 |
+
} ?>
|
147 |
+
</ul>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
<?php wp_reset_postdata(); } } ?>
|
151 |
<?php if($redux_builder_amp['single-design-type'] == '1' && isset($redux_builder_amp['ampforwp-swift-recent-posts']) && $redux_builder_amp['ampforwp-swift-recent-posts']=='1' && !checkAMPforPageBuilderStatus(get_the_ID()) ) { ?>
|
152 |
<div class="r-pf">
|
153 |
<div class="cntr">
|
templates/design-manager/swift/style.php
CHANGED
@@ -75,7 +75,7 @@ header .cntr{
|
|
75 |
.h-shop a:after{align-self: center;}
|
76 |
.h-ic{margin:0px 10px; align-self: center;}
|
77 |
.amp-logo a{line-height:0;display:inline-block;<?php if(isset($redux_builder_amp['swift-element-color-control'] ['rgba']) && $redux_builder_amp['swift-element-color-control'] ['rgba']){?>color:<?php echo $redux_builder_amp['swift-element-color-control']['rgba']?>;<?php } ?>}
|
78 |
-
.logo h1{margin: 0;font-size: 17px;font-weight: 700;text-transform: uppercase;display:inline-block;}
|
79 |
.h-srch a{line-height:1;display:block;}
|
80 |
.amp-logo amp-img{margin: 0 auto;}
|
81 |
@media(max-width:480px){ .h-sing {font-size: 13px;} }
|
@@ -382,7 +382,7 @@ echo $fontFamily;?>
|
|
382 |
.shr-txt, .athr-tx, .r-pf h3, .amp-tags > span:nth-child(1), .amp-related-posts-title, .post-date, .related-title{text-transform: uppercase;font-size: 12px;color: #666;font-weight: 400;}
|
383 |
.loop-date, .post-edit-link{display:inline-block;}
|
384 |
.post-date .post-edit-link{color: <?php echo $redux_builder_amp['swift-color-scheme']['color']; ?>;float: right;}
|
385 |
-
.sp-athr, .amp-tags, .post-date
|
386 |
.sp-athr .author-details a, .sp-athr .author-details, .amp-tags span a, .amp-tag {font-size: 15px;color: <?php echo $redux_builder_amp['swift-color-scheme']['color']; ?>;font-weight: 400;line-height: 1.5;}
|
387 |
.amp-tags .amp-tag:after{content: "/";display: inline-block;padding: 0px 10px;position: relative;top: -1px;color: #ccc;font-size: 12px;}
|
388 |
.amp-tags .amp-tag:last-child:after{display:none;}
|
@@ -390,7 +390,17 @@ echo $fontFamily;?>
|
|
390 |
.sgl table {width: 100%;margin-bottom:25px;}
|
391 |
.sgl td {padding: 0.5em 1em;border: 1px solid #ddd;}
|
392 |
.sgl tr:nth-child(odd) td {background: #f7f7f7;}
|
393 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
|
395 |
|
396 |
.cntn-wrp{font-size:18px;color:#000;line-height:1.7;word-break: break-word;}
|
@@ -429,14 +439,72 @@ echo $fontFamily;?>
|
|
429 |
// swift Content Heading Sizes Ends?>
|
430 |
.cntn-wrp p, .cntn-wrp ul, .cntn-wrp ol{margin:0px 0px 30px 0px;word-break: break-word;}
|
431 |
.sp-rt p strong, .pg p strong{font-weight: 700;}
|
432 |
-
|
433 |
-
.srp
|
434 |
-
.srp
|
435 |
-
.
|
436 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
.related_link{margin-top:10px;}
|
438 |
.related_link a{color:#333;}
|
439 |
-
.related_link p{word-break: break-
|
|
|
440 |
.amp-related-posts ul{list-style-type:none;}
|
441 |
.r-pf{margin-top: 40px;display: inline-block;width: 100%;}
|
442 |
<?php if( 1 == $redux_builder_amp['ampforwp-inline-related-posts'] && is_single() ){ ?>
|
@@ -558,11 +626,9 @@ if ( isset($redux_builder_amp['ampforwp-disqus-comments-support']) && $redux_bui
|
|
558 |
@media(max-width:768px){
|
559 |
.tl-exc {font-size: 14px;margin-top: 3px;line-height: 22px;}
|
560 |
.sp-rl {display: inline-block;width: 100%;}
|
561 |
-
|
562 |
.sp-lt {width: 100%;margin-top: 20px;max-width:100%;}
|
563 |
.sp-cnt{margin-top: 15px;}
|
564 |
-
.rlp-image{width:200px;float:left;margin-right:15px;display: flex;flex-direction: column;}
|
565 |
-
.rlp-cnt{display: flex;}
|
566 |
.r-pf h3{margin-bottom:0;padding-top:20px;border-top:1px dotted #ccc; }
|
567 |
.r-pf {margin-top:20px;}
|
568 |
.cmts{margin:20px 0px 20px 0px;}
|
@@ -573,8 +639,19 @@ if ( isset($redux_builder_amp['ampforwp-disqus-comments-support']) && $redux_bui
|
|
573 |
.fsp{flex-basis: calc(100% - 30px);}
|
574 |
.fsp-img{width:40%;float:left;margin-right:20px;}
|
575 |
.fsp-cnt{width:54%;float:left;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
576 |
}
|
577 |
@media(max-width:480px){
|
|
|
578 |
.r-pf .cntr{padding:0}
|
579 |
.cntn-wrp p{line-height:1.65;}
|
580 |
.related_posts .has_related_thumbnail {width: 100%;}
|
@@ -598,6 +675,10 @@ if ( isset($redux_builder_amp['ampforwp-disqus-comments-support']) && $redux_bui
|
|
598 |
.fsp-cnt{padding: 0px 15px 0px 14px;}
|
599 |
.r-pf .fsp-cnt{padding: 0px;}
|
600 |
blockquote p {font-size:20px;}
|
|
|
|
|
|
|
|
|
601 |
}
|
602 |
@media(max-width:425px){
|
603 |
.sp-rt .amp-author {margin-bottom: 10px;}
|
75 |
.h-shop a:after{align-self: center;}
|
76 |
.h-ic{margin:0px 10px; align-self: center;}
|
77 |
.amp-logo a{line-height:0;display:inline-block;<?php if(isset($redux_builder_amp['swift-element-color-control'] ['rgba']) && $redux_builder_amp['swift-element-color-control'] ['rgba']){?>color:<?php echo $redux_builder_amp['swift-element-color-control']['rgba']?>;<?php } ?>}
|
78 |
+
.logo <?php if(is_single()){ ?> h2 <?php } else{?>h1<?php }?>{margin: 0;font-size: 17px;font-weight: 700;text-transform: uppercase;display:inline-block;}
|
79 |
.h-srch a{line-height:1;display:block;}
|
80 |
.amp-logo amp-img{margin: 0 auto;}
|
81 |
@media(max-width:480px){ .h-sing {font-size: 13px;} }
|
382 |
.shr-txt, .athr-tx, .r-pf h3, .amp-tags > span:nth-child(1), .amp-related-posts-title, .post-date, .related-title{text-transform: uppercase;font-size: 12px;color: #666;font-weight: 400;}
|
383 |
.loop-date, .post-edit-link{display:inline-block;}
|
384 |
.post-date .post-edit-link{color: <?php echo $redux_builder_amp['swift-color-scheme']['color']; ?>;float: right;}
|
385 |
+
.sp-athr, .amp-tags, .post-date{margin-top:20px;}
|
386 |
.sp-athr .author-details a, .sp-athr .author-details, .amp-tags span a, .amp-tag {font-size: 15px;color: <?php echo $redux_builder_amp['swift-color-scheme']['color']; ?>;font-weight: 400;line-height: 1.5;}
|
387 |
.amp-tags .amp-tag:after{content: "/";display: inline-block;padding: 0px 10px;position: relative;top: -1px;color: #ccc;font-size: 12px;}
|
388 |
.amp-tags .amp-tag:last-child:after{display:none;}
|
390 |
.sgl table {width: 100%;margin-bottom:25px;}
|
391 |
.sgl td {padding: 0.5em 1em;border: 1px solid #ddd;}
|
392 |
.sgl tr:nth-child(odd) td {background: #f7f7f7;}
|
393 |
+
<?php // Social Sharing Conditional CSS
|
394 |
+
if($redux_builder_amp['swift-social-position'] == 'above-content'){?>
|
395 |
+
.shr-txt{display:none;}
|
396 |
+
.sp-athr{margin-top:0;}
|
397 |
+
.sp-rt .ss-ic{padding-bottom: 10px;margin-bottom: 10px;border-bottom: none;}
|
398 |
+
<?php }
|
399 |
+
if($redux_builder_amp['swift-social-position'] == 'below-content'){?>
|
400 |
+
.shr-txt{display:none;}
|
401 |
+
.sp-athr{margin-top:0;}
|
402 |
+
.sp-rt .ss-ic{padding-bottom: 10px;margin-bottom: 20px;}
|
403 |
+
<?php } ?>
|
404 |
|
405 |
|
406 |
.cntn-wrp{font-size:18px;color:#000;line-height:1.7;word-break: break-word;}
|
439 |
// swift Content Heading Sizes Ends?>
|
440 |
.cntn-wrp p, .cntn-wrp ul, .cntn-wrp ol{margin:0px 0px 30px 0px;word-break: break-word;}
|
441 |
.sp-rt p strong, .pg p strong{font-weight: 700;}
|
442 |
+
<?php if($redux_builder_amp['rp_design_type'] == '1'){?>
|
443 |
+
.srp{margin-top:20px;}
|
444 |
+
.srp .amp-related-posts amp-img{float: left;width: 100%;margin: 0px;height:100%;}
|
445 |
+
.srp ul li{display: inline-block;line-height: 1.3;margin-bottom: 24px;list-style-type:none;width:100%;}
|
446 |
+
.srp ul li:last-child{margin-bottom:0px;}
|
447 |
+
.has_thumbnail:hover {opacity:0.7;}
|
448 |
+
.has_thumbnail:hover .related_link a{color: <?php echo $redux_builder_amp['swift-color-scheme']['color']; ?>;}
|
449 |
+
<?php } // Related Posts Desing 1 Ends
|
450 |
+
if($redux_builder_amp['rp_design_type'] == '2'){?>
|
451 |
+
.srp{
|
452 |
+
margin-top: 40px;
|
453 |
+
display: inline-block;
|
454 |
+
width: 100%;
|
455 |
+
}
|
456 |
+
.srp ul{
|
457 |
+
display: flex;
|
458 |
+
flex-wrap: wrap;
|
459 |
+
margin: -15px;
|
460 |
+
}
|
461 |
+
.srp ul li{
|
462 |
+
list-style-type:none;
|
463 |
+
margin: 15px;
|
464 |
+
flex-basis: calc(33.33% - 30px);
|
465 |
+
}
|
466 |
+
.related_link{
|
467 |
+
margin: 0px 0px 5px 0px;
|
468 |
+
font-size: 18px;
|
469 |
+
line-height: 1.4;
|
470 |
+
font-weight: 500;
|
471 |
+
}
|
472 |
+
.has_thumbnail:hover .related_link a{
|
473 |
+
color: <?php echo $redux_builder_amp['swift-color-scheme']['color']; ?>;
|
474 |
+
}
|
475 |
+
.related_link a{color:#191919;}
|
476 |
+
<?php } // Related Posts Desing 2 Ends
|
477 |
+
if($redux_builder_amp['rp_design_type'] == '3'){?>
|
478 |
+
.srp{
|
479 |
+
margin-top: 40px;
|
480 |
+
display: inline-block;
|
481 |
+
width: 100%;
|
482 |
+
}
|
483 |
+
.srp ul{
|
484 |
+
display: grid;
|
485 |
+
grid-template-columns: 333px 333px 333px;
|
486 |
+
grid-gap: 30px;
|
487 |
+
width: 100%;
|
488 |
+
overflow-x: scroll;
|
489 |
+
}
|
490 |
+
.srp ul li{
|
491 |
+
list-style-type:none;
|
492 |
+
}
|
493 |
+
.related_link{
|
494 |
+
margin: 0px 0px 5px 0px;
|
495 |
+
font-size: 18px;
|
496 |
+
line-height: 1.4;
|
497 |
+
font-weight: 500;
|
498 |
+
}
|
499 |
+
.has_thumbnail:hover .related_link a{
|
500 |
+
color: <?php echo $redux_builder_amp['swift-color-scheme']['color']; ?>;
|
501 |
+
}
|
502 |
+
.related_link a{color:#191919;}
|
503 |
+
<?php } // Related Posts Desing 3 Ends ?>
|
504 |
.related_link{margin-top:10px;}
|
505 |
.related_link a{color:#333;}
|
506 |
+
.related_link p{word-break: break-all;color: #444;font-size: 13px;line-height: 20px;
|
507 |
+
letter-spacing: 0.10px;margin-top: 5px;font-weight: 400;}
|
508 |
.amp-related-posts ul{list-style-type:none;}
|
509 |
.r-pf{margin-top: 40px;display: inline-block;width: 100%;}
|
510 |
<?php if( 1 == $redux_builder_amp['ampforwp-inline-related-posts'] && is_single() ){ ?>
|
626 |
@media(max-width:768px){
|
627 |
.tl-exc {font-size: 14px;margin-top: 3px;line-height: 22px;}
|
628 |
.sp-rl {display: inline-block;width: 100%;}
|
629 |
+
|
630 |
.sp-lt {width: 100%;margin-top: 20px;max-width:100%;}
|
631 |
.sp-cnt{margin-top: 15px;}
|
|
|
|
|
632 |
.r-pf h3{margin-bottom:0;padding-top:20px;border-top:1px dotted #ccc; }
|
633 |
.r-pf {margin-top:20px;}
|
634 |
.cmts{margin:20px 0px 20px 0px;}
|
639 |
.fsp{flex-basis: calc(100% - 30px);}
|
640 |
.fsp-img{width:40%;float:left;margin-right:20px;}
|
641 |
.fsp-cnt{width:54%;float:left;}
|
642 |
+
<?php if($redux_builder_amp['rp_design_type'] == '1'){?>
|
643 |
+
.srp .related_link{font-size:20px;line-height:1.4;font-weight:600;}
|
644 |
+
.rlp-image{width:200px;float:left;margin-right:15px;display: flex;flex-direction: column;}
|
645 |
+
.rlp-cnt{display: flex;}
|
646 |
+
<?php } //Related post Design 1 CSS Ends
|
647 |
+
if($redux_builder_amp['rp_design_type'] == '2'){?>
|
648 |
+
.srp ul li{flex-basis: calc(100% - 30px);}
|
649 |
+
.srp li .rlp-image{width:40%;float:left;margin-right:20px;}
|
650 |
+
.srp li .rlp-cnt{width:54%;float:left;}
|
651 |
+
<?php } //Related post Design 2 CSS Ends?>
|
652 |
}
|
653 |
@media(max-width:480px){
|
654 |
+
.loop-wrapper{margin:0;}
|
655 |
.r-pf .cntr{padding:0}
|
656 |
.cntn-wrp p{line-height:1.65;}
|
657 |
.related_posts .has_related_thumbnail {width: 100%;}
|
675 |
.fsp-cnt{padding: 0px 15px 0px 14px;}
|
676 |
.r-pf .fsp-cnt{padding: 0px;}
|
677 |
blockquote p {font-size:20px;}
|
678 |
+
<?php if($redux_builder_amp['rp_design_type'] == '2'){?>
|
679 |
+
.srp li .rlp-image{width:100%;float:none;margin-right:0px;}
|
680 |
+
.srp li .rlp-cnt{width:100%;float:none;}
|
681 |
+
<?php } ?>
|
682 |
}
|
683 |
@media(max-width:425px){
|
684 |
.sp-rt .amp-author {margin-bottom: 10px;}
|
templates/features.php
CHANGED
@@ -1940,9 +1940,10 @@ function ampforwp_title_meta_save( $post_id ) {
|
|
1940 |
$is_autosave = wp_is_post_autosave( $post_id );
|
1941 |
$is_revision = wp_is_post_revision( $post_id );
|
1942 |
$is_valid_nonce = ( isset( $_POST[ 'ampforwp_title_nonce' ] ) && wp_verify_nonce( $_POST[ 'ampforwp_title_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';
|
|
|
1943 |
|
1944 |
// Exits script depending on save status
|
1945 |
-
if ( $is_autosave || $is_revision || !$is_valid_nonce ) {
|
1946 |
return;
|
1947 |
}
|
1948 |
|
@@ -1951,7 +1952,10 @@ function ampforwp_title_meta_save( $post_id ) {
|
|
1951 |
$ampforwp_amp_status = sanitize_text_field( $_POST[ 'ampforwp-amp-on-off' ] );
|
1952 |
update_post_meta( $post_id, 'ampforwp-amp-on-off', $ampforwp_amp_status );
|
1953 |
}
|
1954 |
-
|
|
|
|
|
|
|
1955 |
if( isset( $_POST[ 'ampforwp-redirection-on-off' ] ) ) {
|
1956 |
$ampforwp_redirection_status = sanitize_text_field( $_POST[ 'ampforwp-redirection-on-off' ] );
|
1957 |
update_post_meta( $post_id, 'ampforwp-redirection-on-off', $ampforwp_redirection_status );
|
@@ -2107,6 +2111,9 @@ function ampforwp_remove_schema_data() {
|
|
2107 |
ampforwp_remove_filters_for_class( 'amp_post_template_data', 'Bunyad_Theme_Amp', 'setup_data', 10 );
|
2108 |
// Remove Jannah Image Lazy Load #2224
|
2109 |
ampforwp_remove_filters_for_class( 'wp_get_attachment_image_attributes', 'TIELABS_FILTERS', 'lazyload_image_attributes', 8 );
|
|
|
|
|
|
|
2110 |
// Remove JPG, PNG Compression and Optimization Plugin Lazy Load #2322
|
2111 |
ampforwp_remove_filters_for_class( 'the_content', 'Wp_Image_compression', 'filter_images', 200 );
|
2112 |
//SiteOrigin Page builder compatibilty with AMP Frontpage
|
@@ -3032,13 +3039,19 @@ function ampforwp_talking_to_robots() {
|
|
3032 |
}
|
3033 |
// All in One SEO #1720
|
3034 |
if ( class_exists('All_in_One_SEO_Pack') ) {
|
3035 |
-
$aios_class = $aios_meta = '';
|
3036 |
$noindex = 'index';
|
3037 |
$nofollow = 'follow';
|
3038 |
$aios_class = new All_in_One_SEO_Pack();
|
3039 |
-
|
3040 |
-
|
3041 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3042 |
if ( ( is_category() && ! empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( ! is_category() && is_archive() && ! is_tag() && ! is_tax() || ( is_tag() && ! empty( $aioseop_options['aiosp_tags_noindex'] ) ) || ( is_search() && ! empty( $aioseop_options['aiosp_search_noindex'] ) )
|
3043 |
) ){
|
3044 |
$noindex = 'noindex';
|
@@ -3063,7 +3076,7 @@ function ampforwp_talking_to_robots() {
|
|
3063 |
}
|
3064 |
}
|
3065 |
}
|
3066 |
-
if ( is_singular() && $aios_class->is_password_protected() && apply_filters( 'aiosp_noindex_password_posts', false ) ) {
|
3067 |
$noindex = 'noindex';
|
3068 |
}
|
3069 |
|
@@ -4277,68 +4290,79 @@ function ampforwp_remove_sq_seo() {
|
|
4277 |
//67 View Non AMP
|
4278 |
function ampforwp_view_nonamp(){
|
4279 |
global $redux_builder_amp, $post, $wp;
|
4280 |
-
$ampforwp_backto_nonamp = '';
|
4281 |
-
|
4282 |
-
|
4283 |
-
$post_id = get_option('page_for_posts');
|
4284 |
if($redux_builder_amp['amp-mobile-redirection']==1)
|
4285 |
-
|
4286 |
-
|
4287 |
-
|
4288 |
-
}
|
4289 |
-
|
4290 |
-
|
4291 |
-
|
4292 |
-
|
4293 |
-
|
4294 |
-
|
4295 |
-
|
4296 |
-
|
4297 |
-
|
4298 |
-
|
4299 |
-
|
4300 |
-
|
4301 |
-
|
4302 |
-
|
4303 |
-
|
4304 |
-
|
4305 |
-
|
4306 |
-
|
4307 |
-
|
4308 |
-
|
4309 |
-
|
4310 |
-
|
4311 |
-
|
4312 |
-
|
4313 |
-
|
4314 |
-
|
4315 |
-
|
4316 |
-
|
4317 |
-
|
4318 |
-
|
4319 |
-
$ampforwp_backto_nonamp = user_trailingslashit($ampforwp_backto_nonamp);
|
4320 |
|
4321 |
-
|
4322 |
-
|
4323 |
-
|
4324 |
-
|
4325 |
-
|
4326 |
-
|
4327 |
-
|
4328 |
-
|
4329 |
-
|
4330 |
-
|
4331 |
-
|
4332 |
|
4333 |
-
|
4334 |
$nofollow = 'rel="nofollow"';
|
4335 |
-
|
4336 |
-
|
4337 |
-
|
4338 |
-
|
4339 |
-
|
4340 |
-
|
4341 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4342 |
|
4343 |
//68. Facebook Instant Articles
|
4344 |
add_action('init', 'fb_instant_article_feed_generator');
|
@@ -4347,6 +4371,7 @@ function fb_instant_article_feed_generator() {
|
|
4347 |
global $redux_builder_amp;
|
4348 |
if( isset($redux_builder_amp['fb-instant-article-switch']) && $redux_builder_amp['fb-instant-article-switch'] ) {
|
4349 |
add_feed('instant_articles', 'fb_instant_article_feed_function');
|
|
|
4350 |
}
|
4351 |
}
|
4352 |
|
@@ -4355,6 +4380,29 @@ function fb_instant_article_feed_function() {
|
|
4355 |
load_template( AMPFORWP_PLUGIN_DIR . '/feeds/instant-article-feed.php' );
|
4356 |
}
|
4357 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4358 |
// 69. Post Pagination #834 #857
|
4359 |
function ampforwp_post_pagination( $args = '' ) {
|
4360 |
|
@@ -4884,7 +4932,7 @@ global $redux_builder_amp;
|
|
4884 |
|
4885 |
function is_category_amp_disabled(){
|
4886 |
global $redux_builder_amp;
|
4887 |
-
$current_cats_ids = array();
|
4888 |
if(is_archive() && $redux_builder_amp['ampforwp-archive-support']==1){
|
4889 |
if(is_tag() && is_array($redux_builder_amp['hide-amp-tags-bulk-option'])) {
|
4890 |
$all_tags = get_the_tags();
|
@@ -6266,6 +6314,7 @@ if( ! function_exists( 'ampforwp_full_post_date_loops' ) ){
|
|
6266 |
$full_date = $redux_builder_amp['ampforwp-post-date-format-text'];
|
6267 |
// Change the % days into the actual number of days
|
6268 |
$full_date = str_replace('% days', $date, $full_date);
|
|
|
6269 |
}
|
6270 |
}
|
6271 |
return $full_date;
|
@@ -7389,3 +7438,62 @@ function ampforwp_thrive_content($content){
|
|
7389 |
$content = $sanitizer_obj->get_amp_content();
|
7390 |
return $content;
|
7391 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1940 |
$is_autosave = wp_is_post_autosave( $post_id );
|
1941 |
$is_revision = wp_is_post_revision( $post_id );
|
1942 |
$is_valid_nonce = ( isset( $_POST[ 'ampforwp_title_nonce' ] ) && wp_verify_nonce( $_POST[ 'ampforwp_title_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';
|
1943 |
+
$is_valid_nonce_ia = ( isset( $_POST[ 'ampforwp_ia_nonce' ] ) && wp_verify_nonce( $_POST[ 'ampforwp_ia_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';
|
1944 |
|
1945 |
// Exits script depending on save status
|
1946 |
+
if ( $is_autosave || $is_revision || !$is_valid_nonce || !$is_valid_nonce_ia) {
|
1947 |
return;
|
1948 |
}
|
1949 |
|
1952 |
$ampforwp_amp_status = sanitize_text_field( $_POST[ 'ampforwp-amp-on-off' ] );
|
1953 |
update_post_meta( $post_id, 'ampforwp-amp-on-off', $ampforwp_amp_status );
|
1954 |
}
|
1955 |
+
if( isset( $_POST[ 'ampforwp-ia-on-off' ] ) ) {
|
1956 |
+
$ampforwp_amp_status = sanitize_text_field( $_POST[ 'ampforwp-ia-on-off' ] );
|
1957 |
+
update_post_meta( $post_id, 'ampforwp-ia-on-off', $ampforwp_amp_status );
|
1958 |
+
}
|
1959 |
if( isset( $_POST[ 'ampforwp-redirection-on-off' ] ) ) {
|
1960 |
$ampforwp_redirection_status = sanitize_text_field( $_POST[ 'ampforwp-redirection-on-off' ] );
|
1961 |
update_post_meta( $post_id, 'ampforwp-redirection-on-off', $ampforwp_redirection_status );
|
2111 |
ampforwp_remove_filters_for_class( 'amp_post_template_data', 'Bunyad_Theme_Amp', 'setup_data', 10 );
|
2112 |
// Remove Jannah Image Lazy Load #2224
|
2113 |
ampforwp_remove_filters_for_class( 'wp_get_attachment_image_attributes', 'TIELABS_FILTERS', 'lazyload_image_attributes', 8 );
|
2114 |
+
// Social Share by Supsystic Compatibility #1509
|
2115 |
+
ampforwp_remove_filters_for_class( 'the_content', 'SocialSharing_Projects_Handler', 'applyContentCallback', 10 );
|
2116 |
+
ampforwp_remove_filters_for_class( 'amp_post_template_head', 'SocialSharing_Projects_Handler', 'addedStylesForAMP', 10 );
|
2117 |
// Remove JPG, PNG Compression and Optimization Plugin Lazy Load #2322
|
2118 |
ampforwp_remove_filters_for_class( 'the_content', 'Wp_Image_compression', 'filter_images', 200 );
|
2119 |
//SiteOrigin Page builder compatibilty with AMP Frontpage
|
3039 |
}
|
3040 |
// All in One SEO #1720
|
3041 |
if ( class_exists('All_in_One_SEO_Pack') ) {
|
3042 |
+
$aios_class = $page = $opts = $aios_meta = $aiosp_noindex = $aiosp_nofollow = '';
|
3043 |
$noindex = 'index';
|
3044 |
$nofollow = 'follow';
|
3045 |
$aios_class = new All_in_One_SEO_Pack();
|
3046 |
+
if (property_exists($aios_class,'get_page_number')) {
|
3047 |
+
$page = $aios_class->get_page_number();
|
3048 |
+
}
|
3049 |
+
if (property_exists($aios_class,'get_current_options')) {
|
3050 |
+
$opts = $aios_class->get_current_options( array(), 'aiosp' );
|
3051 |
+
}
|
3052 |
+
if (property_exists($aios_class,'get_robots_meta')) {
|
3053 |
+
$aios_meta = $aios_class->get_robots_meta();
|
3054 |
+
}
|
3055 |
if ( ( is_category() && ! empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( ! is_category() && is_archive() && ! is_tag() && ! is_tax() || ( is_tag() && ! empty( $aioseop_options['aiosp_tags_noindex'] ) ) || ( is_search() && ! empty( $aioseop_options['aiosp_search_noindex'] ) )
|
3056 |
) ){
|
3057 |
$noindex = 'noindex';
|
3076 |
}
|
3077 |
}
|
3078 |
}
|
3079 |
+
if ( is_singular() && property_exists($aios_class,'is_password_protected') && $aios_class->is_password_protected() && apply_filters( 'aiosp_noindex_password_posts', false ) ) {
|
3080 |
$noindex = 'noindex';
|
3081 |
}
|
3082 |
|
4290 |
//67 View Non AMP
|
4291 |
function ampforwp_view_nonamp(){
|
4292 |
global $redux_builder_amp, $post, $wp;
|
4293 |
+
$ampforwp_backto_nonamp = $nofollow = $page = '';
|
4294 |
+
if ( is_home() && get_option( 'page_for_posts' ) && get_queried_object_id() ) {
|
4295 |
+
$post_id = get_option('page_for_posts');
|
|
|
4296 |
if($redux_builder_amp['amp-mobile-redirection']==1)
|
4297 |
+
$ampforwp_backto_nonamp = trailingslashit(get_permalink( $post_id )).'?nonamp=1';
|
4298 |
+
else
|
4299 |
+
$ampforwp_backto_nonamp = user_trailingslashit(get_permalink( $post_id ));
|
4300 |
+
}
|
4301 |
+
elseif ( is_home() ) {
|
4302 |
+
if($redux_builder_amp['amp-mobile-redirection']==1)
|
4303 |
+
$ampforwp_backto_nonamp = trailingslashit(home_url()).'?nonamp=1' ;
|
4304 |
+
else
|
4305 |
+
$ampforwp_backto_nonamp = user_trailingslashit(home_url()) ;
|
4306 |
+
}
|
4307 |
+
if ( is_single() ){
|
4308 |
+
if($redux_builder_amp['amp-mobile-redirection']==1)
|
4309 |
+
$ampforwp_backto_nonamp = trailingslashit(get_permalink( $post->ID )).'?nonamp=1' ;
|
4310 |
+
else
|
4311 |
+
$ampforwp_backto_nonamp = user_trailingslashit(get_permalink( $post->ID )) ;
|
4312 |
+
}
|
4313 |
+
if ( is_page() ){
|
4314 |
+
if($redux_builder_amp['amp-mobile-redirection']==1)
|
4315 |
+
$ampforwp_backto_nonamp = trailingslashit(get_permalink( $post->ID )).'?nonamp=1';
|
4316 |
+
else
|
4317 |
+
$ampforwp_backto_nonamp = user_trailingslashit(get_permalink( $post->ID ));
|
4318 |
+
}
|
4319 |
+
if( is_archive() || is_search() ) {
|
4320 |
+
|
4321 |
+
$permalink_structure = '';
|
4322 |
+
$permalink_structure = get_option('permalink_structure');
|
4323 |
+
|
4324 |
+
if($redux_builder_amp['amp-mobile-redirection']==1){
|
4325 |
+
$ampforwp_backto_nonamp = esc_url( untrailingslashit(home_url( $wp->request )).'?nonamp=1' );
|
4326 |
+
$ampforwp_backto_nonamp = preg_replace('/\/amp\?nonamp=1/','/?nonamp=1',$ampforwp_backto_nonamp);
|
4327 |
+
} else {
|
4328 |
+
$ampforwp_backto_nonamp = untrailingslashit( home_url( $wp->request ) );
|
4329 |
+
$ampforwp_backto_nonamp = dirname($ampforwp_backto_nonamp);
|
4330 |
+
$ampforwp_backto_nonamp = user_trailingslashit($ampforwp_backto_nonamp);
|
|
|
4331 |
|
4332 |
+
if('' == $permalink_structure){
|
4333 |
+
$ampforwp_backto_nonamp = site_url('?'.$wp->query_string);
|
4334 |
+
$ampforwp_backto_nonamp = remove_query_arg( 'amp', $ampforwp_backto_nonamp );
|
4335 |
+
}
|
4336 |
+
}
|
4337 |
+
if ( is_search() ) {
|
4338 |
+
if ( ! empty( $permalink_structure ) ){
|
4339 |
+
$ampforwp_backto_nonamp = add_query_arg('s', $wp->query_vars['s'], $ampforwp_backto_nonamp);
|
4340 |
+
}
|
4341 |
+
}
|
4342 |
+
}
|
4343 |
|
4344 |
+
if( true == $redux_builder_amp['ampforwp-nofollow-view-nonamp'] ){
|
4345 |
$nofollow = 'rel="nofollow"';
|
4346 |
+
}
|
4347 |
+
if ( isset($redux_builder_amp['ampforwp-amp-takeover']) && $redux_builder_amp['ampforwp-amp-takeover'] ) {
|
4348 |
+
$ampforwp_backto_nonamp = '';
|
4349 |
+
}
|
4350 |
+
|
4351 |
+
$current_amp_url = home_url( $wp->request );
|
4352 |
+
$current_amp_url = trailingslashit($current_amp_url);
|
4353 |
+
$remove = '/'. AMPFORWP_AMP_QUERY_VAR;
|
4354 |
+
$non_amp_url = str_replace($remove, '', $current_amp_url);
|
4355 |
+
$query_arg_array = $wp->query_vars;
|
4356 |
+
|
4357 |
+
if( array_key_exists( "page" , $query_arg_array ) ) {
|
4358 |
+
$page = $wp->query_vars['page'];
|
4359 |
+
}
|
4360 |
+
if ( $page >= '2') {
|
4361 |
+
$non_amp_url = trailingslashit( $non_amp_url . '?page=' . $page);
|
4362 |
+
}
|
4363 |
+
if ( $ampforwp_backto_nonamp ) { ?> <a class="view-non-amp" href="<?php echo user_trailingslashit( esc_url($non_amp_url) ) ?>" <?php echo esc_attr($nofollow); ?>><?php echo esc_html( $redux_builder_amp['amp-translator-non-amp-page-text'] ) ;?></a> <?php }
|
4364 |
+
|
4365 |
+
}
|
4366 |
|
4367 |
//68. Facebook Instant Articles
|
4368 |
add_action('init', 'fb_instant_article_feed_generator');
|
4371 |
global $redux_builder_amp;
|
4372 |
if( isset($redux_builder_amp['fb-instant-article-switch']) && $redux_builder_amp['fb-instant-article-switch'] ) {
|
4373 |
add_feed('instant_articles', 'fb_instant_article_feed_function');
|
4374 |
+
add_action( 'wp_head', 'ampforwp_fbia_meta_tags' );
|
4375 |
}
|
4376 |
}
|
4377 |
|
4380 |
load_template( AMPFORWP_PLUGIN_DIR . '/feeds/instant-article-feed.php' );
|
4381 |
}
|
4382 |
|
4383 |
+
if ( ! function_exists('ampforwp_fbia_meta_tags') ) {
|
4384 |
+
function ampforwp_fbia_meta_tags(){
|
4385 |
+
global $redux_builder_amp;
|
4386 |
+
$fb_page_id = '';
|
4387 |
+
$fb_page_id = $redux_builder_amp['fb-instant-page-id'];
|
4388 |
+
// Page ID meta Tag
|
4389 |
+
if( isset($redux_builder_amp['fb-instant-page-id']) && $redux_builder_amp['fb-instant-page-id'] ) { ?>
|
4390 |
+
<meta property="fb:pages" content="<?php echo esc_attr( $fb_page_id ); ?>" />
|
4391 |
+
<?php }
|
4392 |
+
$post = get_post();
|
4393 |
+
// If there's no current post, return
|
4394 |
+
if ( ! $post ) {
|
4395 |
+
return;
|
4396 |
+
}
|
4397 |
+
$url = get_permalink();
|
4398 |
+
$url = add_query_arg( 'ia_markup', '1', $url );
|
4399 |
+
// ia markup meta tag
|
4400 |
+
if( isset($redux_builder_amp['fb-instant-crawler-ingestion']) && $redux_builder_amp['fb-instant-crawler-ingestion'] ) { ?>
|
4401 |
+
<meta property="ia:markup_url" content="<?php echo esc_url( $url ); ?>" />
|
4402 |
+
<?php }
|
4403 |
+
}
|
4404 |
+
}
|
4405 |
+
|
4406 |
// 69. Post Pagination #834 #857
|
4407 |
function ampforwp_post_pagination( $args = '' ) {
|
4408 |
|
4932 |
|
4933 |
function is_category_amp_disabled(){
|
4934 |
global $redux_builder_amp;
|
4935 |
+
$current_cats_ids = $selected_cats = array();
|
4936 |
if(is_archive() && $redux_builder_amp['ampforwp-archive-support']==1){
|
4937 |
if(is_tag() && is_array($redux_builder_amp['hide-amp-tags-bulk-option'])) {
|
4938 |
$all_tags = get_the_tags();
|
6314 |
$full_date = $redux_builder_amp['ampforwp-post-date-format-text'];
|
6315 |
// Change the % days into the actual number of days
|
6316 |
$full_date = str_replace('% days', $date, $full_date);
|
6317 |
+
$full_date = str_replace('ago', ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago'), $full_date);
|
6318 |
}
|
6319 |
}
|
6320 |
return $full_date;
|
7438 |
$content = $sanitizer_obj->get_amp_content();
|
7439 |
return $content;
|
7440 |
}
|
7441 |
+
// Instant Articles Meta Box
|
7442 |
+
add_action( 'add_meta_boxes', 'ampforwp_ia_meta_box' );
|
7443 |
+
if ( ! function_exists('ampforwp_ia_meta_box') ) {
|
7444 |
+
function ampforwp_ia_meta_box() {
|
7445 |
+
global $redux_builder_amp, $post;
|
7446 |
+
$user_level = '';
|
7447 |
+
$user_level = current_user_can( 'manage_options' );
|
7448 |
+
if ( isset( $redux_builder_amp['amp-meta-permissions'] ) && $redux_builder_amp['amp-meta-permissions'] == 'all' ) {
|
7449 |
+
$user_level = true;
|
7450 |
+
}
|
7451 |
+
if ( $user_level ) {
|
7452 |
+
if( true == $redux_builder_amp['fb-instant-article-switch'] && $post->post_type == 'post' ) {
|
7453 |
+
add_meta_box( 'ampforwp_ia_meta', __( 'Show Instant Article for Current Post?','accelerated-mobile-pages' ), 'ampforwp_ia_meta_callback', 'post','side' );
|
7454 |
+
}
|
7455 |
+
}
|
7456 |
+
}
|
7457 |
+
}
|
7458 |
+
// Callback function for Instant Articles Meta Box.
|
7459 |
+
function ampforwp_ia_meta_callback( $post ) {
|
7460 |
+
global $redux_builder_amp;
|
7461 |
+
wp_nonce_field( basename( __FILE__ ), 'ampforwp_ia_nonce' );
|
7462 |
+
$ampforwp_stored_meta = get_post_meta( $post->ID );
|
7463 |
+
if ( ! isset($ampforwp_stored_meta['ampforwp-ia-on-off'][0]) || $ampforwp_stored_meta['ampforwp-ia-on-off'][0] == 'hide-ia') {
|
7464 |
+
$exclude_post_value = get_option('ampforwp_ia_exclude_post');
|
7465 |
+
if ( $exclude_post_value == null ) {
|
7466 |
+
$exclude_post_value[] = 0;
|
7467 |
+
}
|
7468 |
+
if ( $exclude_post_value ) {
|
7469 |
+
if ( ! in_array( $post->ID, $exclude_post_value ) ) {
|
7470 |
+
$exclude_post_value[] = $post->ID;
|
7471 |
+
update_option('ampforwp_ia_exclude_post', $exclude_post_value);
|
7472 |
+
}
|
7473 |
+
}
|
7474 |
+
} else {
|
7475 |
+
$exclude_post_value = get_option('ampforwp_ia_exclude_post');
|
7476 |
+
if ( $exclude_post_value == null ) {
|
7477 |
+
$exclude_post_value[] = 0;
|
7478 |
+
}
|
7479 |
+
if ( $exclude_post_value ) {
|
7480 |
+
if ( in_array( $post->ID, $exclude_post_value ) ) {
|
7481 |
+
$exclude_ids = array_diff($exclude_post_value, array($post->ID) );
|
7482 |
+
update_option('ampforwp_ia_exclude_post', $exclude_ids);
|
7483 |
+
}
|
7484 |
+
}
|
7485 |
+
|
7486 |
+
} ?>
|
7487 |
+
<p>
|
7488 |
+
<div class="prfx-row-content">
|
7489 |
+
<label class="meta-radio-two" for="ampforwp-on-off-meta-radio-one">
|
7490 |
+
<input type="radio" name="ampforwp-ia-on-off" id="ampforwp-on-off-meta-radio-one" value="default" checked="checked" <?php if ( isset ( $ampforwp_stored_meta['ampforwp-ia-on-off'] ) ) checked( $ampforwp_stored_meta['ampforwp-ia-on-off'][0], 'default' ); ?>>
|
7491 |
+
<?php _e( 'Enable' )?>
|
7492 |
+
</label>
|
7493 |
+
<label class="meta-radio-two" for="ampforwp-on-off-meta-radio-two">
|
7494 |
+
<input type="radio" name="ampforwp-ia-on-off" id="ampforwp-on-off-meta-radio-two" value="hide-ia" <?php if ( isset ( $ampforwp_stored_meta['ampforwp-ia-on-off'] ) ) checked( $ampforwp_stored_meta['ampforwp-ia-on-off'][0], 'hide-ia' ); ?>>
|
7495 |
+
<?php _e( 'Disable' )?>
|
7496 |
+
</label>
|
7497 |
+
</div>
|
7498 |
+
</p>
|
7499 |
+
<?php }
|
templates/instant-articles/instant-article.php
CHANGED
@@ -9,15 +9,18 @@
|
|
9 |
<!-- automatic ad placement -->
|
10 |
<meta property="fb:use_automatic_ad_placement" content="enable=true ad_density=<?php echo get_ia_ad_density(); ?>">
|
11 |
<?php } ?>
|
|
|
|
|
|
|
12 |
</head>
|
13 |
<body>
|
14 |
<article>
|
15 |
<header>
|
16 |
<!-- title -->
|
17 |
-
|
18 |
|
19 |
-
|
20 |
-
|
21 |
<?php $categories = get_the_category();
|
22 |
if ( ! empty( $categories ) ) {
|
23 |
echo esc_html( $categories[0]->name );
|
@@ -25,22 +28,22 @@
|
|
25 |
</h3>
|
26 |
|
27 |
<!-- publication date/time -->
|
28 |
-
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
<figure>
|
45 |
<img src="<?php echo $thumbnail_url; ?>" />
|
46 |
<?php if (strlen(apply_filters("the_content", $attachment->post_excerpt)) > 0):
|
@@ -50,17 +53,41 @@
|
|
50 |
}
|
51 |
endif; ?>
|
52 |
</figure>
|
53 |
-
|
54 |
<?php if (isset($redux_builder_amp['fb-instant-article-ads']) && $redux_builder_amp['fb-instant-article-ads'] ){
|
|
|
55 |
if(isset($redux_builder_amp['fb-instant-article-ad-id']) && $redux_builder_amp['fb-instant-article-ad-id']){ ?>
|
56 |
<!-- facebook audience network ad -->
|
57 |
<figure class="op-ad">
|
58 |
<iframe width="300" height="250" style="border:0; margin:0;" src="https://www.facebook.com/adnw_request?placement=<?php echo get_ia_placement_id(); ?>&adtype=banner300x250"></iframe>
|
59 |
</figure>
|
60 |
-
<?php } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
</header>
|
62 |
|
63 |
<!-- body -->
|
|
|
|
|
|
|
64 |
<?php
|
65 |
global $more;
|
66 |
// Make it 1 to allow the full article
|
@@ -76,6 +103,35 @@
|
|
76 |
</figure>
|
77 |
<?php } } ?>
|
78 |
<footer>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
<?php if( true == $redux_builder_amp['ampforwp-instant-article-author-bio']){ ?>
|
80 |
<aside>
|
81 |
<p><?php the_author_meta('display_name'); ?></p>
|
9 |
<!-- automatic ad placement -->
|
10 |
<meta property="fb:use_automatic_ad_placement" content="enable=true ad_density=<?php echo get_ia_ad_density(); ?>">
|
11 |
<?php } ?>
|
12 |
+
<?php if ( isset($redux_builder_amp['fbia-header-text-area']) && $redux_builder_amp['fbia-header-text-area'] ) {
|
13 |
+
echo $redux_builder_amp['fbia-header-text-area'];
|
14 |
+
}?>
|
15 |
</head>
|
16 |
<body>
|
17 |
<article>
|
18 |
<header>
|
19 |
<!-- title -->
|
20 |
+
<h1><?php the_title(); ?></h1>
|
21 |
|
22 |
+
<!-- kicker -->
|
23 |
+
<h3 class="op-kicker">
|
24 |
<?php $categories = get_the_category();
|
25 |
if ( ! empty( $categories ) ) {
|
26 |
echo esc_html( $categories[0]->name );
|
28 |
</h3>
|
29 |
|
30 |
<!-- publication date/time -->
|
31 |
+
<time class="op-published" datetime="<?php echo get_the_date("c"); ?>"><?php echo get_the_date(get_option('date_format') . ", " . get_option('time_format')); ?></time>
|
32 |
|
33 |
+
<!-- modification date/time -->
|
34 |
+
<time class="op-modified" datetime="<?php echo get_the_modified_date("c"); ?>"><?php echo get_the_modified_date(get_option('date_format') . ", " . get_option('time_format')); ?></time>
|
35 |
+
<?php if ( true == $redux_builder_amp['ampforwp-instant-article-author-meta'] ) { ?>
|
36 |
+
<!-- author(s) -->
|
37 |
+
<address>
|
38 |
+
<a><?php the_author_meta('display_name'); ?></a>
|
39 |
+
</address>
|
40 |
+
<?php } ?>
|
41 |
+
<!-- cover -->
|
42 |
+
<?php if(has_post_thumbnail($post->ID)):
|
43 |
+
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );
|
44 |
+
$attachment = get_post(get_post_thumbnail_id($post->ID));
|
45 |
+
$thumbnail_url = $thumb[0];
|
46 |
+
?>
|
47 |
<figure>
|
48 |
<img src="<?php echo $thumbnail_url; ?>" />
|
49 |
<?php if (strlen(apply_filters("the_content", $attachment->post_excerpt)) > 0):
|
53 |
}
|
54 |
endif; ?>
|
55 |
</figure>
|
56 |
+
<?php endif; ?>
|
57 |
<?php if (isset($redux_builder_amp['fb-instant-article-ads']) && $redux_builder_amp['fb-instant-article-ads'] ){
|
58 |
+
if(isset($redux_builder_amp['fb-instant-article-ad-type']) && '1' === $redux_builder_amp['fb-instant-article-ad-type']){
|
59 |
if(isset($redux_builder_amp['fb-instant-article-ad-id']) && $redux_builder_amp['fb-instant-article-ad-id']){ ?>
|
60 |
<!-- facebook audience network ad -->
|
61 |
<figure class="op-ad">
|
62 |
<iframe width="300" height="250" style="border:0; margin:0;" src="https://www.facebook.com/adnw_request?placement=<?php echo get_ia_placement_id(); ?>&adtype=banner300x250"></iframe>
|
63 |
</figure>
|
64 |
+
<?php } }
|
65 |
+
elseif(isset($redux_builder_amp['fb-instant-article-ad-type']) && '2' === $redux_builder_amp['fb-instant-article-ad-type']){
|
66 |
+
$custom_iframe_url = '';
|
67 |
+
if(isset($redux_builder_amp['fb-instant-article-custom-iframe-ad']) && !empty($redux_builder_amp['fb-instant-article-custom-iframe-ad'])){
|
68 |
+
$custom_iframe_url = $redux_builder_amp['fb-instant-article-custom-iframe-ad'];
|
69 |
+
} ?>
|
70 |
+
<!-- facebook custom iframe ad -->
|
71 |
+
<figure class="op-ad">
|
72 |
+
<iframe width="300" height="250" style="border:0; margin:0;" src="<?php echo esc_url($custom_iframe_url); ?>"></iframe>
|
73 |
+
</figure>
|
74 |
+
<?php }
|
75 |
+
elseif(isset($redux_builder_amp['fb-instant-article-ad-type']) && '3' === $redux_builder_amp['fb-instant-article-ad-type']){
|
76 |
+
$custom_iframe_url = '';
|
77 |
+
if(isset($redux_builder_amp['fb-fb-instant-article-custom-embed-ad']) && !empty($redux_builder_amp['fb-instant-article-custom-embed-ad'])){
|
78 |
+
$custom_iframe_url = $redux_builder_amp['fb-instant-article-custom-embed-ad'];
|
79 |
+
} ?>
|
80 |
+
<!-- facebook custom embed ad -->
|
81 |
+
<figure class="op-ad">
|
82 |
+
<iframe width="300" height="250" style="border:0; margin:0;"><?php echo $redux_builder_amp['fb-instant-article-custom-embed-ad']; ?></iframe>
|
83 |
+
</figure>
|
84 |
+
<?php } } ?>
|
85 |
</header>
|
86 |
|
87 |
<!-- body -->
|
88 |
+
<?php if ( isset($redux_builder_amp['fbia-body-text-area']) && $redux_builder_amp['fbia-body-text-area'] ) {
|
89 |
+
echo $redux_builder_amp['fbia-body-text-area'];
|
90 |
+
}?>
|
91 |
<?php
|
92 |
global $more;
|
93 |
// Make it 1 to allow the full article
|
103 |
</figure>
|
104 |
<?php } } ?>
|
105 |
<footer>
|
106 |
+
<?php if ( isset($redux_builder_amp['fbia-footer-text-area']) && $redux_builder_amp['fbia-footer-text-area'] ) {
|
107 |
+
echo $redux_builder_amp['fbia-footer-text-area'];
|
108 |
+
}?>
|
109 |
+
<?php if( isset($redux_builder_amp['ampforwp-ia-related-articles']) && true == $redux_builder_amp['ampforwp-ia-related-articles'] ) {
|
110 |
+
if ( ! empty( $categories ) ) {
|
111 |
+
$categories_ids = wp_list_pluck( $categories, 'term_id' );
|
112 |
+
// Get the four latest posts.
|
113 |
+
$query_args = array(
|
114 |
+
'category__in' => $categories_ids,
|
115 |
+
'post__not_in' => array( get_the_ID() ),
|
116 |
+
'posts_per_page' => 4, // FB uses 4 related articles.
|
117 |
+
'ignore_sticky_posts' => true, // Turn off sticky posts.
|
118 |
+
'order' => 'DESC',
|
119 |
+
'orderby' => 'date',
|
120 |
+
'no_found_rows' => true,
|
121 |
+
'post_type' => get_post_type(),
|
122 |
+
'post_status' => 'publish',
|
123 |
+
);
|
124 |
+
}
|
125 |
+
$related_articles_loop = new WP_Query( $query_args );
|
126 |
+
$related_articles = $related_articles_loop->get_posts();
|
127 |
+
if ( $related_articles_loop->have_posts() ) :?>
|
128 |
+
<ul class="op-related-articles">
|
129 |
+
<?php foreach ( $related_articles as $related_article ) : ?>
|
130 |
+
<li><a href="<?php echo esc_url( get_permalink( $related_article ) ); ?>"></a></li>
|
131 |
+
<?php endforeach; ?>
|
132 |
+
</ul>
|
133 |
+
<?php endif; ?>
|
134 |
+
<?php } ?>
|
135 |
<?php if( true == $redux_builder_amp['ampforwp-instant-article-author-bio']){ ?>
|
136 |
<aside>
|
137 |
<p><?php the_author_meta('display_name'); ?></p>
|