Version Description
(4th April 2019) = * Added: SeoPress compatibility integrated #1589 * Added: WP Appbox compatibility integrated #2791 * Added: Infinite Scroll feature integrated. #2682 * Added: Facebook like button added in Sticky Social Share #2186 * Added: Font family for Content in Single page #2122 * Fixed: Custom post type categories not showing in amp pagebuilder #1993 * Fixed: Duplicate SiteNavigationElement issue #2952 * Fixed: AMP Theme Framework Multisite issue #2936 * Fixed: Custom AMP Editor Content is Not rendering when Elementor is activated #2901 * Fixed: Title issue on Homepage with Yoast if we select custom front page #2962
Full changelog available in changelog.txt
Download this release
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 0.9.97.45 |
Comparing to | |
See all releases |
Code changes from version 0.9.97.44.2 to 0.9.97.45
- README.md +13 -1
- accelerated-moblie-pages.php +11 -2
- changelog.txt +12 -0
- classes/class-ampforwp-infinite-scroll.php +163 -0
- components/components-core.php +1 -1
- components/loop/loop.php +5 -3
- includes/admin-script.js +117 -79
- includes/options/admin-config.php +52 -4
- includes/thirdparty-compatibility.php +426 -0
- pagebuilder/components/fieldsTemplate.php +1 -1
- pagebuilder/inc/admin-amp-page-builder.js +43 -0
- pagebuilder/inc/adminAjaxContents.php +24 -0
- pagebuilder/inc/viewShowFrontData.php +10 -3
- pagebuilder/modules/contents-module.php +31 -12
- pagebuilder/modules/slider-mod-module.php +1 -1
- readme.txt +12 -12
- templates/design-manager/design-1/archive.php +4 -2
- templates/design-manager/design-1/footer.php +2 -3
- templates/design-manager/design-1/header-bar.php +3 -4
- templates/design-manager/design-1/index.php +4 -3
- templates/design-manager/design-1/single.php +1 -0
- templates/design-manager/design-1/style.php +7 -1
- templates/design-manager/design-2/archive.php +5 -4
- templates/design-manager/design-2/footer.php +2 -3
- templates/design-manager/design-2/header-bar.php +2 -3
- templates/design-manager/design-2/index.php +5 -4
- templates/design-manager/design-2/single.php +1 -0
- templates/design-manager/design-2/style.php +17 -1
- templates/design-manager/design-3/archive.php +5 -4
- templates/design-manager/design-3/footer.php +2 -3
- templates/design-manager/design-3/header-bar.php +3 -4
- templates/design-manager/design-3/index.php +5 -4
- templates/design-manager/design-3/single.php +1 -0
- templates/design-manager/design-3/style.php +7 -1
- templates/design-manager/swift/footer.php +22 -2
- templates/design-manager/swift/index.php +1 -0
- templates/design-manager/swift/style.php +54 -8
- templates/features.php +266 -8
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: 5.1
|
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,18 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
|
|
183 |
|
184 |
== Changelog ==
|
185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
= 0.9.97.44.2 (1st April 2019) =
|
187 |
* Added: Element folder files override in the Design One, Design Two and Design Three for the Child theme #2770
|
188 |
* Added: High-resolution Images [Additional image guidelines] option added in structure data #2259
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.1
|
7 |
+
Stable tag: 0.9.97.45
|
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.45 (4th April 2019) =
|
187 |
+
* Added: SeoPress compatibility integrated #1589
|
188 |
+
* Added: WP Appbox compatibility integrated #2791
|
189 |
+
* Added: Infinite Scroll feature integrated. #2682
|
190 |
+
* Added: Facebook like button added in Sticky Social Share #2186
|
191 |
+
* Added: Font family for Content in Single page #2122
|
192 |
+
* Fixed: Custom post type categories not showing in amp pagebuilder #1993
|
193 |
+
* Fixed: Duplicate SiteNavigationElement issue #2952
|
194 |
+
* Fixed: AMP Theme Framework Multisite issue #2936
|
195 |
+
* Fixed: Custom AMP Editor Content is Not rendering when Elementor is activated #2901
|
196 |
+
* Fixed: Title issue on Homepage with Yoast if we select custom front page #2962
|
197 |
+
|
198 |
= 0.9.97.44.2 (1st April 2019) =
|
199 |
* Added: Element folder files override in the Design One, Design Two and Design Three for the Child theme #2770
|
200 |
* Added: High-resolution Images [Additional image guidelines] option added in structure data #2259
|
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
|
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
|
|
20 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
21 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
22 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
23 |
-
define('AMPFORWP_VERSION','0.9.97.
|
24 |
// any changes to AMP_QUERY_VAR should be refelected here
|
25 |
function ampforwp_generate_endpoint(){
|
26 |
$ampforwp_slug = '';
|
@@ -925,4 +925,13 @@ function ampforwp_delete_plugins_manager_transient($plugin){
|
|
925 |
if ( strpos($plugin, 'ampforwp-3rd-party-plugin-creator.php') || strpos($plugin, 'accelerated-moblie-pages.php') ) {
|
926 |
delete_transient( 'ampforwp-pm-disabler' );
|
927 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
928 |
}
|
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.45
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
20 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
21 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
22 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
23 |
+
define('AMPFORWP_VERSION','0.9.97.45');
|
24 |
// any changes to AMP_QUERY_VAR should be refelected here
|
25 |
function ampforwp_generate_endpoint(){
|
26 |
$ampforwp_slug = '';
|
925 |
if ( strpos($plugin, 'ampforwp-3rd-party-plugin-creator.php') || strpos($plugin, 'accelerated-moblie-pages.php') ) {
|
926 |
delete_transient( 'ampforwp-pm-disabler' );
|
927 |
}
|
928 |
+
}
|
929 |
+
// Infinite scroll/ amp-next-page #2244
|
930 |
+
add_action('pre_amp_render_post', 'ampforwp_initialise_classes');
|
931 |
+
if ( ! function_exists('ampforwp_initialise_classes') ) {
|
932 |
+
function ampforwp_initialise_classes(){
|
933 |
+
if ( true == ampforwp_get_setting('ampforwp-infinite-scroll') ) {
|
934 |
+
require AMPFORWP_PLUGIN_DIR .'/classes/class-ampforwp-infinite-scroll.php';
|
935 |
+
}
|
936 |
+
}
|
937 |
}
|
changelog.txt
CHANGED
@@ -1,5 +1,17 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 0.9.97.44.2 (1st April 2019) =
|
4 |
* Added: Element folder files override in the Design One, Design Two and Design Three for the Child theme #2770
|
5 |
* Added: High-resolution Images [Additional image guidelines] option added in structure data #2259
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 0.9.97.45 (4th April 2019) =
|
4 |
+
* Added: SeoPress compatibility integrated #1589
|
5 |
+
* Added: WP Appbox compatibility integrated #2791
|
6 |
+
* Added: Infinite Scroll feature integrated. #2682
|
7 |
+
* Added: Facebook like button added in Sticky Social Share #2186
|
8 |
+
* Added: Font family for Content in Single page #2122
|
9 |
+
* Fixed: Custom post type categories not showing in amp pagebuilder #1993
|
10 |
+
* Fixed: Duplicate SiteNavigationElement issue #2952
|
11 |
+
* Fixed: AMP Theme Framework Multisite issue #2936
|
12 |
+
* Fixed: Custom AMP Editor Content is Not rendering when Elementor is activated #2901
|
13 |
+
* Fixed: Title issue on Homepage with Yoast if we select custom front page #2962
|
14 |
+
|
15 |
= 0.9.97.44.2 (1st April 2019) =
|
16 |
* Added: Element folder files override in the Design One, Design Two and Design Three for the Child theme #2770
|
17 |
* Added: High-resolution Images [Additional image guidelines] option added in structure data #2259
|
classes/class-ampforwp-infinite-scroll.php
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class: To enable Infinite Scroll in AMP
|
4 |
+
* Note: For performance reasons the component will render a maximum of three documents (total) on screen at one time. This limit may be changed or removed in the future.
|
5 |
+
* Read more about it here: https://www.ampproject.org/docs/reference/components/amp-next-page
|
6 |
+
*/
|
7 |
+
if( ! class_exists('AMPforWP_Infinite_Scroll') ) {
|
8 |
+
|
9 |
+
class AMPforWP_Infinite_Scroll
|
10 |
+
{
|
11 |
+
private $paged;
|
12 |
+
private $is_single = false;
|
13 |
+
private $is_loop = false;
|
14 |
+
function __construct()
|
15 |
+
{
|
16 |
+
$this->is_single = true == $this->is_single() ? $this->is_single() : $this->is_single;
|
17 |
+
$this->is_loop = true == $this->is_loop() ? $this->is_loop() : $this->is_loop;
|
18 |
+
$this->paged = $this->paged();
|
19 |
+
if ( $this->is_single ){
|
20 |
+
// amp-next-page experiment meta tag
|
21 |
+
add_action('amp_experiment_meta', array( $this, 'amp_experiment_meta') );
|
22 |
+
// amp-next-page script
|
23 |
+
add_filter('amp_post_template_data', array( $this , 'amp_infinite_scroll_script') );
|
24 |
+
// amp-next-page tag
|
25 |
+
if ( 4 != ampforwp_get_setting('amp-design-selector') )
|
26 |
+
add_action('ampforwp_above_related_post', array( $this , 'amp_next_page') );
|
27 |
+
else
|
28 |
+
add_action('ampforwp_single_design_type_handle', array( $this , 'amp_next_page') );
|
29 |
+
}
|
30 |
+
if ( $this->is_loop ) {
|
31 |
+
// amp-next-page experiment meta tag
|
32 |
+
add_action('amp_experiment_meta', array( $this, 'amp_experiment_meta') );
|
33 |
+
// amp-next-page script
|
34 |
+
add_filter('amp_post_template_data', array( $this , 'amp_infinite_scroll_script') );
|
35 |
+
// amp-next-page tag
|
36 |
+
add_action('ampforwp_loop_before_pagination', array( $this , 'amp_next_page') );
|
37 |
+
// Next Posts Link
|
38 |
+
add_filter('ampforwp_next_posts_link', array( $this , 'next_posts_link') , 10 , 2 );
|
39 |
+
}
|
40 |
+
}
|
41 |
+
public function is_single() {
|
42 |
+
if ( is_single() && true == ampforwp_get_setting('ampforwp-infinite-scroll-single') ) {
|
43 |
+
return true;
|
44 |
+
}
|
45 |
+
return false;
|
46 |
+
}
|
47 |
+
public function is_loop() {
|
48 |
+
if ( (ampforwp_is_home() || is_archive()) && true == ampforwp_get_setting('ampforwp-infinite-scroll-home') ) {
|
49 |
+
return true;
|
50 |
+
}
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
public function paged() {
|
54 |
+
if ( get_query_var( 'paged' ) ) {
|
55 |
+
return get_query_var('paged');
|
56 |
+
} elseif ( get_query_var( 'page' ) ) {
|
57 |
+
return get_query_var('page');
|
58 |
+
} else {
|
59 |
+
return 1;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
public function amp_experiment_meta() {
|
63 |
+
echo '<meta name="amp-experiments-opt-in" content="amp-next-page">';
|
64 |
+
}
|
65 |
+
|
66 |
+
public function amp_infinite_scroll_script( $data ) {
|
67 |
+
if ( empty( $data['amp_component_scripts']['amp-next-page'] ) ) {
|
68 |
+
$data['amp_component_scripts']['amp-next-page'] = 'https://cdn.ampproject.org/v0/amp-next-page-0.1.js';
|
69 |
+
}
|
70 |
+
return $data;
|
71 |
+
}
|
72 |
+
|
73 |
+
public function amp_next_page() {
|
74 |
+
$loop_link = $first_url = $first_title = $first_image = $second_url = $second_image = $second_title ='';
|
75 |
+
$single_links = $single_titles = $single_images = $classes = $pages = array();
|
76 |
+
if ( $this->is_loop ) {
|
77 |
+
$loop_link = $this->loop_link();
|
78 |
+
$loop_link1 = $loop_link2 = '';
|
79 |
+
$loop_link1 = $loop_link.($this->paged+1);
|
80 |
+
$loop_link2 = $loop_link.($this->paged+2);
|
81 |
+
if ( true == ampforwp_get_setting('amp-core-end-point') ) {
|
82 |
+
$loop_link1 = ampforwp_url_controller($loop_link1);
|
83 |
+
$loop_link2 = ampforwp_url_controller($loop_link2);
|
84 |
+
}
|
85 |
+
$pages[] = array('title'=>'','image'=>'','ampUrl'=>$loop_link1);
|
86 |
+
$pages[] = array('title'=>'','image'=>'','ampUrl'=>$loop_link2);
|
87 |
+
}
|
88 |
+
if ( $this->is_single ) {
|
89 |
+
$pages = $this->single_post();
|
90 |
+
}
|
91 |
+
$classes = $this->hide();
|
92 |
+
?>
|
93 |
+
<amp-next-page>
|
94 |
+
<script type="application/json">
|
95 |
+
{
|
96 |
+
"pages": <?=json_encode($pages)?>,
|
97 |
+
"hideSelectors": <?=$classes?>
|
98 |
+
}
|
99 |
+
</script>
|
100 |
+
</amp-next-page>
|
101 |
+
<?php }
|
102 |
+
public function single_post() {
|
103 |
+
global $post;
|
104 |
+
$pages = array();
|
105 |
+
$exclude_ids = get_option('ampforwp_exclude_post');
|
106 |
+
$exclude_ids[] = $post->ID;
|
107 |
+
$query_args = array(
|
108 |
+
'post_type' => get_post_type(),
|
109 |
+
'orderby' => 'date',
|
110 |
+
'ignore_sticky_posts' => 1,
|
111 |
+
'paged' => esc_attr($this->paged),
|
112 |
+
'post__not_in' => $exclude_ids,
|
113 |
+
'has_password' => false ,
|
114 |
+
'post_status'=> 'publish',
|
115 |
+
'posts_per_page' => 2
|
116 |
+
);
|
117 |
+
$query = new WP_Query( $query_args );
|
118 |
+
while ($query->have_posts()) {
|
119 |
+
$query->the_post();
|
120 |
+
$pages[] = array('title'=>get_the_title(),'image'=>ampforwp_get_post_thumbnail('url', 'full'),'ampUrl'=>ampforwp_url_controller( get_permalink() ));
|
121 |
+
}
|
122 |
+
wp_reset_postdata();
|
123 |
+
return $pages;
|
124 |
+
}
|
125 |
+
|
126 |
+
public function loop_link() {
|
127 |
+
global $wp;
|
128 |
+
$amp_url = trailingslashit(home_url($wp->request));
|
129 |
+
if( $this->paged < 2 ) {
|
130 |
+
$amp_url = trailingslashit($amp_url.'page');
|
131 |
+
}
|
132 |
+
else
|
133 |
+
$amp_url = str_replace('/'.$this->paged, '', $amp_url);
|
134 |
+
return $amp_url;
|
135 |
+
}
|
136 |
+
public function hide() {
|
137 |
+
$classes = array();
|
138 |
+
$design = ampforwp_get_setting('amp-design-selector');
|
139 |
+
if ( 1 == $design ) {
|
140 |
+
$classes = array("#pagination",".related_posts", ".amp-wp-footer",".amp-wp-header",".f-w");
|
141 |
+
}
|
142 |
+
if ( 2 == $design ) {
|
143 |
+
$classes = array("#headerwrap","#pagination","#footer",".nav_container",".related_posts",".f-w");
|
144 |
+
}
|
145 |
+
if ( 3 == $design ) {
|
146 |
+
$classes = array("#headerwrap",".relatedpost",".footer_wrapper",".pagination-holder",".f-w");
|
147 |
+
}
|
148 |
+
if ( 4 == $design ) {
|
149 |
+
$classes = array(".p-m-fl",".loop-pagination",".footer",".r-pf",".srp ul",".srp h3","#pagination",".h_m_w", ".f-w");
|
150 |
+
}
|
151 |
+
|
152 |
+
return json_encode($classes);
|
153 |
+
}
|
154 |
+
public function next_posts_link( $next_link , $paged ) {
|
155 |
+
// Change the next link to paged+3
|
156 |
+
// reason: amp-next-page will show the results for 3 pages
|
157 |
+
$next_link = preg_replace('/'.($paged+1).'/', ($paged+3), $next_link);
|
158 |
+
return $next_link;
|
159 |
+
}
|
160 |
+
}
|
161 |
+
// Initiate the Class
|
162 |
+
new AMPforWP_Infinite_Scroll();
|
163 |
+
}
|
components/components-core.php
CHANGED
@@ -337,7 +337,7 @@ function amp_header_core(){
|
|
337 |
<html <?php echo esc_attr(ampforwp_amp_nonamp_convert('amp ')); ?><?php echo AMP_HTML_Utils::build_attributes_string( $thisTemplate->get( 'html_tag_attributes' ) ); ?>>
|
338 |
<head>
|
339 |
<meta charset="utf-8">
|
340 |
-
|
341 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
342 |
<?php do_action( 'amp_meta', $thisTemplate ); ?>
|
343 |
<?php
|
337 |
<html <?php echo esc_attr(ampforwp_amp_nonamp_convert('amp ')); ?><?php echo AMP_HTML_Utils::build_attributes_string( $thisTemplate->get( 'html_tag_attributes' ) ); ?>>
|
338 |
<head>
|
339 |
<meta charset="utf-8">
|
340 |
+
<?php do_action('amp_experiment_meta', $thisTemplate); ?>
|
341 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
342 |
<?php do_action( 'amp_meta', $thisTemplate ); ?>
|
343 |
<?php
|
components/loop/loop.php
CHANGED
@@ -262,11 +262,13 @@ function amp_pagination($args =array()) {
|
|
262 |
|
263 |
<div class="loop-pagination"><?php
|
264 |
if ( get_next_posts_link( $args['next_text'], $amp_q->max_num_pages ) ) {
|
265 |
-
|
|
|
266 |
}
|
267 |
if ( get_previous_posts_link() ) {
|
268 |
-
|
269 |
-
|
|
|
270 |
<div class="clearfix"></div>
|
271 |
</div><?php
|
272 |
|
262 |
|
263 |
<div class="loop-pagination"><?php
|
264 |
if ( get_next_posts_link( $args['next_text'], $amp_q->max_num_pages ) ) {
|
265 |
+
$next_link = '<div class="right">'. apply_filters('ampforwp_next_posts_link',get_next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-more-posts-text'] , $args['next_text']), $amp_q->max_num_pages ), $paged) .'</div>';
|
266 |
+
echo $next_link;
|
267 |
}
|
268 |
if ( get_previous_posts_link() ) {
|
269 |
+
$pre_link = '<div class="left">'.apply_filters('ampforwp_previous_posts_link',get_previous_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-show-previous-posts-text'], $args['previous_text'] ) ), $paged ) .'</div>';
|
270 |
+
echo $pre_link;
|
271 |
+
} ?>
|
272 |
<div class="clearfix"></div>
|
273 |
</div><?php
|
274 |
|
includes/admin-script.js
CHANGED
@@ -225,15 +225,27 @@ jQuery(function($) {
|
|
225 |
}
|
226 |
|
227 |
|
228 |
-
var gURL, gAPIkey;
|
229 |
|
230 |
|
231 |
-
gAPIkey = redux_data.google_font_api_key;
|
232 |
-
|
|
|
|
|
|
|
233 |
// Append data into selects
|
234 |
ampforwp_font_generator();
|
235 |
function ampforwp_font_generator() {
|
236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
if ( ! gAPIkey){
|
238 |
gAPIkey = $('#google_font_api_key').val();
|
239 |
}
|
@@ -242,12 +254,35 @@ jQuery(function($) {
|
|
242 |
$('.ampforwp-google-font-class').css({'display':'none'});
|
243 |
return ;
|
244 |
}
|
245 |
-
|
|
|
|
|
|
|
246 |
gURL = "https://www.googleapis.com/webfonts/v1/webfonts?key=" + gAPIkey;
|
247 |
|
248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
|
250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
var values = Object.values(data.items);
|
252 |
var allFonts = [];
|
253 |
|
@@ -297,91 +332,94 @@ jQuery(function($) {
|
|
297 |
}
|
298 |
|
299 |
});
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
|
|
|
|
|
|
307 |
|
308 |
-
|
|
|
309 |
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
if(redux_data.amp_font_selector==''){
|
319 |
-
redux_data.amp_font_selector = 'Poppins'
|
320 |
-
}
|
321 |
-
$('#s2id_amp_font_selector-select .select2-chosen').html(redux_data.amp_font_selector);
|
322 |
|
323 |
-
|
324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
|
326 |
-
$('#amp_font_selector_content_single-select option[value="'+redux_data.amp_font_selector+'"]').attr("selected", "selected");
|
327 |
-
$('#amp_font_selector_content_single-select').val(redux_data.amp_font_selector).trigger("change");
|
328 |
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
redux_data.amp_font_type = ['regular','500','700'];
|
343 |
-
}
|
344 |
-
// Add Default selected
|
345 |
-
if ( redux_data.amp_font_type ) {
|
346 |
-
$('#s2id_autogen4').remove();
|
347 |
-
for (var i in redux_data.amp_font_type) {
|
348 |
-
$('#s2id_amp_font_type-select ul').append('<li class="select2-search-choice"> <div> '+redux_data.amp_font_type[i]+'</div> <a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>');
|
349 |
-
//s2.append($('<option>').text(e));
|
350 |
-
$('#amp_font_type-select option[value='+redux_data.amp_font_type[i]+']').attr('selected','selected').trigger('change');
|
351 |
-
$('#amp_font_type_content_single-select option[value='+redux_data.amp_font_type[i]+']').attr('selected','selected').trigger('change');
|
352 |
}
|
353 |
-
|
354 |
-
}
|
355 |
-
});
|
356 |
|
357 |
-
|
|
|
358 |
|
359 |
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
|
370 |
-
$(".redux_field_search").keypress(function (evt) {
|
371 |
-
//Deterime where our character code is coming from within the event
|
372 |
-
var charCode = evt.charCode || evt.keyCode;
|
373 |
-
if (charCode == 13) { //Enter key's keycode
|
374 |
-
return false;
|
375 |
-
}
|
376 |
-
});
|
377 |
|
378 |
-
|
379 |
-
|
380 |
-
var srcLink = $("#amp-preview-iframe").attr('data-src');
|
381 |
-
$("#amp-preview-iframe").html("<iframe src='"+srcLink+"'></iframe>");
|
382 |
-
});
|
383 |
-
}
|
384 |
-
|
385 |
});
|
386 |
var dataTabRequired = function(){
|
387 |
$('[data-tab-required]').each(function(){
|
225 |
}
|
226 |
|
227 |
|
228 |
+
var gURL, gAPIkey, disableGFonts;
|
229 |
|
230 |
|
231 |
+
gAPIkey = redux_data.google_font_api_key;
|
232 |
+
disableGFonts = redux_data.amp_google_font_restrict;
|
233 |
+
if(gAPIkey=='' || typeof gAPIkey == 'undefined'){
|
234 |
+
$('.ampforwp-google-font-restrict').css({'display':'none'});
|
235 |
+
}
|
236 |
// Append data into selects
|
237 |
ampforwp_font_generator();
|
238 |
function ampforwp_font_generator() {
|
239 |
|
240 |
+
gAPIkey = redux_data.google_font_api_key;
|
241 |
+
disableGFonts = redux_data.amp_google_font_restrict;
|
242 |
+
if($("#google_font_api_key").length>0){
|
243 |
+
$("#google_font_api_key").after("<input type='submit' value='Verify'>");
|
244 |
+
}
|
245 |
+
if(gAPIkey=='' || typeof gAPIkey == 'undefined'){
|
246 |
+
$('.ampforwp-google-font-restrict').css({'display':'none'});
|
247 |
+
}
|
248 |
+
|
249 |
if ( ! gAPIkey){
|
250 |
gAPIkey = $('#google_font_api_key').val();
|
251 |
}
|
254 |
$('.ampforwp-google-font-class').css({'display':'none'});
|
255 |
return ;
|
256 |
}
|
257 |
+
if(disableGFonts==1){
|
258 |
+
gAPIkey='';
|
259 |
+
return;
|
260 |
+
}
|
261 |
gURL = "https://www.googleapis.com/webfonts/v1/webfonts?key=" + gAPIkey;
|
262 |
|
263 |
+
|
264 |
+
if (localStorage.getItem("googlefontapidata") === null) {
|
265 |
+
var gfontData = $.get( gURL );
|
266 |
+
gfontData.done(function( data ) {
|
267 |
+
localStorage.setItem('googlefontapidata', JSON.stringify(data));
|
268 |
+
ampforwp_fonts_select_data(data);
|
269 |
+
});
|
270 |
|
271 |
+
gfontData.fail(function(data) {
|
272 |
+
$('#redux_builder_amp-google_font_api_key').append('<p style="color:red"> Could not connect to API, please double check your API key. </p> ');
|
273 |
+
$('.ampforwp-google-font-class').css({'display':'none'});
|
274 |
+
});
|
275 |
+
gfontData.always(function(){
|
276 |
+
amp_font_selector_select_change();
|
277 |
+
})
|
278 |
+
}else{
|
279 |
+
data = localStorage.getItem("googlefontapidata");
|
280 |
+
ampforwp_fonts_select_data(JSON.parse(data));
|
281 |
+
amp_font_selector_select_change();
|
282 |
+
}
|
283 |
+
|
284 |
+
}
|
285 |
+
function ampforwp_fonts_select_data(data){
|
286 |
var values = Object.values(data.items);
|
287 |
var allFonts = [];
|
288 |
|
332 |
}
|
333 |
|
334 |
});
|
335 |
+
}
|
336 |
+
function amp_font_selector_select_change(){
|
337 |
+
if($('#amp_font_selector-select').length>0){
|
338 |
+
// Adding Default Font Family
|
339 |
+
$('#s2id_amp_font_selector-select a').removeClass('select2-default');
|
340 |
+
|
341 |
+
if(redux_data.amp_font_selector==''){
|
342 |
+
redux_data.amp_font_selector = 'Poppins'
|
343 |
+
}
|
344 |
+
$('#s2id_amp_font_selector-select .select2-chosen').html(redux_data.amp_font_selector);
|
345 |
|
346 |
+
$('#amp_font_selector-select option[value="'+redux_data.amp_font_selector+'"]').attr("selected", "selected");
|
347 |
+
$('#amp_font_selector-select').val(redux_data.amp_font_selector).trigger("change");
|
348 |
|
349 |
+
// Build select data
|
350 |
+
let fontData = redux_data.google_current_font_data;
|
351 |
+
// fontData = JSON.parse(fontData);
|
352 |
+
console.log(fontData);
|
353 |
+
if (! fontData.variants) {
|
354 |
+
//$('.select2-search-choice').remove();
|
355 |
+
//$('#amp_font_type-select').html('<option></option>');
|
|
|
|
|
|
|
|
|
|
|
356 |
|
357 |
+
for (var i in fontData.variants) {
|
358 |
+
$('#amp_font_type-select').append($("<option value='"+ fontData.variants[i] +"' > "+fontData.variants[i]+"</option>")).trigger('change');
|
359 |
+
}
|
360 |
+
}
|
361 |
+
|
362 |
+
if(redux_data.amp_font_type==''){
|
363 |
+
redux_data.amp_font_type = ['regular','500','700'];
|
364 |
+
}
|
365 |
+
// Add Default selected
|
366 |
+
if ( redux_data.amp_font_type ) {
|
367 |
+
$('#s2id_autogen4').remove();
|
368 |
+
for (var i in redux_data.amp_font_type) {
|
369 |
+
$('#s2id_amp_font_type-select ul').append('<li class="select2-search-choice"> <div> '+redux_data.amp_font_type[i]+'</div> <a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>');
|
370 |
+
//s2.append($('<option>').text(e));
|
371 |
+
$('#amp_font_type-select option[value='+redux_data.amp_font_type[i]+']').attr('selected','selected').trigger('change');
|
372 |
+
}
|
373 |
+
}
|
374 |
+
}//#amp_font_selector-select closed
|
375 |
|
|
|
|
|
376 |
|
377 |
+
/************
|
378 |
+
* Content Font Selectors On load work
|
379 |
+
* amp_font_selector_content_single
|
380 |
+
*
|
381 |
+
*********/
|
|
|
382 |
|
383 |
+
if($('#amp_font_selector_content_single-select').length>0){
|
384 |
+
// Adding Default Font Family
|
385 |
+
$('#s2id_amp_font_selector_content_single-select a').removeClass('select2-default');
|
386 |
+
|
387 |
+
if(redux_data.amp_font_selector_content_single==''){
|
388 |
+
redux_data.amp_font_selector_content_single = 'Poppins'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
}
|
390 |
+
$('#s2id_amp_font_selector_content_single-select .select2-chosen').html(redux_data.amp_font_selector_content_single);
|
|
|
|
|
391 |
|
392 |
+
$('#amp_font_selector_content_single-select option[value="'+redux_data.amp_font_selector_content_single+'"]').attr("selected", "selected");
|
393 |
+
$('#amp_font_selector_content_single-select').val(redux_data.amp_font_selector_content_single).trigger("change");
|
394 |
|
395 |
|
396 |
+
// Build select data
|
397 |
+
let fontData = redux_data.google_current_font_data_content_single;
|
398 |
+
// fontData = JSON.parse(fontData);
|
399 |
+
if (! fontData.variants) {
|
400 |
+
for (var i in fontData.variants) {
|
401 |
+
$('#amp_font_selector_content_single-select').append($("<option value='"+ fontData.variants[i] +"' > "+fontData.variants[i]+"</option>")).trigger('change');
|
402 |
+
}
|
403 |
+
}
|
404 |
+
|
405 |
+
if(redux_data.amp_font_type_content_single==''){
|
406 |
+
redux_data.amp_font_type_content_single = ['regular','500','700'];
|
407 |
+
}
|
408 |
+
// Add Default selected
|
409 |
+
if ( redux_data.amp_font_type_content_single ) {
|
410 |
+
$('#s2id_autogen4').remove();
|
411 |
+
for (var i in redux_data.amp_font_type_content_single) {
|
412 |
+
$('#s2id_amp_font_type_content_single-select ul').append('<li class="select2-search-choice"> <div> '+redux_data.amp_font_type_content_single[i]+'</div> <a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>');
|
413 |
+
//s2.append($('<option>').text(e));
|
414 |
+
$('#amp_font_type_content_single-select option[value='+redux_data.amp_font_type_content_single[i]+']').attr('selected','selected').trigger('change');
|
415 |
+
}
|
416 |
+
}
|
417 |
+
}//#amp_font_selector_content_single-select closed
|
418 |
+
}
|
419 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
|
421 |
+
/*---------Google Fonts Ends -------*/
|
422 |
+
|
|
|
|
|
|
|
|
|
|
|
423 |
});
|
424 |
var dataTabRequired = function(){
|
425 |
$('[data-tab-required]').each(function(){
|
includes/options/admin-config.php
CHANGED
@@ -1865,6 +1865,9 @@ if ( !is_plugin_active('ads-for-wp/ads-for-wp.php') ) {
|
|
1865 |
elseif ( function_exists('genesis_title') ) {
|
1866 |
$default = 'genesis';
|
1867 |
}
|
|
|
|
|
|
|
1868 |
return $default;
|
1869 |
}
|
1870 |
}
|
@@ -1914,6 +1917,7 @@ if ( !is_plugin_active('ads-for-wp/ads-for-wp.php') ) {
|
|
1914 |
'aioseo' => 'All in One SEO',
|
1915 |
'rank_math' => 'Rank Math SEO',
|
1916 |
'genesis' => 'Genesis',
|
|
|
1917 |
),
|
1918 |
'default' => ampforwp_seo_default(),
|
1919 |
),
|
@@ -3658,6 +3662,29 @@ Redux::setSection( $opt_name, array(
|
|
3658 |
'default' => 1,
|
3659 |
'required' => array( 'amp-mobile-redirection', '=' , 1 )
|
3660 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3661 |
array(
|
3662 |
'id' => 'convert-internal-nonamplinks-to-amp',
|
3663 |
'type' => 'switch',
|
@@ -4351,6 +4378,11 @@ Redux::setSection( $opt_name, array(
|
|
4351 |
$pluginsData = get_transient( 'ampforwp_themeframework_active_plugins' );
|
4352 |
if( empty( $pluginsData )){
|
4353 |
$activePlugins = get_option( 'active_plugins', array() );
|
|
|
|
|
|
|
|
|
|
|
4354 |
if(count( $activePlugins)>0){
|
4355 |
foreach ( $activePlugins as $key => $value) {
|
4356 |
$plugin = get_plugin_data(WP_PLUGIN_DIR.'/'.$value);
|
@@ -4530,9 +4562,9 @@ Redux::setSection( $opt_name, array(
|
|
4530 |
'type' => 'section',
|
4531 |
'title' => esc_html__('Typography', 'accelerated-mobile-pages'),
|
4532 |
'indent' => true,
|
4533 |
-
|
4534 |
array('amp-design-selector', '=' , '4')
|
4535 |
-
)
|
4536 |
'layout_type' => 'accordion',
|
4537 |
'accordion-open'=> 1,
|
4538 |
));
|
@@ -4567,6 +4599,14 @@ Redux::setSection( $opt_name, array(
|
|
4567 |
array('amp-design-selector', '=' , '1')
|
4568 |
)
|
4569 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4570 |
array(
|
4571 |
'id' =>'google_font_api_key',
|
4572 |
'type' =>'text',
|
@@ -4574,6 +4614,7 @@ Redux::setSection( $opt_name, array(
|
|
4574 |
'tooltip-subtitle' => esc_html__('You can get the Link ','accelerated-mobile-pages').'<a target="_blank" href="https://developers.google.com/fonts/docs/developer_api?refresh=1&pli=1#APIKey">'.esc_html__('form here','accelerated-mobile-pages').'</a>',
|
4575 |
'default' =>'',
|
4576 |
'required' => array(
|
|
|
4577 |
array('amp-design-selector', '=' , '4')
|
4578 |
)
|
4579 |
),
|
@@ -4588,6 +4629,7 @@ Redux::setSection( $opt_name, array(
|
|
4588 |
),
|
4589 |
'default' => '',
|
4590 |
'required' => array(
|
|
|
4591 |
array('amp-design-selector', '=' , '4')
|
4592 |
)
|
4593 |
|
@@ -4604,6 +4646,7 @@ Redux::setSection( $opt_name, array(
|
|
4604 |
),
|
4605 |
'default' => '',
|
4606 |
'required' => array(
|
|
|
4607 |
array('amp-design-selector', '=' , '4')
|
4608 |
)
|
4609 |
|
@@ -4615,7 +4658,8 @@ Redux::setSection( $opt_name, array(
|
|
4615 |
'title' =>esc_html__('Google Font Current Font','accelerated-mobile-pages'),
|
4616 |
'default' =>'',
|
4617 |
'required' => array(
|
4618 |
-
array('amp-design-selector', '=' , '4')
|
|
|
4619 |
)
|
4620 |
),
|
4621 |
array(
|
@@ -4628,6 +4672,7 @@ Redux::setSection( $opt_name, array(
|
|
4628 |
),
|
4629 |
'default' => '0' ,
|
4630 |
'required' => array(
|
|
|
4631 |
array('amp-design-selector', '=' , '4')
|
4632 |
)
|
4633 |
),
|
@@ -4642,6 +4687,7 @@ Redux::setSection( $opt_name, array(
|
|
4642 |
),
|
4643 |
'default' => '',
|
4644 |
'required' => array(
|
|
|
4645 |
array('amp-design-selector', '=' , '4'),
|
4646 |
array('content-font-family-enable', '=' , '1'),
|
4647 |
)
|
@@ -4659,6 +4705,7 @@ Redux::setSection( $opt_name, array(
|
|
4659 |
),
|
4660 |
'default' => '',
|
4661 |
'required' => array(
|
|
|
4662 |
array('amp-design-selector', '=' , '4'),
|
4663 |
array('content-font-family-enable', '=' , '1')
|
4664 |
)
|
@@ -4671,7 +4718,8 @@ Redux::setSection( $opt_name, array(
|
|
4671 |
'title' =>esc_html__('Google Font Current Font','accelerated-mobile-pages'),
|
4672 |
'default' =>'',
|
4673 |
'required' => array(
|
4674 |
-
array('amp-design-selector', '=' , '4')
|
|
|
4675 |
)
|
4676 |
)
|
4677 |
);
|
1865 |
elseif ( function_exists('genesis_title') ) {
|
1866 |
$default = 'genesis';
|
1867 |
}
|
1868 |
+
elseif ( is_plugin_active('wp-seopress/seopress.php') ) {
|
1869 |
+
$default = 'seopress';
|
1870 |
+
}
|
1871 |
return $default;
|
1872 |
}
|
1873 |
}
|
1917 |
'aioseo' => 'All in One SEO',
|
1918 |
'rank_math' => 'Rank Math SEO',
|
1919 |
'genesis' => 'Genesis',
|
1920 |
+
'seopress' => 'SEOPress',
|
1921 |
),
|
1922 |
'default' => ampforwp_seo_default(),
|
1923 |
),
|
3662 |
'default' => 1,
|
3663 |
'required' => array( 'amp-mobile-redirection', '=' , 1 )
|
3664 |
),
|
3665 |
+
array(
|
3666 |
+
'id' => 'ampforwp-infinite-scroll',
|
3667 |
+
'type' => 'switch',
|
3668 |
+
'title' => esc_html__('Infinite Scroll (Experimental)', 'accelerated-mobile-pages'),
|
3669 |
+
'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a>', esc_html__('Read more about it here:', 'accelerated-mobile-pages'), esc_url('https://www.ampproject.org/docs/reference/components/amp-next-page'), esc_html__('amp-next-page','accelerated-mobile-pages')),
|
3670 |
+
'default' => false,
|
3671 |
+
),
|
3672 |
+
array(
|
3673 |
+
'id' => 'ampforwp-infinite-scroll-home',
|
3674 |
+
'type' => 'switch',
|
3675 |
+
'class' => 'child_opt child_opt_arrow',
|
3676 |
+
'title' => esc_html__('Home & Archives', 'accelerated-mobile-pages'),
|
3677 |
+
'default' => true,
|
3678 |
+
'required' => array( 'ampforwp-infinite-scroll', '=' , 1 )
|
3679 |
+
),
|
3680 |
+
array(
|
3681 |
+
'id' => 'ampforwp-infinite-scroll-single',
|
3682 |
+
'type' => 'switch',
|
3683 |
+
'class' => 'child_opt child_opt_arrow',
|
3684 |
+
'title' => esc_html__('Single', 'accelerated-mobile-pages'),
|
3685 |
+
'default' => true,
|
3686 |
+
'required' => array( 'ampforwp-infinite-scroll', '=' , 1 )
|
3687 |
+
),
|
3688 |
array(
|
3689 |
'id' => 'convert-internal-nonamplinks-to-amp',
|
3690 |
'type' => 'switch',
|
4378 |
$pluginsData = get_transient( 'ampforwp_themeframework_active_plugins' );
|
4379 |
if( empty( $pluginsData )){
|
4380 |
$activePlugins = get_option( 'active_plugins', array() );
|
4381 |
+
if(is_multisite()){
|
4382 |
+
$activePlugins_multi = get_site_option('active_sitewide_plugins');
|
4383 |
+
$activePlugins_multi = array_keys($activePlugins_multi);
|
4384 |
+
$activePlugins = array_merge($activePlugins, $activePlugins_multi);
|
4385 |
+
}
|
4386 |
if(count( $activePlugins)>0){
|
4387 |
foreach ( $activePlugins as $key => $value) {
|
4388 |
$plugin = get_plugin_data(WP_PLUGIN_DIR.'/'.$value);
|
4562 |
'type' => 'section',
|
4563 |
'title' => esc_html__('Typography', 'accelerated-mobile-pages'),
|
4564 |
'indent' => true,
|
4565 |
+
'required' => array(
|
4566 |
array('amp-design-selector', '=' , '4')
|
4567 |
+
),
|
4568 |
'layout_type' => 'accordion',
|
4569 |
'accordion-open'=> 1,
|
4570 |
));
|
4599 |
array('amp-design-selector', '=' , '1')
|
4600 |
)
|
4601 |
),
|
4602 |
+
array(
|
4603 |
+
'id' => 'ampforwp-google-font-switch',
|
4604 |
+
'type' => 'switch',
|
4605 |
+
'title' => esc_html__('Google Fonts', 'accelerated-mobile-pages'),
|
4606 |
+
'tooltip-subtitle' => esc_html__('Enable/Disable Google Font','accelerated-mobile-pages'),
|
4607 |
+
'default' => $enabledGoogleFonts,
|
4608 |
+
'required' => array(array('amp-design-selector', '=' , '4'))
|
4609 |
+
),
|
4610 |
array(
|
4611 |
'id' =>'google_font_api_key',
|
4612 |
'type' =>'text',
|
4614 |
'tooltip-subtitle' => esc_html__('You can get the Link ','accelerated-mobile-pages').'<a target="_blank" href="https://developers.google.com/fonts/docs/developer_api?refresh=1&pli=1#APIKey">'.esc_html__('form here','accelerated-mobile-pages').'</a>',
|
4615 |
'default' =>'',
|
4616 |
'required' => array(
|
4617 |
+
array('ampforwp-google-font-switch', '=', '1'),
|
4618 |
array('amp-design-selector', '=' , '4')
|
4619 |
)
|
4620 |
),
|
4629 |
),
|
4630 |
'default' => '',
|
4631 |
'required' => array(
|
4632 |
+
array('ampforwp-google-font-switch', '=', '1'),
|
4633 |
array('amp-design-selector', '=' , '4')
|
4634 |
)
|
4635 |
|
4646 |
),
|
4647 |
'default' => '',
|
4648 |
'required' => array(
|
4649 |
+
array('ampforwp-google-font-switch', '=', '1'),
|
4650 |
array('amp-design-selector', '=' , '4')
|
4651 |
)
|
4652 |
|
4658 |
'title' =>esc_html__('Google Font Current Font','accelerated-mobile-pages'),
|
4659 |
'default' =>'',
|
4660 |
'required' => array(
|
4661 |
+
array('amp-design-selector', '=' , '4'),
|
4662 |
+
array('ampforwp-google-font-switch', '=', '1'),
|
4663 |
)
|
4664 |
),
|
4665 |
array(
|
4672 |
),
|
4673 |
'default' => '0' ,
|
4674 |
'required' => array(
|
4675 |
+
array('ampforwp-google-font-switch', '=', '1'),
|
4676 |
array('amp-design-selector', '=' , '4')
|
4677 |
)
|
4678 |
),
|
4687 |
),
|
4688 |
'default' => '',
|
4689 |
'required' => array(
|
4690 |
+
array('ampforwp-google-font-switch', '=', '1'),
|
4691 |
array('amp-design-selector', '=' , '4'),
|
4692 |
array('content-font-family-enable', '=' , '1'),
|
4693 |
)
|
4705 |
),
|
4706 |
'default' => '',
|
4707 |
'required' => array(
|
4708 |
+
array('ampforwp-google-font-switch', '=', '1'),
|
4709 |
array('amp-design-selector', '=' , '4'),
|
4710 |
array('content-font-family-enable', '=' , '1')
|
4711 |
)
|
4718 |
'title' =>esc_html__('Google Font Current Font','accelerated-mobile-pages'),
|
4719 |
'default' =>'',
|
4720 |
'required' => array(
|
4721 |
+
array('amp-design-selector', '=' , '4'),
|
4722 |
+
array('ampforwp-google-font-switch', '=', '1'),
|
4723 |
)
|
4724 |
)
|
4725 |
);
|
includes/thirdparty-compatibility.php
CHANGED
@@ -660,4 +660,430 @@ function ampforwp_simple_author_box(){
|
|
660 |
if( class_exists('Simple_Author_Box') ){ ?>
|
661 |
.saboxplugin-wrap .saboxplugin-gravatar amp-img {max-width: 100px;height: auto;}
|
662 |
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
663 |
}
|
660 |
if( class_exists('Simple_Author_Box') ){ ?>
|
661 |
.saboxplugin-wrap .saboxplugin-gravatar amp-img {max-width: 100px;height: auto;}
|
662 |
<?php }
|
663 |
+
}
|
664 |
+
|
665 |
+
// WP-AppBox CSS #2791
|
666 |
+
add_action('amp_post_template_css', 'ampforwp_app_box_styles');
|
667 |
+
function ampforwp_app_box_styles(){
|
668 |
+
if ( function_exists('wpAppbox_createAppbox') ) { ?>
|
669 |
+
.wpappbox{clear:both;background-color:#F9F9F9;line-height:1.4;color:#545450;margin:16px 0;font-size:15px;border:1px solid #E5E5E5;box-shadow:0 0 8px 1px rgba(0,0,0,.11);border-radius:8px;display:inline-block;width:100%}.wpappbox a{transition:all .3s ease-in-out 0s}.wpappbox.compact .appicon{height:66px;width:68px;float:left;padding:6px;margin-right:15px}.appicon amp-img{max-width:92px;height:92px;border-radius:5%}.wpappbox a:hover amp-img{opacity:.9;filter:alpha(opacity=90);-webkit-filter:grayscale(100%)}.wpappbox .appicon{position:relative;height:112px;width:112px;float:left;padding:10px;background:#FFF;text-align:center;border-right:1px solid #E5E5E5;border-top-left-radius:6px;border-bottom-left-radius:6px;margin-right:10px}.wpappbox .appdetails{margin-top:15px}.wpappbox .appbuttons a{font-size:13px;box-shadow:0 1px 3px 0 rgba(0,0,0,.15);background:#F1F1F1;border-bottom:0;color:#323232;padding:3px 5px;display:inline-block;margin:12px 0 0;border-radius:3px;cursor:pointer;font-weight:400}.wpappbox .appbuttons a:hover{color:#fff;background:#111}.wpappbox div.applinks,div.wpappbox.compact a.applinks{float:right;position:relative;background:#FFF;text-align:center;border-left:1px solid #E5E5E5;border-top-right-radius:6px;border-bottom-right-radius:6px}.wpappbox div.applinks{height:112px;width:92px;display:block}.wpappbox .apptitle,.wpappbox .developer{margin-bottom:15px}.wpappbox .developer a{color:#333}.wpappbox .apptitle a{font-size:18px;font-weight:500;color:#333}.wpappbox .apptitle a:hover,.wpappbox .developer a:hover{color:#5588b5}.wpappbox .appbuttons span,.wpappbox .qrcode{display:none}.wpappbox.screenshots>div.screenshots{width:auto;margin:0 auto;padding:10px;clear:both;border-top:1px solid #E5E5E5}.wpappbox .screenshots .slider>ul>li{padding:0;margin:0 6px 0 0;list-style-type:none;display:inline-block}.wpappbox .screenshots .slider{overflow-x:scroll;overflow-y:hidden;height:320px;margin-top:0}.wpappbox .screenshots .slider>ul{display:inline-flex;width:100%}.wpappbox .screenshots .slider>ul>li amp-img{height:320px;display:inline-block;}
|
670 |
+
div.wpappbox div.appbuttons {position: absolute;bottom: 30px;width: 92px;}
|
671 |
+
<?php $wpappbox_image_path = plugins_url().'/wp-appbox/img/'; ?>
|
672 |
+
div.wpappbox:not(.colorful) div.applinks {filter: grayscale(100%);}
|
673 |
+
div.wpappbox .applinks, div.wpappbox div.applinks{background-color: #FFF;}
|
674 |
+
div.wpappbox.amazonapps a.applinks, div.wpappbox.amazonapps div.applinks {background: url(<?php echo esc_url($wpappbox_image_path.'amazonapps.png'); ?>);background-repeat: no-repeat;background-size: auto 42px;background-position: center 7px;}
|
675 |
+
div.wpappbox.appstore a.applinks, div.wpappbox.appstore div.applinks {background: url(<?php echo esc_url($wpappbox_image_path.'appstore.png'); ?>);background-repeat: no-repeat;background-size: auto 42px;background-position: center 7px;}
|
676 |
+
div.wpappbox.chromewebstore a.applinks, div.wpappbox.chromewebstore div.applinks{background: url(<?php echo esc_url($wpappbox_image_path.'chromewebstore.png'); ?>);background-repeat: no-repeat;background-size: auto 42px;background-position: center 7px;}
|
677 |
+
div.wpappbox.firefoxaddon a.applinks, div.wpappbox.firefoxaddon div.applinks{background: url(<?php echo esc_url($wpappbox_image_path.'firefoxaddon.png'); ?>);background-repeat: no-repeat;background-size: auto 42px;background-position: center 7px;}
|
678 |
+
div.wpappbox.googleplay a.applinks, div.wpappbox.googleplay div.applinks{background: url(<?php echo esc_url($wpappbox_image_path.'googleplay.png'); ?>);background-repeat: no-repeat;background-size: auto 42px;background-position: center 7px;}
|
679 |
+
div.wpappbox.operaaddons a.applinks, div.wpappbox.operaaddons div.applinks{background: url(<?php echo esc_url($wpappbox_image_path.'operaaddons.png'); ?>);background-repeat: no-repeat;background-size: auto 42px;background-position: center 7px;}
|
680 |
+
div.wpappbox.steam a.applinks, div.wpappbox.steam div.applinks{background: url(<?php echo esc_url($wpappbox_image_path.'steam.png'); ?>);background-repeat: no-repeat;background-size: auto 42px;background-position: center 7px;}
|
681 |
+
div.wpappbox.windowsstore a.applinks, div.wpappbox.windowsstore div.applinks{background: url(<?php echo esc_url($wpappbox_image_path.'windowsstore.png'); ?>);background-repeat: no-repeat;background-size: auto 42px;background-position: center 7px;}
|
682 |
+
div.wpappbox.wordpress a.applinks, div.wpappbox.wordpress div.applinks{background: url(<?php echo esc_url($wpappbox_image_path.'wordpress.png'); ?>);background-repeat: no-repeat;background-size: auto 42px;background-position: center 7px;}
|
683 |
+
div.wpappbox.xda a.applinks, div.wpappbox.xda div.applinks{background: url(<?php echo esc_url($wpappbox_image_path.'xda.png'); ?>);background-repeat: no-repeat;background-size: auto 42px;background-position: center 7px;}
|
684 |
+
div.wpappbox div.stars-monochrome {background: url(<?php echo esc_url($wpappbox_image_path.'stars-sprites-monochrome.png'); ?>) no-repeat;}
|
685 |
+
div.wpappbox div.rating-stars {width: 65px;height: 13px;margin-left: 5px;margin-top: 4px;display: inline-block;}
|
686 |
+
div.wpappbox div.stars50 {background-position: 0 -130px;}
|
687 |
+
div.wpappbox div.stars45 {background-position: 0 -117px;}
|
688 |
+
div.wpappbox div.stars40 {background-position: 0 -104px;}
|
689 |
+
div.wpappbox div.stars35 {background-position: 0 -91px;}
|
690 |
+
div.wpappbox div.stars30 {background-position: 0 -78px;}
|
691 |
+
div.wpappbox div.stars25 {background-position: 0px -65px;}
|
692 |
+
div.wpappbox div.stars20 {background-position: 0px -52px;}
|
693 |
+
div.wpappbox div.stars15 {background-position: 0px -39px;}
|
694 |
+
div.wpappbox div.stars10 {background-position: 0px -26px;}
|
695 |
+
div.wpappbox div.stars5 {background-position: 0px -12px;}
|
696 |
+
div.wpappbox div.stars0 {background-position: 0px -0px;}
|
697 |
+
@media(max-width:500px){.appicon amp-img{max-width:70px;height:70px}.wpappbox .appicon{height:90px;width:90px;display:inline-block;vertical-align:middle;}.wpappbox .apptitle a{font-size:14px}.wpappbox{font-size:13px;text-align:center;padding:10px 0}.wpappbox .apptitle,.wpappbox .developer{margin-bottom:6px}.wpappbox .appdetails{text-align:left;padding-left:10px}.wpappbox .screenshots .slider{height:290px}.wpappbox .screenshots .slider>ul>li amp-img{max-width:160px;height:280px}
|
698 |
+
.wpappbox div.applinks{display:none;}}
|
699 |
+
<?php
|
700 |
+
} // ampforwp_app_box_styles Function Ends
|
701 |
+
}
|
702 |
+
|
703 |
+
// SEOPress Compatibility #1589
|
704 |
+
add_action('amp_post_template_head', 'ampforwp_seopress_social');
|
705 |
+
function ampforwp_seopress_social(){
|
706 |
+
$options = $facebook = $twitter = $advanced_options = $seopress_social_og_title = $seopress_social_og_desc = '';
|
707 |
+
$post_id = ampforwp_get_the_ID();
|
708 |
+
$options = get_option("seopress_social_option_name");
|
709 |
+
$advanced_options = get_option("seopress_advanced_option_name");
|
710 |
+
if ( !empty($options) ) {
|
711 |
+
if (isset($options['seopress_social_facebook_og'])) {
|
712 |
+
global $wp;
|
713 |
+
if (isset($advanced_options['seopress_advanced_advanced_trailingslash']) ) {
|
714 |
+
$current_url = home_url(add_query_arg(array(), $wp->request));
|
715 |
+
} else {
|
716 |
+
$current_url = trailingslashit(home_url(add_query_arg(array(), $wp->request)));
|
717 |
+
}
|
718 |
+
if (is_search()) {
|
719 |
+
$seopress_social_og_url = '<meta property="og:url" content="'.esc_url(htmlspecialchars(urldecode(get_home_url().'/search/'.get_search_query()))).'" />';
|
720 |
+
} else {
|
721 |
+
$seopress_social_og_url = '<meta property="og:url" content="'.esc_url(htmlspecialchars(urldecode($current_url),ENT_COMPAT, 'UTF-8')).'" />';
|
722 |
+
}
|
723 |
+
//Hook on post OG URL - 'seopress_social_og_url'
|
724 |
+
if (has_filter('seopress_social_og_url')) {
|
725 |
+
$seopress_social_og_url = apply_filters('seopress_social_og_url', $seopress_social_og_url);
|
726 |
+
}
|
727 |
+
echo $seopress_social_og_url."\n";
|
728 |
+
}
|
729 |
+
if (isset($options['seopress_social_facebook_og'])) {
|
730 |
+
$seopress_social_og_site_name = '<meta property="og:site_name" content="'.esc_html(get_bloginfo('name')).'" />';
|
731 |
+
//Hook on post OG site name - 'seopress_social_og_site_name'
|
732 |
+
if (has_filter('seopress_social_og_site_name')) {
|
733 |
+
$seopress_social_og_site_name = apply_filters('seopress_social_og_site_name', $seopress_social_og_site_name);
|
734 |
+
}
|
735 |
+
echo $seopress_social_og_site_name."\n";
|
736 |
+
}
|
737 |
+
if (isset($options['seopress_social_facebook_og'])) {
|
738 |
+
$seopress_social_og_locale = '<meta property="og:locale" content="'.esc_attr(get_locale()).'" />';
|
739 |
+
//Polylang
|
740 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
741 |
+
if ( is_plugin_active( 'polylang/polylang.php' ) || is_plugin_active( 'polylang-pro/polylang.php' )) {
|
742 |
+
//@credits Polylang
|
743 |
+
if (did_action('pll_init') && function_exists('PLL')) {
|
744 |
+
$alternates = array();
|
745 |
+
|
746 |
+
foreach ( PLL()->model->get_languages_list() as $language ) {
|
747 |
+
if ( PLL()->curlang->slug !== $language->slug && PLL()->links->get_translation_url( $language ) && isset( $language->facebook ) ) {
|
748 |
+
$alternates[] = $language->facebook;
|
749 |
+
}
|
750 |
+
}
|
751 |
+
// There is a risk that 2 languages have the same Facebook locale. So let's make sure to output each locale only once.
|
752 |
+
$alternates = array_unique( $alternates );
|
753 |
+
|
754 |
+
foreach ( $alternates as $lang ) {
|
755 |
+
$seopress_social_og_locale .= "\n";
|
756 |
+
$seopress_social_og_locale .= '<meta property="og:locale:alternate" content="'.esc_attr($lang).'" />';
|
757 |
+
}
|
758 |
+
}
|
759 |
+
}
|
760 |
+
//Hook on post OG locale - 'seopress_social_og_locale'
|
761 |
+
if (has_filter('seopress_social_og_locale')) {
|
762 |
+
$seopress_social_og_locale = apply_filters('seopress_social_og_locale', $seopress_social_og_locale);
|
763 |
+
}
|
764 |
+
if (isset($seopress_social_og_locale) && $seopress_social_og_locale !='') {
|
765 |
+
echo $seopress_social_og_locale."\n";
|
766 |
+
}
|
767 |
+
}
|
768 |
+
if (isset($options['seopress_social_facebook_og'])) {
|
769 |
+
if (is_home() || is_front_page()) {
|
770 |
+
$seopress_social_og_type = '<meta property="og:type" content="website" />';
|
771 |
+
} elseif (is_singular('product') || is_singular('download')) {
|
772 |
+
$seopress_social_og_type = '<meta property="og:type" content="product" />';
|
773 |
+
} elseif (is_singular()) {
|
774 |
+
global $post;
|
775 |
+
$seopress_video_disabled = get_post_meta($post->ID,'_seopress_video_disabled', true);
|
776 |
+
$seopress_video = get_post_meta($post->ID,'_seopress_video');
|
777 |
+
|
778 |
+
if (!empty($seopress_video[0][0]['url']) && $seopress_video_disabled =='') {
|
779 |
+
$seopress_social_og_type = '<meta property="og:type" content="video.other" />';
|
780 |
+
} else {
|
781 |
+
$seopress_social_og_type = '<meta property="og:type" content="article" />';
|
782 |
+
}
|
783 |
+
}
|
784 |
+
elseif (is_search() || is_archive() || is_404()) {
|
785 |
+
$seopress_social_og_type = '<meta property="og:type" content="object" />';
|
786 |
+
}
|
787 |
+
if (isset($seopress_social_og_type)) {
|
788 |
+
//Hook on post OG type - 'seopress_social_og_type'
|
789 |
+
if (has_filter('seopress_social_og_type')) {
|
790 |
+
$seopress_social_og_type = apply_filters('seopress_social_og_type', $seopress_social_og_type);
|
791 |
+
}
|
792 |
+
echo $seopress_social_og_type."\n";
|
793 |
+
}
|
794 |
+
}
|
795 |
+
if ( isset($options['seopress_social_facebook_og']) && ( isset($options['seopress_social_accounts_facebook']) && '' != $options['seopress_social_accounts_facebook'] ) ) {
|
796 |
+
if (is_singular() && !is_home() && !is_front_page()) {
|
797 |
+
global $post;
|
798 |
+
$seopress_video_disabled = get_post_meta($post->ID,'_seopress_video_disabled', true);
|
799 |
+
$seopress_video = get_post_meta($post->ID,'_seopress_video');
|
800 |
+
|
801 |
+
if (!empty($seopress_video[0][0]['url']) && $seopress_video_disabled =='') {
|
802 |
+
//do nothing
|
803 |
+
} else {
|
804 |
+
$seopress_social_og_author = '<meta property="article:author" content="'.seopress_social_accounts_facebook_option().'" />';
|
805 |
+
$seopress_social_og_author .= "\n";
|
806 |
+
$seopress_social_og_author .= '<meta property="article:publisher" content="'.seopress_social_accounts_facebook_option().'" />';
|
807 |
+
}
|
808 |
+
}
|
809 |
+
if (isset($seopress_social_og_author)) {
|
810 |
+
//Hook on post OG author - 'seopress_social_og_author'
|
811 |
+
if (has_filter('seopress_social_og_author')) {
|
812 |
+
$seopress_social_og_author = apply_filters('seopress_social_og_author', $seopress_social_og_author);
|
813 |
+
}
|
814 |
+
echo $seopress_social_og_author."\n";
|
815 |
+
}
|
816 |
+
}
|
817 |
+
if (isset($options['seopress_social_facebook_og'])) {
|
818 |
+
$title = '';
|
819 |
+
$title = ampforwp_get_seopress_title();
|
820 |
+
if ( is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_title',true) ){
|
821 |
+
$title = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_title',true);
|
822 |
+
}
|
823 |
+
if ((is_tax() || is_category() || is_tag()) && '' != get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_title',true) ) {
|
824 |
+
$title = get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_title',true);
|
825 |
+
}
|
826 |
+
if ( '' != get_post_meta($post_id,'_seopress_social_fb_title',true) ){
|
827 |
+
$title = get_post_meta($post_id,'_seopress_social_fb_title',true);
|
828 |
+
}
|
829 |
+
if ( '' == $title && '' != get_the_title() ){
|
830 |
+
$title = get_the_title();
|
831 |
+
}
|
832 |
+
$seopress_social_og_title .= '<meta property="og:title" content="'.esc_attr($title).'" />';
|
833 |
+
$seopress_social_og_title .= "\n";
|
834 |
+
//Hook on post OG title - 'seopress_social_og_title'
|
835 |
+
if (has_filter('seopress_social_og_title')) {
|
836 |
+
$seopress_social_og_title = apply_filters('seopress_social_og_title', $seopress_social_og_title);
|
837 |
+
}
|
838 |
+
if (isset($seopress_social_og_title) && $seopress_social_og_title !='') {
|
839 |
+
echo $seopress_social_og_title;
|
840 |
+
}
|
841 |
+
}
|
842 |
+
|
843 |
+
if (isset($options['seopress_social_facebook_og'])) {
|
844 |
+
$description = ampforwp_generate_meta_desc();
|
845 |
+
if ( is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_desc',true) ) {
|
846 |
+
$description = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_desc',true);
|
847 |
+
}
|
848 |
+
if (is_tax() || is_category() || is_tag() && '' != get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_desc',true) ) {
|
849 |
+
$description = get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_desc',true);
|
850 |
+
}
|
851 |
+
if ( '' != get_post_meta($post_id,'_seopress_social_fb_desc',true) ) {
|
852 |
+
$description = get_post_meta($post_id,'_seopress_social_fb_desc',true);
|
853 |
+
}
|
854 |
+
$seopress_social_og_desc .= '<meta property="og:description" content="'.$description.'" />';
|
855 |
+
$seopress_social_og_desc .= "\n";
|
856 |
+
//Hook on post OG description - 'seopress_social_og_desc'
|
857 |
+
if (has_filter('seopress_social_og_desc')) {
|
858 |
+
$seopress_social_og_desc = apply_filters('seopress_social_og_desc', $seopress_social_og_desc);
|
859 |
+
}
|
860 |
+
if (isset($seopress_social_og_desc) && $seopress_social_og_desc !='') {
|
861 |
+
echo $seopress_social_og_desc;
|
862 |
+
}
|
863 |
+
}
|
864 |
+
if (isset($options['seopress_social_facebook_og'])) {
|
865 |
+
$url = '';
|
866 |
+
if ( ampforwp_is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_img',true) ){
|
867 |
+
$url = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_img',true);
|
868 |
+
}
|
869 |
+
if (is_tax() || is_category() || is_tag() && '' != get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_img',true) ) {
|
870 |
+
$url = get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_img',true);
|
871 |
+
}
|
872 |
+
if ( '' != get_post_meta(ampforwp_get_the_ID(),'_seopress_social_fb_img',true) ) {
|
873 |
+
$url = get_post_meta(ampforwp_get_the_ID(),'_seopress_social_fb_img',true);
|
874 |
+
}
|
875 |
+
if ( '' == $url && has_post_thumbnail() ) {
|
876 |
+
$url = get_the_post_thumbnail_url();
|
877 |
+
}
|
878 |
+
if (function_exists('attachment_url_to_postid')) {
|
879 |
+
$image_id = attachment_url_to_postid( $url );
|
880 |
+
if ( !$image_id ){
|
881 |
+
return;
|
882 |
+
}
|
883 |
+
|
884 |
+
$image_src = wp_get_attachment_image_src( $image_id, 'full' );
|
885 |
+
|
886 |
+
//OG:IMAGE
|
887 |
+
$seopress_social_og_img = '';
|
888 |
+
$seopress_social_og_img .= '<meta property="og:image" content="'.esc_url($url).'" />';
|
889 |
+
$seopress_social_og_img .= "\n";
|
890 |
+
|
891 |
+
//OG:IMAGE:SECURE_URL IF SSL
|
892 |
+
if (is_ssl()) {
|
893 |
+
$seopress_social_og_img .= '<meta property="og:image:secure_url" content="'.esc_url($url).'" />';
|
894 |
+
$seopress_social_og_img .= "\n";
|
895 |
+
}
|
896 |
+
|
897 |
+
//OG:IMAGE:WIDTH + OG:IMAGE:HEIGHT
|
898 |
+
if (!empty($image_src)) {
|
899 |
+
$seopress_social_og_img .= '<meta property="og:image:width" content="'.$image_src[1].'" />';
|
900 |
+
$seopress_social_og_img .= "\n";
|
901 |
+
$seopress_social_og_img .= '<meta property="og:image:height" content="'.$image_src[2].'" />';
|
902 |
+
$seopress_social_og_img .= "\n";
|
903 |
+
}
|
904 |
+
|
905 |
+
//OG:IMAGE:ALT
|
906 |
+
if (get_post_meta($image_id, '_wp_attachment_image_alt', true) !='') {
|
907 |
+
$seopress_social_og_img .= '<meta property="og:image:alt" content="'.esc_attr(get_post_meta($image_id, '_wp_attachment_image_alt', true)).'" />';
|
908 |
+
$seopress_social_og_img .= "\n";
|
909 |
+
}
|
910 |
+
//Hook on post OG thumbnail - 'seopress_social_og_thumb'
|
911 |
+
if (has_filter('seopress_social_og_thumb')) {
|
912 |
+
$seopress_social_og_img = apply_filters('seopress_social_og_thumb', $seopress_social_og_img);
|
913 |
+
}
|
914 |
+
if (isset($seopress_social_og_img) && $seopress_social_og_img !='') {
|
915 |
+
echo $seopress_social_og_img;
|
916 |
+
}
|
917 |
+
}
|
918 |
+
}
|
919 |
+
if (isset($options['seopress_social_facebook_og']) && isset($options['seopress_social_facebook_link_ownership_id'])) {
|
920 |
+
$seopress_social_link_ownership_id = '<meta property="fb:pages" content="'.$options['seopress_social_facebook_link_ownership_id'].'" />';
|
921 |
+
echo $seopress_social_link_ownership_id."\n";
|
922 |
+
}
|
923 |
+
if (isset($options['seopress_social_facebook_og']) && isset($options['seopress_social_facebook_link_ownership_id']) ) {
|
924 |
+
$seopress_social_admin_id = '<meta property="fb:admins" content="'.$options['seopress_social_facebook_admin_id'].'" />';
|
925 |
+
echo $seopress_social_admin_id."\n";
|
926 |
+
}
|
927 |
+
if (isset($options['seopress_social_facebook_og']) && isset($options['seopress_social_facebook_link_ownership_id']) ) {
|
928 |
+
$seopress_social_app_id = '<meta property="fb:app_id" content="'.$options['seopress_social_facebook_app_id'].'" />';
|
929 |
+
echo $seopress_social_app_id."\n";
|
930 |
+
}
|
931 |
+
if (isset($options['seopress_social_twitter_card'])) {
|
932 |
+
if ($options['seopress_social_twitter_card_img_size'] =='large') {
|
933 |
+
$seopress_social_twitter_card_summary = '<meta name="twitter:card" content="summary_large_image">';
|
934 |
+
} else {
|
935 |
+
$seopress_social_twitter_card_summary = '<meta name="twitter:card" content="summary" />';
|
936 |
+
}
|
937 |
+
//Hook on post Twitter card summary - 'seopress_social_twitter_card_summary'
|
938 |
+
if (has_filter('seopress_social_twitter_card_summary')) {
|
939 |
+
$seopress_social_twitter_card_summary = apply_filters('seopress_social_twitter_card_summary', $seopress_social_twitter_card_summary);
|
940 |
+
}
|
941 |
+
echo $seopress_social_twitter_card_summary."\n";
|
942 |
+
}
|
943 |
+
if (isset($options['seopress_social_twitter_card']) && isset($options['seopress_social_accounts_twitter']) ) {
|
944 |
+
$seopress_social_twitter_card_site = '<meta name="twitter:site" content="'.$options['seopress_social_accounts_twitter'].'" />';
|
945 |
+
//Hook on post Twitter card site - 'seopress_social_twitter_card_site'
|
946 |
+
if (has_filter('seopress_social_twitter_card_site')) {
|
947 |
+
$seopress_social_twitter_card_site = apply_filters('seopress_social_twitter_card_site', $seopress_social_twitter_card_site);
|
948 |
+
}
|
949 |
+
echo $seopress_social_twitter_card_site."\n";
|
950 |
+
}
|
951 |
+
if (isset($options['seopress_social_twitter_card'])) {
|
952 |
+
//Init
|
953 |
+
$seopress_social_twitter_card_creator ='';
|
954 |
+
if ($options['seopress_social_twitter_card'] =='1' && get_the_author_meta('twitter') ) {
|
955 |
+
|
956 |
+
$seopress_social_twitter_card_creator .= '<meta name="twitter:creator" content="@'.get_the_author_meta('twitter').'" />';
|
957 |
+
|
958 |
+
} elseif ($options['seopress_social_twitter_card'] =='1' && $options['seopress_social_accounts_twitter'] !='' ) {
|
959 |
+
$seopress_social_twitter_card_creator .= '<meta name="twitter:creator" content="'.$options['seopress_social_accounts_twitter'].'" />';
|
960 |
+
}
|
961 |
+
//Hook on post Twitter card creator - 'seopress_social_twitter_card_creator'
|
962 |
+
if (has_filter('seopress_social_twitter_card_creator')) {
|
963 |
+
$seopress_social_twitter_card_creator = apply_filters('seopress_social_twitter_card_creator', $seopress_social_twitter_card_creator);
|
964 |
+
}
|
965 |
+
if (isset($seopress_social_twitter_card_creator) && $seopress_social_twitter_card_creator !='') {
|
966 |
+
echo $seopress_social_twitter_card_creator."\n";
|
967 |
+
}
|
968 |
+
}
|
969 |
+
if (isset($options['seopress_social_twitter_card'])) {
|
970 |
+
$title = '';
|
971 |
+
$title = ampforwp_get_seopress_title();
|
972 |
+
if ( is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_title',true) ){
|
973 |
+
$title = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_title',true);
|
974 |
+
}elseif ( is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_title',true) ){
|
975 |
+
$title = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_title',true);
|
976 |
+
}
|
977 |
+
if ((is_tax() || is_category() || is_tag()) && '' != get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_twitter_title',true) ) {
|
978 |
+
$title = get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_twitter_title',true);
|
979 |
+
}elseif ((is_tax() || is_category() || is_tag()) && '' != get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_title',true) ) {
|
980 |
+
$title = get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_title',true);
|
981 |
+
}
|
982 |
+
if ( '' != get_post_meta(ampforwp_get_the_ID(),'_seopress_social_twitter_title',true) ){
|
983 |
+
$title = get_post_meta(ampforwp_get_the_ID(),'_seopress_social_twitter_title',true);
|
984 |
+
}elseif ( '' != get_post_meta($post_id,'_seopress_social_fb_title',true) ){
|
985 |
+
$title = get_post_meta($post_id,'_seopress_social_fb_title',true);
|
986 |
+
}
|
987 |
+
if ( '' == $title && '' != get_the_title() ){
|
988 |
+
$title = get_the_title();
|
989 |
+
}
|
990 |
+
$seopress_social_twitter_card_title .= '<meta name="twitter:title" content="'.esc_attr($title).'" />';
|
991 |
+
//Hook on post Twitter card title - 'seopress_social_twitter_card_title'
|
992 |
+
if (has_filter('seopress_social_twitter_card_title')) {
|
993 |
+
$seopress_social_twitter_card_title = apply_filters('seopress_social_twitter_card_title', $seopress_social_twitter_card_title);
|
994 |
+
}
|
995 |
+
if (isset($seopress_social_twitter_card_title) && $seopress_social_twitter_card_title !='') {
|
996 |
+
echo $seopress_social_twitter_card_title."\n";
|
997 |
+
}
|
998 |
+
}
|
999 |
+
if (isset($options['seopress_social_twitter_card'])) {
|
1000 |
+
$description = ampforwp_generate_meta_desc();
|
1001 |
+
if ( is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_desc',true) ) {
|
1002 |
+
$description = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_desc',true);
|
1003 |
+
}elseif ( is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_desc',true) ) {
|
1004 |
+
$description = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_desc',true);
|
1005 |
+
}
|
1006 |
+
if (is_tax() || is_category() || is_tag() && '' != get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_twitter_desc',true) ) {
|
1007 |
+
$description = get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_twitter_desc',true);
|
1008 |
+
}elseif (is_tax() || is_category() || is_tag() && '' != get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_desc',true) ) {
|
1009 |
+
$description = get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_desc',true);
|
1010 |
+
}
|
1011 |
+
|
1012 |
+
if ( '' != get_post_meta(ampforwp_get_the_ID(),'_seopress_social_twitter_desc',true) ) {
|
1013 |
+
$description = get_post_meta(ampforwp_get_the_ID(),'_seopress_social_twitter_desc',true);
|
1014 |
+
}elseif ( '' != get_post_meta(ampforwp_get_the_ID(),'_seopress_social_fb_desc',true) ) {
|
1015 |
+
$description = get_post_meta(ampforwp_get_the_ID(),'_seopress_social_fb_desc',true);
|
1016 |
+
}
|
1017 |
+
$seopress_social_twitter_card_desc .= '<meta name="twitter:description" content="'.$description.'" />';
|
1018 |
+
//Hook on post Twitter card description - 'seopress_social_twitter_card_desc'
|
1019 |
+
if (has_filter('seopress_social_twitter_card_desc')) {
|
1020 |
+
$seopress_social_twitter_card_desc = apply_filters('seopress_social_twitter_card_desc', $seopress_social_twitter_card_desc);
|
1021 |
+
}
|
1022 |
+
if (isset($seopress_social_twitter_card_desc) && $seopress_social_twitter_card_desc !='') {
|
1023 |
+
echo $seopress_social_twitter_card_desc."\n";
|
1024 |
+
}
|
1025 |
+
}
|
1026 |
+
if (isset($options['seopress_social_twitter_card'])) {
|
1027 |
+
$url = '';
|
1028 |
+
if ( ampforwp_is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_img',true) ){
|
1029 |
+
$url = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_img',true);
|
1030 |
+
}elseif ( ampforwp_is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_img',true) ){
|
1031 |
+
$url = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_fb_img',true);
|
1032 |
+
}
|
1033 |
+
if (is_tax() || is_category() || is_tag() && '' != get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_twitter_img',true) ) {
|
1034 |
+
$url = get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_twitter_img',true);
|
1035 |
+
}elseif (is_tax() || is_category() || is_tag() && '' != get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_img',true) ) {
|
1036 |
+
$url = get_term_meta(get_queried_object()->{'term_id'},'_seopress_social_fb_img',true);
|
1037 |
+
}
|
1038 |
+
if ( '' != get_post_meta(ampforwp_get_the_ID(),'_seopress_social_twitter_img',true) ) {
|
1039 |
+
$url = get_post_meta(ampforwp_get_the_ID(),'_seopress_social_twitter_img',true);
|
1040 |
+
}elseif ( '' != get_post_meta(ampforwp_get_the_ID(),'_seopress_social_fb_img',true) ) {
|
1041 |
+
$url = get_post_meta(ampforwp_get_the_ID(),'_seopress_social_fb_img',true);
|
1042 |
+
}
|
1043 |
+
if ( '' == $url && has_post_thumbnail() ) {
|
1044 |
+
$url = get_the_post_thumbnail_url();
|
1045 |
+
}
|
1046 |
+
if (function_exists('attachment_url_to_postid')) {
|
1047 |
+
$image_id = attachment_url_to_postid( $url );
|
1048 |
+
if ( !$image_id ){
|
1049 |
+
return;
|
1050 |
+
}
|
1051 |
+
|
1052 |
+
$image_src = wp_get_attachment_image_src( $image_id, 'full' );
|
1053 |
+
|
1054 |
+
//OG:IMAGE
|
1055 |
+
$seopress_twitter_img = '';
|
1056 |
+
$seopress_twitter_img .= '<meta property="twitter:image" content="'.$url.'" />';
|
1057 |
+
$seopress_twitter_img .= "\n";
|
1058 |
+
|
1059 |
+
//OG:IMAGE:SECURE_URL IF SSL
|
1060 |
+
if (is_ssl()) {
|
1061 |
+
$seopress_twitter_img .= '<meta property="twitter:image:secure_url" content="'.$url.'" />';
|
1062 |
+
$seopress_twitter_img .= "\n";
|
1063 |
+
}
|
1064 |
+
|
1065 |
+
//OG:IMAGE:WIDTH + OG:IMAGE:HEIGHT
|
1066 |
+
if (!empty($image_src)) {
|
1067 |
+
$seopress_twitter_img .= '<meta property="twitter:image:width" content="'.$image_src[1].'" />';
|
1068 |
+
$seopress_twitter_img .= "\n";
|
1069 |
+
$seopress_twitter_img .= '<meta property="twitter:image:height" content="'.$image_src[2].'" />';
|
1070 |
+
$seopress_twitter_img .= "\n";
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
//OG:IMAGE:ALT
|
1074 |
+
if (get_post_meta($image_id, '_wp_attachment_image_alt', true) !='') {
|
1075 |
+
$seopress_twitter_img .= '<meta property="twitter:image:alt" content="'.esc_attr(get_post_meta($image_id, '_wp_attachment_image_alt', true)).'" />';
|
1076 |
+
$seopress_twitter_img .= "\n";
|
1077 |
+
}
|
1078 |
+
|
1079 |
+
//Hook on post OG thumbnail - 'seopress_social_og_thumb'
|
1080 |
+
if (has_filter('seopress_social_og_thumb')) {
|
1081 |
+
$seopress_twitter_img = apply_filters('seopress_social_og_thumb', $seopress_twitter_img);
|
1082 |
+
}
|
1083 |
+
if (isset($seopress_twitter_img) && $seopress_twitter_img !='') {
|
1084 |
+
echo $seopress_twitter_img;
|
1085 |
+
}
|
1086 |
+
}
|
1087 |
+
}
|
1088 |
+
}
|
1089 |
}
|
pagebuilder/components/fieldsTemplate.php
CHANGED
@@ -45,7 +45,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; ?>
|
|
45 |
<div class="amp-form-control" :id="field.name" data-type="select" v-else-if="field.type=='select' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
|
46 |
<div class="form-label">{{field.label}}</div>
|
47 |
<div class="form-field">
|
48 |
-
<select type="text" class="full text" :id="field.id" :name="field.name" v-model="field.default" v-if="field.options_details.length!=0">
|
49 |
<option value="">Select option</option>
|
50 |
<option
|
51 |
v-for="(option, key, index) in field.options_details"
|
45 |
<div class="amp-form-control" :id="field.name" data-type="select" v-else-if="field.type=='select' && (field.tab==defaulttab || repeater==1)" :data-require="JSON.stringify(field.required)" v-show="fieldShowHideCheck(field)">
|
46 |
<div class="form-label">{{field.label}}</div>
|
47 |
<div class="form-field">
|
48 |
+
<select type="text" class="full text" :id="field.id" :name="field.name" v-model="field.default" v-if="field.options_details.length!=0" :data-ajax="field.ajax" :data-ajax-dep="field.ajax_dep" :data-ajax-action="field.ajax_action" @change="changeOnSelect()">
|
49 |
<option value="">Select option</option>
|
50 |
<option
|
51 |
v-for="(option, key, index) in field.options_details"
|
pagebuilder/inc/admin-amp-page-builder.js
CHANGED
@@ -474,6 +474,11 @@ Vue.component('fields-data',{
|
|
474 |
//this.callChangeEnvent();
|
475 |
})
|
476 |
},
|
|
|
|
|
|
|
|
|
|
|
477 |
computed: {
|
478 |
filteredIcons: function(){
|
479 |
var self=this;
|
@@ -652,6 +657,44 @@ Vue.component('fields-data',{
|
|
652 |
return false;
|
653 |
}
|
654 |
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
}
|
656 |
|
657 |
}
|
474 |
//this.callChangeEnvent();
|
475 |
})
|
476 |
},
|
477 |
+
beforeMount: function(){
|
478 |
+
if ( this.field.ajax == true ) {
|
479 |
+
this.changeOnSelect();
|
480 |
+
}
|
481 |
+
},
|
482 |
computed: {
|
483 |
filteredIcons: function(){
|
484 |
var self=this;
|
657 |
return false;
|
658 |
}
|
659 |
return false;
|
660 |
+
},
|
661 |
+
changeOnSelect: function(){ //event, field
|
662 |
+
var dataAjax = this.field.ajax;//currentSelectfield.getAttribute("data-ajax-dep");
|
663 |
+
var dataAjaxDep = this.field.ajax_dep;//currentSelectfield.getAttribute("data-ajax-dep");
|
664 |
+
var ajaxAction = this.field.ajax_action;//currentSelectfield.getAttribute("data-ajax-action");
|
665 |
+
if(typeof dataAjax == 'undefined'){ console.log(dataAjax); return ; }//return if Selectbox not allowed ajax
|
666 |
+
this.$http.post(amppb_panel_options.ajaxUrl+'?action='+ajaxAction,
|
667 |
+
{
|
668 |
+
'selected_val': this.field.default,
|
669 |
+
'verify_nonce': amppb_panel_options.secure_nonce
|
670 |
+
}
|
671 |
+
,{
|
672 |
+
headers:{
|
673 |
+
responseType:'json'
|
674 |
+
},
|
675 |
+
responseType:'json',
|
676 |
+
emulateHTTP:true,
|
677 |
+
emulateJSON:true,
|
678 |
+
}
|
679 |
+
).then(function(response){
|
680 |
+
response =response.body;
|
681 |
+
if(response.success === true) {
|
682 |
+
var option_html = '';
|
683 |
+
app.modalcontent.fields.forEach(function(modaldata, key){
|
684 |
+
if(modaldata.name==dataAjaxDep){
|
685 |
+
modaldata.options_details = response.data;
|
686 |
+
}
|
687 |
+
});
|
688 |
+
}else{
|
689 |
+
alert(response.message);
|
690 |
+
}
|
691 |
+
|
692 |
+
},
|
693 |
+
//errorCallback
|
694 |
+
function(){
|
695 |
+
alert('connection not establish');
|
696 |
+
});
|
697 |
+
|
698 |
}
|
699 |
|
700 |
}
|
pagebuilder/inc/adminAjaxContents.php
CHANGED
@@ -188,6 +188,30 @@ function ampforwp_icons_list_format(){
|
|
188 |
exit;
|
189 |
}
|
190 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
add_action( 'wp_ajax_ampforwp_dynaminc_css', 'ampforwp_dynaminc_css' );
|
192 |
add_action( 'wp_ajax_nopriv_ampforwp_dynaminc_css', 'ampforwp_dynaminc_css' );
|
193 |
|
188 |
exit;
|
189 |
}
|
190 |
|
191 |
+
add_action( 'wp_ajax_ampforwp_pb_cats', 'ampforwp_pb_cats');
|
192 |
+
function ampforwp_pb_cats(){
|
193 |
+
if(!wp_verify_nonce( $_REQUEST['verify_nonce'], 'verify_pb' ) ) {
|
194 |
+
echo json_encode(array("status"=>300,"message"=>'Request not valid'));
|
195 |
+
die;
|
196 |
+
}
|
197 |
+
$cats = $taxs = array();
|
198 |
+
$post = '';
|
199 |
+
$post = $_POST['selected_val'];
|
200 |
+
$taxs = get_object_taxonomies( $post );
|
201 |
+
if(!empty($taxs)){
|
202 |
+
$cats = get_terms($taxs);
|
203 |
+
}
|
204 |
+
$return = array();
|
205 |
+
if($cats){
|
206 |
+
foreach ($cats as $key => $value) {
|
207 |
+
$return[$value->term_id] = $value->name;
|
208 |
+
}
|
209 |
+
}
|
210 |
+
$return['recent_option']= 'Recent Posts';
|
211 |
+
echo json_encode(array('success'=>true,'data'=>$return));
|
212 |
+
exit;
|
213 |
+
}
|
214 |
+
|
215 |
add_action( 'wp_ajax_ampforwp_dynaminc_css', 'ampforwp_dynaminc_css' );
|
216 |
add_action( 'wp_ajax_nopriv_ampforwp_dynaminc_css', 'ampforwp_dynaminc_css' );
|
217 |
|
pagebuilder/inc/viewShowFrontData.php
CHANGED
@@ -843,11 +843,18 @@ function ampforwp_rowData($container,$col,$moduleTemplate){
|
|
843 |
}
|
844 |
|
845 |
$args = array(
|
846 |
-
'cat' => $fieldValues['category_selection'],
|
847 |
'posts_per_page' => $fieldValues['show_total_posts'],
|
848 |
'has_password' => false,
|
849 |
-
'post_status'=> 'publish'
|
850 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
851 |
//The Query
|
852 |
$the_query = new WP_Query( $args );
|
853 |
$totalLoopHtml = $moduleTemplate[$contentArray['type']]['front_loop_content'];
|
843 |
}
|
844 |
|
845 |
$args = array(
|
846 |
+
//'cat' => $fieldValues['category_selection'],
|
847 |
'posts_per_page' => $fieldValues['show_total_posts'],
|
848 |
'has_password' => false,
|
849 |
+
'post_status'=> 'publish',
|
850 |
+
'tax_query' => array(
|
851 |
+
array(
|
852 |
+
'taxonomy'=>get_term($fieldValues['category_selection'])->taxonomy,
|
853 |
+
'field'=>'id',
|
854 |
+
'terms'=>$fieldValues['category_selection']
|
855 |
+
)
|
856 |
+
)
|
857 |
+
);
|
858 |
//The Query
|
859 |
$the_query = new WP_Query( $args );
|
860 |
$totalLoopHtml = $moduleTemplate[$contentArray['type']]['front_loop_content'];
|
pagebuilder/modules/contents-module.php
CHANGED
@@ -35,18 +35,24 @@ require_once ABSPATH . WPINC . '/category.php';
|
|
35 |
{{ifend_condition_content_layout_type_1}}
|
36 |
';
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
$categoryName = htmlspecialchars($category->name, ENT_QUOTES);
|
46 |
-
|
47 |
-
|
48 |
-
}
|
49 |
-
|
50 |
|
51 |
|
52 |
return array(
|
@@ -127,7 +133,20 @@ require_once ABSPATH . WPINC . '/category.php';
|
|
127 |
),
|
128 |
'content_type'=>'css',
|
129 |
),
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
'type' =>'select',
|
132 |
'name' =>"category_selection",
|
133 |
'label' =>"Select Category",
|
35 |
{{ifend_condition_content_layout_type_1}}
|
36 |
';
|
37 |
|
38 |
+
$options = '<option value="recent_option">Recent Posts</option>';
|
39 |
+
$post_types = '';
|
40 |
+
$categoriesArray = array();
|
41 |
+
if ( is_admin() ) {
|
42 |
+
$post_types = get_post_types(array('public'=>true));
|
43 |
+
$post_types = get_option('ampforwp_cpt_generated_post_types');
|
44 |
+
$post_types['post'] = 'post';
|
45 |
+
$categories = get_categories( array(
|
46 |
+
'orderby' => 'name',
|
47 |
+
'order' => 'ASC'
|
48 |
+
) );
|
49 |
+
$categoriesArray = array('recent_option'=>'Recent Posts');
|
50 |
+
foreach($categories as $category){
|
51 |
$categoryName = htmlspecialchars($category->name, ENT_QUOTES);
|
52 |
+
$categoriesArray[$category->term_id] = $categoryName;
|
53 |
+
$options.= '<option value="'.$category->term_id.'">'.$categoryName.'</option>';
|
54 |
+
}
|
55 |
+
}
|
56 |
|
57 |
|
58 |
return array(
|
133 |
),
|
134 |
'content_type'=>'css',
|
135 |
),
|
136 |
+
array(
|
137 |
+
'type' =>'select',
|
138 |
+
'name' =>"post_type_selection",
|
139 |
+
'label' =>"Select Post Type",
|
140 |
+
'tab' =>'customizer',
|
141 |
+
'default' =>'post',
|
142 |
+
'options' => $post_types,
|
143 |
+
'options_details'=>$post_types ,
|
144 |
+
'content_type'=>'html',
|
145 |
+
'ajax' => true,
|
146 |
+
'ajax_dep' => 'category_selection',
|
147 |
+
'ajax_action' => 'ampforwp_pb_cats'
|
148 |
+
),
|
149 |
+
array(
|
150 |
'type' =>'select',
|
151 |
'name' =>"category_selection",
|
152 |
'label' =>"Select Category",
|
pagebuilder/modules/slider-mod-module.php
CHANGED
@@ -16,7 +16,7 @@ $output = '
|
|
16 |
{{repeater_button}}
|
17 |
</div>
|
18 |
{{ifend_condition_carousel_layout_type_2}}
|
19 |
-
';
|
20 |
$css = '
|
21 |
{{if_condition_carousel_layout_type==1}}
|
22 |
.amp-img{
|
16 |
{{repeater_button}}
|
17 |
</div>
|
18 |
{{ifend_condition_carousel_layout_type_2}}
|
19 |
+
</div> ';
|
20 |
$css = '
|
21 |
{{if_condition_carousel_layout_type==1}}
|
22 |
.amp-img{
|
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: 5.1
|
7 |
-
Stable tag: 0.9.97.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -184,16 +184,16 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
184 |
|
185 |
== Changelog ==
|
186 |
|
187 |
-
= 0.9.97.
|
188 |
-
* Added:
|
189 |
-
* Added:
|
190 |
-
*
|
191 |
-
*
|
192 |
-
*
|
193 |
-
* Fixed:
|
194 |
-
* Fixed:
|
195 |
-
* Fixed:
|
196 |
-
* Fixed:
|
197 |
-
* Fixed:
|
198 |
|
199 |
Full changelog available in changelog.txt
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.1
|
7 |
+
Stable tag: 0.9.97.45
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
184 |
|
185 |
== Changelog ==
|
186 |
|
187 |
+
= 0.9.97.45 (4th April 2019) =
|
188 |
+
* Added: SeoPress compatibility integrated #1589
|
189 |
+
* Added: WP Appbox compatibility integrated #2791
|
190 |
+
* Added: Infinite Scroll feature integrated. #2682
|
191 |
+
* Added: Facebook like button added in Sticky Social Share #2186
|
192 |
+
* Added: Font family for Content in Single page #2122
|
193 |
+
* Fixed: Custom post type categories not showing in amp pagebuilder #1993
|
194 |
+
* Fixed: Duplicate SiteNavigationElement issue #2952
|
195 |
+
* Fixed: AMP Theme Framework Multisite issue #2936
|
196 |
+
* Fixed: Custom AMP Editor Content is Not rendering when Elementor is activated #2901
|
197 |
+
* Fixed: Title issue on Homepage with Yoast if we select custom front page #2962
|
198 |
|
199 |
Full changelog available in changelog.txt
|
templates/design-manager/design-1/archive.php
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
|
|
6 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
7 |
<?php
|
8 |
if ( is_archive() ) {
|
@@ -131,11 +132,12 @@
|
|
131 |
do_action('ampforwp_between_loop',$count,$this);
|
132 |
$count++;
|
133 |
endwhile; ?>
|
|
|
134 |
<div class="amp-wp-content pagination-holder">
|
135 |
|
136 |
<div id="pagination">
|
137 |
-
<?php if ( get_next_posts_link('next', $q->max_num_pages) ){ ?><div class="next"><?php
|
138 |
-
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php
|
139 |
<div class="clearfix"></div>
|
140 |
</div>
|
141 |
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
+
<?php do_action('amp_experiment_meta', $this); ?>
|
7 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
8 |
<?php
|
9 |
if ( is_archive() ) {
|
132 |
do_action('ampforwp_between_loop',$count,$this);
|
133 |
$count++;
|
134 |
endwhile; ?>
|
135 |
+
<?php do_action('ampforwp_loop_before_pagination') ?>
|
136 |
<div class="amp-wp-content pagination-holder">
|
137 |
|
138 |
<div id="pagination">
|
139 |
+
<?php if ( get_next_posts_link('next', $q->max_num_pages) ){ ?><div class="next"><?php echo apply_filters('ampforwp_next_posts_link', get_next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-next-text'], 'Next' ).'»', 0), $paged ) ?></div><?php }?>
|
140 |
+
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php echo apply_filters( 'ampforwp_previous_posts_link', get_previous_posts_link( '« '. ampforwp_translation($redux_builder_amp['amp-translator-previous-text'], 'Previous' )), $paged ); ?></div><?php }?>
|
141 |
<div class="clearfix"></div>
|
142 |
</div>
|
143 |
|
templates/design-manager/design-1/footer.php
CHANGED
@@ -5,12 +5,11 @@ wp_reset_postdata(); ?>
|
|
5 |
<div id="footer">
|
6 |
<?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
|
7 |
<div class="footer_menu">
|
8 |
-
|
9 |
-
<nav itemscope="" itemtype="https://schema.org/SiteNavigationElement">
|
10 |
<?php
|
11 |
$menu = wp_nav_menu( array(
|
12 |
'theme_location' => 'amp-footer-menu',
|
13 |
-
'link_before' => '<span
|
14 |
'link_after' => '</span>',
|
15 |
'echo' => false
|
16 |
) );
|
5 |
<div id="footer">
|
6 |
<?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
|
7 |
<div class="footer_menu">
|
8 |
+
<nav>
|
|
|
9 |
<?php
|
10 |
$menu = wp_nav_menu( array(
|
11 |
'theme_location' => 'amp-footer-menu',
|
12 |
+
'link_before' => '<span>',
|
13 |
'link_after' => '</span>',
|
14 |
'echo' => false
|
15 |
) );
|
templates/design-manager/design-1/header-bar.php
CHANGED
@@ -30,15 +30,14 @@
|
|
30 |
layout="nodisplay"
|
31 |
side="right">
|
32 |
<div class="toggle-navigationv2">
|
33 |
-
<div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div>
|
34 |
-
|
35 |
-
<nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
|
36 |
<?php
|
37 |
require_once AMPFORWP_PLUGIN_DIR .'/classes/class-ampforwp-walker-nav-menu.php';
|
38 |
|
39 |
$menu_html_content = wp_nav_menu( array(
|
40 |
'theme_location' => 'amp-menu' ,
|
41 |
-
'link_before' => '<span
|
42 |
'link_after' => '</span>',
|
43 |
'menu'=>'ul',
|
44 |
'echo' => false,
|
30 |
layout="nodisplay"
|
31 |
side="right">
|
32 |
<div class="toggle-navigationv2">
|
33 |
+
<div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div>
|
34 |
+
<nav id ="primary-amp-menu">
|
|
|
35 |
<?php
|
36 |
require_once AMPFORWP_PLUGIN_DIR .'/classes/class-ampforwp-walker-nav-menu.php';
|
37 |
|
38 |
$menu_html_content = wp_nav_menu( array(
|
39 |
'theme_location' => 'amp-menu' ,
|
40 |
+
'link_before' => '<span>',
|
41 |
'link_after' => '</span>',
|
42 |
'menu'=>'ul',
|
43 |
'echo' => false,
|
templates/design-manager/design-1/index.php
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
|
|
6 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
7 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
8 |
<style amp-custom>
|
@@ -94,11 +95,11 @@
|
|
94 |
$count++;
|
95 |
|
96 |
endwhile; ?>
|
97 |
-
|
98 |
<div class="amp-wp-content pagination-holder">
|
99 |
<div id="pagination">
|
100 |
-
<?php if ( get_next_posts_link('next', $q->max_num_pages) ){ ?><div class="next"><?php
|
101 |
-
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php
|
102 |
<div class="clearfix"></div>
|
103 |
</div>
|
104 |
</div>
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
+
<?php do_action('amp_experiment_meta', $this); ?>
|
7 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
8 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
9 |
<style amp-custom>
|
95 |
$count++;
|
96 |
|
97 |
endwhile; ?>
|
98 |
+
<?php do_action('ampforwp_loop_before_pagination') ?>
|
99 |
<div class="amp-wp-content pagination-holder">
|
100 |
<div id="pagination">
|
101 |
+
<?php if ( get_next_posts_link('next', $q->max_num_pages) ){ ?><div class="next"><?php echo apply_filters('ampforwp_next_posts_link', get_next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-next-text'], 'Next' ).'»', 0), $paged ) ?></div><?php }?>
|
102 |
+
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php echo apply_filters( 'ampforwp_previous_posts_link', get_previous_posts_link( '« '. ampforwp_translation($redux_builder_amp['amp-translator-previous-text'], 'Previous' )), $paged ); ?></div><?php }?>
|
103 |
<div class="clearfix"></div>
|
104 |
</div>
|
105 |
</div>
|
templates/design-manager/design-1/single.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
3 |
<head>
|
4 |
<meta charset="utf-8">
|
|
|
5 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
6 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
7 |
<style amp-custom>
|
2 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
3 |
<head>
|
4 |
<meta charset="utf-8">
|
5 |
+
<?php do_action('amp_experiment_meta', $this); ?>
|
6 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
7 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
8 |
<style amp-custom>
|
templates/design-manager/design-1/style.php
CHANGED
@@ -425,4 +425,10 @@ if( true == ampforwp_get_setting('ampforwp-footer-top') ) { ?>
|
|
425 |
html {
|
426 |
scroll-behavior: smooth;
|
427 |
}
|
428 |
-
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
425 |
html {
|
426 |
scroll-behavior: smooth;
|
427 |
}
|
428 |
+
<?php }
|
429 |
+
// Infinate Scroll Single page CSS
|
430 |
+
if( true == ampforwp_get_setting('ampforwp-infinite-scroll') && ampforwp_get_setting('ampforwp-infinite-scroll-single') ){ ?>
|
431 |
+
.single-post amp-next-page{
|
432 |
+
margin-top:30px;
|
433 |
+
}
|
434 |
+
<?php } ?>
|
templates/design-manager/design-2/archive.php
CHANGED
@@ -3,7 +3,8 @@
|
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
-
|
|
|
7 |
<?php
|
8 |
if ( is_archive() ) {
|
9 |
$description = get_the_archive_description();
|
@@ -133,11 +134,11 @@
|
|
133 |
do_action('ampforwp_between_loop',$count,$this);
|
134 |
$count++;
|
135 |
endwhile; ?>
|
136 |
-
|
137 |
<div class="amp-wp-content pagination-holder">
|
138 |
<div id="pagination">
|
139 |
-
<?php if ( get_next_posts_link('next', $q->max_num_pages) ){ ?><div class="next"><?php
|
140 |
-
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php
|
141 |
<div class="clearfix"></div>
|
142 |
</div>
|
143 |
</div>
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
+
<?php do_action('amp_experiment_meta', $this); ?>
|
7 |
+
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
8 |
<?php
|
9 |
if ( is_archive() ) {
|
10 |
$description = get_the_archive_description();
|
134 |
do_action('ampforwp_between_loop',$count,$this);
|
135 |
$count++;
|
136 |
endwhile; ?>
|
137 |
+
<?php do_action('ampforwp_loop_before_pagination') ?>
|
138 |
<div class="amp-wp-content pagination-holder">
|
139 |
<div id="pagination">
|
140 |
+
<?php if ( get_next_posts_link('next', $q->max_num_pages) ){ ?><div class="next"><?php echo apply_filters('ampforwp_next_posts_link',get_next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-next-text'], 'Next' ).'»', 0), $paged);?></div><?php }?>
|
141 |
+
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php echo apply_filters( 'ampforwp_previous_posts_link', get_previous_posts_link( '« '. ampforwp_translation($redux_builder_amp['amp-translator-previous-text'], 'Previous' )), $paged ); ?></div><?php }?>
|
142 |
<div class="clearfix"></div>
|
143 |
</div>
|
144 |
</div>
|
templates/design-manager/design-2/footer.php
CHANGED
@@ -4,12 +4,11 @@
|
|
4 |
<div id="footer">
|
5 |
<?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
|
6 |
<div class="footer_menu">
|
7 |
-
|
8 |
-
<nav itemscope="" itemtype="https://schema.org/SiteNavigationElement">
|
9 |
<?php
|
10 |
$menu = wp_nav_menu( array(
|
11 |
'theme_location' => 'amp-footer-menu',
|
12 |
-
'link_before' => '<span
|
13 |
'link_after' => '</span>',
|
14 |
'echo' => false
|
15 |
) );
|
4 |
<div id="footer">
|
5 |
<?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
|
6 |
<div class="footer_menu">
|
7 |
+
<nav>
|
|
|
8 |
<?php
|
9 |
$menu = wp_nav_menu( array(
|
10 |
'theme_location' => 'amp-footer-menu',
|
11 |
+
'link_before' => '<span>',
|
12 |
'link_after' => '</span>',
|
13 |
'echo' => false
|
14 |
) );
|
templates/design-manager/design-2/header-bar.php
CHANGED
@@ -21,13 +21,12 @@
|
|
21 |
side="right">
|
22 |
<div class="toggle-navigationv2">
|
23 |
<div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div>
|
24 |
-
|
25 |
-
<nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
|
26 |
<?php
|
27 |
require_once AMPFORWP_PLUGIN_DIR.'/classes/class-ampforwp-walker-nav-menu.php';
|
28 |
$menu_html_content = wp_nav_menu( array(
|
29 |
'theme_location' => 'amp-menu' ,
|
30 |
-
'link_before' => '<span
|
31 |
'link_after' => '</span>',
|
32 |
'menu' =>'ul',
|
33 |
'echo' => false,
|
21 |
side="right">
|
22 |
<div class="toggle-navigationv2">
|
23 |
<div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div>
|
24 |
+
<nav id ="primary-amp-menu">
|
|
|
25 |
<?php
|
26 |
require_once AMPFORWP_PLUGIN_DIR.'/classes/class-ampforwp-walker-nav-menu.php';
|
27 |
$menu_html_content = wp_nav_menu( array(
|
28 |
'theme_location' => 'amp-menu' ,
|
29 |
+
'link_before' => '<span>',
|
30 |
'link_after' => '</span>',
|
31 |
'menu' =>'ul',
|
32 |
'echo' => false,
|
templates/design-manager/design-2/index.php
CHANGED
@@ -3,7 +3,8 @@
|
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
-
|
|
|
7 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
8 |
<style amp-custom>
|
9 |
<?php $this->load_parts( array( 'style' ) ); ?>
|
@@ -97,11 +98,11 @@
|
|
97 |
do_action('ampforwp_between_loop',$count,$this);
|
98 |
$count++;
|
99 |
endwhile; ?>
|
100 |
-
|
101 |
<div class="amp-wp-content pagination-holder">
|
102 |
<div id="pagination">
|
103 |
-
<?php if ( get_next_posts_link('next', $q->max_num_pages) ){ ?><div class="next"><?php
|
104 |
-
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php
|
105 |
<div class="clearfix"></div>
|
106 |
</div>
|
107 |
</div>
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
+
<?php do_action('amp_experiment_meta', $this); ?>
|
7 |
+
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
8 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
9 |
<style amp-custom>
|
10 |
<?php $this->load_parts( array( 'style' ) ); ?>
|
98 |
do_action('ampforwp_between_loop',$count,$this);
|
99 |
$count++;
|
100 |
endwhile; ?>
|
101 |
+
<?php do_action('ampforwp_loop_before_pagination') ?>
|
102 |
<div class="amp-wp-content pagination-holder">
|
103 |
<div id="pagination">
|
104 |
+
<?php if ( get_next_posts_link('next', $q->max_num_pages) ){ ?><div class="next"><?php echo apply_filters('ampforwp_next_posts_link',get_next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-next-text'], 'Next' ).'»', 0), $paged);?></div><?php }?>
|
105 |
+
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php echo apply_filters( 'ampforwp_previous_posts_link', get_previous_posts_link( '« '. ampforwp_translation($redux_builder_amp['amp-translator-previous-text'], 'Previous' )), $paged ); ?></div><?php }?>
|
106 |
<div class="clearfix"></div>
|
107 |
</div>
|
108 |
</div>
|
templates/design-manager/design-2/single.php
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
|
|
6 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
7 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
8 |
<style amp-custom>
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
+
<?php do_action('amp_experiment_meta', $this); ?>
|
7 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
8 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
9 |
<style amp-custom>
|
templates/design-manager/design-2/style.php
CHANGED
@@ -553,4 +553,20 @@ if( true == ampforwp_get_setting('ampforwp-footer-top') ) { ?>
|
|
553 |
html {
|
554 |
scroll-behavior: smooth;
|
555 |
}
|
556 |
-
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
553 |
html {
|
554 |
scroll-behavior: smooth;
|
555 |
}
|
556 |
+
<?php }
|
557 |
+
// Infinate Scroll Home & Archive page CSS
|
558 |
+
if( true == ampforwp_get_setting('ampforwp-infinite-scroll') && ampforwp_get_setting('ampforwp-infinite-scroll-home') ){ ?>
|
559 |
+
amp-next-page{
|
560 |
+
margin:30px -22% 0px -22%;
|
561 |
+
}
|
562 |
+
@media(max-width:767px){
|
563 |
+
amp-next-page {
|
564 |
+
margin: 17px -2.6% 0px -2.5%;
|
565 |
+
}
|
566 |
+
}
|
567 |
+
@media(max-width:450px){
|
568 |
+
amp-next-page {
|
569 |
+
margin: 17px -4.6% 0px -4.6%;
|
570 |
+
}
|
571 |
+
}
|
572 |
+
<?php } ?>
|
templates/design-manager/design-3/archive.php
CHANGED
@@ -3,7 +3,8 @@
|
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
-
|
|
|
7 |
<?php
|
8 |
if ( is_archive() ) {
|
9 |
$description = get_the_archive_description();
|
@@ -171,12 +172,12 @@ if ( get_query_var( 'paged' ) ) {
|
|
171 |
do_action('ampforwp_between_loop',$count,$this);
|
172 |
$count++;
|
173 |
endwhile; ?>
|
174 |
-
|
175 |
<div class="amp-wp-content pagination-holder">
|
176 |
<div id="pagination">
|
177 |
<?php
|
178 |
-
if ( get_next_posts_link('next', $wp_query->max_num_pages) ){ ?><div class="next"><?php
|
179 |
-
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php
|
180 |
<div class="clearfix"></div>
|
181 |
</div>
|
182 |
</div>
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
+
<?php do_action('amp_experiment_meta', $this); ?>
|
7 |
+
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
8 |
<?php
|
9 |
if ( is_archive() ) {
|
10 |
$description = get_the_archive_description();
|
172 |
do_action('ampforwp_between_loop',$count,$this);
|
173 |
$count++;
|
174 |
endwhile; ?>
|
175 |
+
<?php do_action('ampforwp_loop_before_pagination') ?>
|
176 |
<div class="amp-wp-content pagination-holder">
|
177 |
<div id="pagination">
|
178 |
<?php
|
179 |
+
if ( get_next_posts_link('next', $wp_query->max_num_pages) ){ ?><div class="next"><?php echo apply_filters('ampforwp_next_posts_link',get_next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-next-text'], 'Show more Posts' ).'»', 0), $paged);?></div><?php }?>
|
180 |
+
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php echo apply_filters( 'ampforwp_previous_posts_link', get_previous_posts_link( '« '. ampforwp_translation($redux_builder_amp['amp-translator-previous-text'], 'Show Previous Posts' )), $paged ); ?></div><?php }?>
|
181 |
<div class="clearfix"></div>
|
182 |
</div>
|
183 |
</div>
|
templates/design-manager/design-3/footer.php
CHANGED
@@ -3,13 +3,12 @@
|
|
3 |
<footer class="footer_wrapper container">
|
4 |
<div id="footer">
|
5 |
<?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
|
6 |
-
<?php // schema.org/SiteNavigationElement missing from menus #1229 ?>
|
7 |
<div class="footer_menu">
|
8 |
-
<nav
|
9 |
<?php
|
10 |
$menu = wp_nav_menu( array(
|
11 |
'theme_location' => 'amp-footer-menu',
|
12 |
-
'link_before' => '<span
|
13 |
'link_after' => '</span>',
|
14 |
'echo' => false,
|
15 |
) );
|
3 |
<footer class="footer_wrapper container">
|
4 |
<div id="footer">
|
5 |
<?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
|
|
|
6 |
<div class="footer_menu">
|
7 |
+
<nav>
|
8 |
<?php
|
9 |
$menu = wp_nav_menu( array(
|
10 |
'theme_location' => 'amp-footer-menu',
|
11 |
+
'link_before' => '<span>',
|
12 |
'link_after' => '</span>',
|
13 |
'echo' => false,
|
14 |
) );
|
templates/design-manager/design-3/header-bar.php
CHANGED
@@ -11,14 +11,13 @@ if(isset($redux_builder_amp['ampforwp-amp-menu']) && $redux_builder_amp['ampforw
|
|
11 |
if( has_nav_menu( 'amp-menu' ) ) { ?>
|
12 |
<div class="navigation_heading"><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-navigate-text'] , 'Navigate' )); ?></div>
|
13 |
|
14 |
-
<?php // Grand child support AND amp-accordion non critical error in Design 3 due to nav #1152
|
15 |
-
|
16 |
-
<nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
|
17 |
<?php
|
18 |
require_once AMPFORWP_PLUGIN_DIR .'/classes/class-ampforwp-walker-nav-menu.php';
|
19 |
$menu_html_content = wp_nav_menu( array(
|
20 |
'theme_location' => 'amp-menu',
|
21 |
-
'link_before' => '<span
|
22 |
'link_after' => '</span>',
|
23 |
'menu'=>'ul',
|
24 |
'menu_class'=>'amp-menu',
|
11 |
if( has_nav_menu( 'amp-menu' ) ) { ?>
|
12 |
<div class="navigation_heading"><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-navigate-text'] , 'Navigate' )); ?></div>
|
13 |
|
14 |
+
<?php // Grand child support AND amp-accordion non critical error in Design 3 due to nav #1152 ?>
|
15 |
+
<nav id ="primary-amp-menu">
|
|
|
16 |
<?php
|
17 |
require_once AMPFORWP_PLUGIN_DIR .'/classes/class-ampforwp-walker-nav-menu.php';
|
18 |
$menu_html_content = wp_nav_menu( array(
|
19 |
'theme_location' => 'amp-menu',
|
20 |
+
'link_before' => '<span>',
|
21 |
'link_after' => '</span>',
|
22 |
'menu'=>'ul',
|
23 |
'menu_class'=>'amp-menu',
|
templates/design-manager/design-3/index.php
CHANGED
@@ -3,7 +3,8 @@
|
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
-
|
|
|
7 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
8 |
|
9 |
<style amp-custom>
|
@@ -194,12 +195,12 @@ if ( get_query_var( 'paged' ) ) {
|
|
194 |
do_action('ampforwp_between_loop',$count,$this);
|
195 |
$count++;
|
196 |
endwhile; ?>
|
197 |
-
|
198 |
<div class="amp-wp-content pagination-holder">
|
199 |
|
200 |
<div id="pagination">
|
201 |
-
<?php if ( get_next_posts_link('next', $q->max_num_pages) ){ ?><div class="next"><?php
|
202 |
-
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php
|
203 |
<div class="clearfix"></div>
|
204 |
</div>
|
205 |
</div>
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
+
<?php do_action('amp_experiment_meta', $this); ?>
|
7 |
+
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
8 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
9 |
|
10 |
<style amp-custom>
|
195 |
do_action('ampforwp_between_loop',$count,$this);
|
196 |
$count++;
|
197 |
endwhile; ?>
|
198 |
+
<?php do_action('ampforwp_loop_before_pagination') ?>
|
199 |
<div class="amp-wp-content pagination-holder">
|
200 |
|
201 |
<div id="pagination">
|
202 |
+
<?php if ( get_next_posts_link('next', $q->max_num_pages) ){ ?><div class="next"><?php echo apply_filters('ampforwp_next_posts_link',get_next_posts_link( ampforwp_translation($redux_builder_amp['amp-translator-next-text'], 'Show more Posts' ).'»', 0), $paged);?></div><?php }?>
|
203 |
+
<?php if ( get_previous_posts_link() ){ ?><div class="prev"><?php echo apply_filters( 'ampforwp_previous_posts_link', get_previous_posts_link( '« '. ampforwp_translation($redux_builder_amp['amp-translator-previous-text'], 'Show Previous Posts' )), $paged ); ?></div><?php }?>
|
204 |
<div class="clearfix"></div>
|
205 |
</div>
|
206 |
</div>
|
templates/design-manager/design-3/single.php
CHANGED
@@ -3,6 +3,7 @@
|
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
|
|
6 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
7 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
8 |
<style amp-custom>
|
3 |
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
+
<?php do_action('amp_experiment_meta', $this); ?>
|
7 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
8 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
9 |
<style amp-custom>
|
templates/design-manager/design-3/style.php
CHANGED
@@ -736,4 +736,10 @@ if(true == ampforwp_get_setting('ampforwp-footer-top')){?>
|
|
736 |
html {
|
737 |
scroll-behavior: smooth;
|
738 |
}
|
739 |
-
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
736 |
html {
|
737 |
scroll-behavior: smooth;
|
738 |
}
|
739 |
+
<?php }
|
740 |
+
// Infinate Scroll Home & Archive page CSS
|
741 |
+
if( true == ampforwp_get_setting('ampforwp-infinite-scroll') && ampforwp_get_setting('ampforwp-infinite-scroll-home') ){?>
|
742 |
+
.amp_home_body .amp-next-page-default-separator {border:none;}
|
743 |
+
#headerwrap{position:relative;}
|
744 |
+
header{padding:0;}
|
745 |
+
<?php } ?>
|
templates/design-manager/swift/footer.php
CHANGED
@@ -26,11 +26,11 @@ if ( isset($redux_builder_amp['footer-type']) && '1' == $redux_builder_amp['foot
|
|
26 |
<div class="cntr">
|
27 |
<?php if(isset($redux_builder_amp['swift-menu']) && $redux_builder_amp['swift-menu'] == true ){ if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
|
28 |
<div class="f-menu">
|
29 |
-
<nav
|
30 |
<?php
|
31 |
$menu = wp_nav_menu( array(
|
32 |
'theme_location' => 'amp-footer-menu',
|
33 |
-
'link_before' => '<span
|
34 |
'link_after' => '</span>',
|
35 |
'echo' => false
|
36 |
) );
|
@@ -61,6 +61,26 @@ if ( isset($redux_builder_amp['footer-type']) && '1' == $redux_builder_amp['foot
|
|
61 |
if( (is_single() && $redux_builder_amp['enable-single-social-icons']) || (is_page() && true == $redux_builder_amp['ampforwp-page-sticky-social']) ){ ?>
|
62 |
<div class="s_stk ss-ic">
|
63 |
<ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
<?php if($redux_builder_amp['enable-single-facebook-share']){?>
|
65 |
<li>
|
66 |
<a title="facebook share" class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo esc_url($amp_permalink); ?>"></a>
|
26 |
<div class="cntr">
|
27 |
<?php if(isset($redux_builder_amp['swift-menu']) && $redux_builder_amp['swift-menu'] == true ){ if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
|
28 |
<div class="f-menu">
|
29 |
+
<nav>
|
30 |
<?php
|
31 |
$menu = wp_nav_menu( array(
|
32 |
'theme_location' => 'amp-footer-menu',
|
33 |
+
'link_before' => '<span>',
|
34 |
'link_after' => '</span>',
|
35 |
'echo' => false
|
36 |
) );
|
61 |
if( (is_single() && $redux_builder_amp['enable-single-social-icons']) || (is_page() && true == $redux_builder_amp['ampforwp-page-sticky-social']) ){ ?>
|
62 |
<div class="s_stk ss-ic">
|
63 |
<ul>
|
64 |
+
<?php if(ampforwp_get_setting('ampforwp-facebook-like-button')){?>
|
65 |
+
<li>
|
66 |
+
<?php if( ampforwp_is_non_amp() && ampforwp_get_setting('ampforwp-amp-convert-to-wp')) { ?>
|
67 |
+
<div class="fb-like"
|
68 |
+
data-href="<?php echo esc_url(get_the_permalink());?>"
|
69 |
+
data-layout="button_count"
|
70 |
+
data-action="like"
|
71 |
+
data-show-faces="true">
|
72 |
+
</div>
|
73 |
+
<?php }
|
74 |
+
else { ?>
|
75 |
+
<amp-facebook-like width=75 height=35 style="margin: 0 auto;margin-top: 5px;"
|
76 |
+
layout="fixed"
|
77 |
+
data-size="large"
|
78 |
+
data-layout="button_count"
|
79 |
+
data-href="<?php echo esc_url(get_the_permalink());?>">
|
80 |
+
</amp-facebook-like>
|
81 |
+
<?php } ?>
|
82 |
+
</li>
|
83 |
+
<?php } ?>
|
84 |
<?php if($redux_builder_amp['enable-single-facebook-share']){?>
|
85 |
<li>
|
86 |
<a title="facebook share" class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo esc_url($amp_permalink); ?>"></a>
|
templates/design-manager/swift/index.php
CHANGED
@@ -61,6 +61,7 @@
|
|
61 |
</div>
|
62 |
<?php } $i++; ?>
|
63 |
<?php endwhile; amp_loop('end'); ?>
|
|
|
64 |
<?php amp_pagination(); ?>
|
65 |
</div>
|
66 |
<?php if(isset($redux_builder_amp['gbl-sidebar']) && $redux_builder_amp['gbl-sidebar'] == '1'){ ?>
|
61 |
</div>
|
62 |
<?php } $i++; ?>
|
63 |
<?php endwhile; amp_loop('end'); ?>
|
64 |
+
<?php do_action('ampforwp_loop_before_pagination') ?>
|
65 |
<?php amp_pagination(); ?>
|
66 |
</div>
|
67 |
<?php if(isset($redux_builder_amp['gbl-sidebar']) && $redux_builder_amp['gbl-sidebar'] == '1'){ ?>
|
templates/design-manager/swift/style.php
CHANGED
@@ -389,17 +389,23 @@ if( is_page() || ampforwp_is_front_page() || ampforwp_polylang_front_page() ){?>
|
|
389 |
<?php if(is_singular()){ ?>
|
390 |
/** Pre tag Styling **/
|
391 |
pre {padding: 30px 15px;background: #f7f7f7;white-space: pre-wrap;;font-size: 14px;color: #666666;border-left: 3px solid;border-color: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;margin-bottom: 20px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
392 |
<?php } ?>
|
393 |
<?php if($redux_builder_amp['single-design-type'] == '1' || $redux_builder_amp['single-design-type'] == '4'){?>
|
394 |
<?php // Single
|
395 |
|
396 |
if(is_single() ) { ?>
|
397 |
-
.content-wrapper{
|
398 |
-
<?php $fontFamily = "font-family: 'Poppins', sans-serif;";
|
399 |
-
if(isset($redux_builder_amp['amp_font_selector_content_single']) && $redux_builder_amp['amp_font_selector_content_single'] != 1 && !empty($redux_builder_amp['amp_font_selector_content_single'])){
|
400 |
-
$fontFamily = "font-family: '".$redux_builder_amp['amp_font_selector_content_single']."';"; }
|
401 |
-
echo $fontFamily;?>
|
402 |
-
}
|
403 |
table {
|
404 |
display: -webkit-box;
|
405 |
overflow-x: auto;
|
@@ -1414,7 +1420,7 @@ if(isset($redux_builder_amp['enable-single-pocket-share']) && $redux_builder_amp
|
|
1414 |
<?php } ?>
|
1415 |
.s_stk{background: #f1f1f1;display:inline-block;width: 100%;padding:0;position:fixed;bottom: 0;text-align: center;border: 0;}
|
1416 |
.s_stk ul{width:100%;display:inline-flex;}
|
1417 |
-
.s_stk ul li{flex-direction: column;flex-basis: 0;flex: 1 0 5%;max-width: calc(100% - 10px);display: flex;}
|
1418 |
.s_stk li a{margin:0;border-radius: 0;padding:12px;}
|
1419 |
|
1420 |
<?php } ?>
|
@@ -1588,4 +1594,44 @@ if (ampforwp_get_setting('enable-amp-ads-resp-6')){?>
|
|
1588 |
html {
|
1589 |
scroll-behavior: smooth;
|
1590 |
}
|
1591 |
-
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
<?php if(is_singular()){ ?>
|
390 |
/** Pre tag Styling **/
|
391 |
pre {padding: 30px 15px;background: #f7f7f7;white-space: pre-wrap;;font-size: 14px;color: #666666;border-left: 3px solid;border-color: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;margin-bottom: 20px;}
|
392 |
+
.cntn-wrp{
|
393 |
+
<?php
|
394 |
+
$fontFamily = "font-family: 'Arial, Helvetica, sans-serif'";
|
395 |
+
if(1==ampforwp_get_setting('ampforwp-google-font-switch')){
|
396 |
+
$fontFamily = "font-family: 'Poppins', sans-serif;";
|
397 |
+
if( ampforwp_get_setting('amp_font_selector_content_single') != 1 && !empty(ampforwp_get_setting('amp_font_selector_content_single')) ){
|
398 |
+
$fontFamily = "font-family: '".esc_attr(ampforwp_get_setting('amp_font_selector_content_single'))."';";
|
399 |
+
}
|
400 |
+
}
|
401 |
+
echo $fontFamily;
|
402 |
+
?>
|
403 |
+
}
|
404 |
<?php } ?>
|
405 |
<?php if($redux_builder_amp['single-design-type'] == '1' || $redux_builder_amp['single-design-type'] == '4'){?>
|
406 |
<?php // Single
|
407 |
|
408 |
if(is_single() ) { ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
table {
|
410 |
display: -webkit-box;
|
411 |
overflow-x: auto;
|
1420 |
<?php } ?>
|
1421 |
.s_stk{background: #f1f1f1;display:inline-block;width: 100%;padding:0;position:fixed;bottom: 0;text-align: center;border: 0;}
|
1422 |
.s_stk ul{width:100%;display:inline-flex;}
|
1423 |
+
.s_stk ul li{flex-direction: column;flex-basis: 0;flex: 1 0 5%;max-width: calc(100% - 10px);display: flex;height:35px}
|
1424 |
.s_stk li a{margin:0;border-radius: 0;padding:12px;}
|
1425 |
|
1426 |
<?php } ?>
|
1594 |
html {
|
1595 |
scroll-behavior: smooth;
|
1596 |
}
|
1597 |
+
<?php }
|
1598 |
+
// Infinate Scroll Home & Archive page CSS
|
1599 |
+
if( true == ampforwp_get_setting('ampforwp-infinite-scroll') && ampforwp_get_setting('ampforwp-infinite-scroll-home') ){?>
|
1600 |
+
/** Home & Archive CSS **/
|
1601 |
+
.body amp-next-page{
|
1602 |
+
margin:0px -30px 0px -30px
|
1603 |
+
}
|
1604 |
+
.amp-next-page-default-separator {
|
1605 |
+
padding-top: 30px;
|
1606 |
+
border:none;
|
1607 |
+
}
|
1608 |
+
|
1609 |
+
@media(max-width:1024px){
|
1610 |
+
.body amp-next-page {
|
1611 |
+
margin: 0px -20px 0px -20px;
|
1612 |
+
}
|
1613 |
+
.amp-next-page-default-separator {
|
1614 |
+
padding-top: 10px;
|
1615 |
+
}
|
1616 |
+
}
|
1617 |
+
@media(max-width:480px){
|
1618 |
+
.body amp-next-page {
|
1619 |
+
margin: 0px;
|
1620 |
+
}
|
1621 |
+
.fsp, .fbp{
|
1622 |
+
margin:15px 0px;
|
1623 |
+
}
|
1624 |
+
.loop-wrapper{margin:0;display: inline-block;}
|
1625 |
+
}
|
1626 |
+
|
1627 |
+
<?php } // Infinate Scroll Single page CSS
|
1628 |
+
if( true == ampforwp_get_setting('ampforwp-infinite-scroll') && ampforwp_get_setting('ampforwp-infinite-scroll-single') ){?>
|
1629 |
+
.r-pf .fsp {
|
1630 |
+
margin: 15px;
|
1631 |
+
}
|
1632 |
+
@media(max-width:1024px){
|
1633 |
+
.body amp-next-page {
|
1634 |
+
margin: 0px 0px 0px 0px;
|
1635 |
+
}
|
1636 |
+
}
|
1637 |
+
<?php }
|
templates/features.php
CHANGED
@@ -628,11 +628,20 @@ function ampforwp_new_dir( $dir ) {
|
|
628 |
}
|
629 |
|
630 |
// Facebook Like Script
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
636 |
return $data;
|
637 |
}
|
638 |
|
@@ -2031,8 +2040,8 @@ function ampforwp_remove_schema_data() {
|
|
2031 |
remove_filter('the_content','sfsi_plus_beforaftereposts');
|
2032 |
remove_filter('the_content','sfsi_plus_beforeafterblogposts');
|
2033 |
|
|
|
2034 |
// Thrive Content Builder
|
2035 |
-
$amp_custom_content_enable = get_post_meta( get_the_ID() , 'ampforwp_custom_content_editor_checkbox', true);
|
2036 |
if ($amp_custom_content_enable == 'yes') {
|
2037 |
remove_filter( 'the_content', 'tve_editor_content', 10 );
|
2038 |
}
|
@@ -2169,6 +2178,18 @@ function ampforwp_sticky_social_icons(){
|
|
2169 |
$permalink = wp_get_shortlink();
|
2170 |
?>
|
2171 |
<div class="sticky_social">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2172 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
2173 |
<amp-social-share type="facebook" data-param-app_id="<?php echo esc_attr($redux_builder_amp['amp-facebook-app-id']); ?>" width="50" height="28"></amp-social-share>
|
2174 |
<a title="facebook share" class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo esc_url($amp_permalink); ?>"></a>
|
@@ -2552,7 +2573,7 @@ function ampforwp_replace_title_tags() {
|
|
2552 |
}
|
2553 |
// Custom Front Page Title From Yoast SEO #1163
|
2554 |
if ( ampforwp_is_front_page() || ampforwp_is_blog() ) {
|
2555 |
-
$yoast_title =
|
2556 |
}
|
2557 |
if ( $yoast_title ) {
|
2558 |
$site_title = apply_filters( 'wpseo_title', $yoast_title );
|
@@ -2611,6 +2632,14 @@ function ampforwp_replace_title_tags() {
|
|
2611 |
$site_title = $genesis_title;
|
2612 |
}
|
2613 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2614 |
// All in One SEO #2816
|
2615 |
if ( class_exists('All_in_One_SEO_Pack') && ampforwp_is_front_page()){
|
2616 |
$aiseop_title = $post = '';
|
@@ -2637,6 +2666,118 @@ function ampforwp_replace_title_tags() {
|
|
2637 |
return esc_html( convert_chars( wptexturize( trim( $site_title ) ) ) );
|
2638 |
}
|
2639 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2640 |
function ampforwp_modify_archive_title( $title ) {
|
2641 |
if ( is_category() ) {
|
2642 |
$title = single_cat_title( '', false );
|
@@ -5119,6 +5260,27 @@ function ampforwp_generate_meta_desc($json=""){
|
|
5119 |
$desc = $genesis_description;
|
5120 |
}
|
5121 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5122 |
// Rank Math SEO #2701
|
5123 |
if ( defined( 'RANK_MATH_FILE' ) && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
|
5124 |
$rank_math_desc = '';
|
@@ -6920,6 +7082,69 @@ if ( ! function_exists( 'ampforwp_google_fonts_generator' ) ) {
|
|
6920 |
}
|
6921 |
}
|
6922 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6923 |
echo $font_output;
|
6924 |
}
|
6925 |
}
|
@@ -8134,4 +8359,37 @@ function ampforwp_get_the_ID($post_id=''){
|
|
8134 |
$post_id = ampforwp_get_blog_details('id');
|
8135 |
}
|
8136 |
return $post_id;
|
8137 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
628 |
}
|
629 |
|
630 |
// Facebook Like Script
|
631 |
+
$fb_like = false;
|
632 |
+
if ( true == ampforwp_get_setting('ampforwp-facebook-like-button') ){
|
633 |
+
if ( is_single() && (true == ampforwp_get_setting('enable-single-social-icons') || ( $social_check && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID())))) {
|
634 |
+
$fb_like = true;
|
635 |
+
}
|
636 |
+
if ( is_page() && ( true == ampforwp_get_setting('ampforwp-page-sticky-social') || ( $social_check_page && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ) ) ) {
|
637 |
+
$fb_like = true;
|
638 |
+
}
|
639 |
+
}
|
640 |
+
if ( true == $fb_like ) {
|
641 |
+
if(empty($data['amp_component_scripts']['amp-facebook-like'])){
|
642 |
+
$data['amp_component_scripts']['amp-facebook-like'] = 'https://cdn.ampproject.org/v0/amp-facebook-like-0.1.js';
|
643 |
+
}
|
644 |
+
}
|
645 |
return $data;
|
646 |
}
|
647 |
|
2040 |
remove_filter('the_content','sfsi_plus_beforaftereposts');
|
2041 |
remove_filter('the_content','sfsi_plus_beforeafterblogposts');
|
2042 |
|
2043 |
+
$amp_custom_content_enable = get_post_meta( ampforwp_get_the_ID() , 'ampforwp_custom_content_editor_checkbox', true);
|
2044 |
// Thrive Content Builder
|
|
|
2045 |
if ($amp_custom_content_enable == 'yes') {
|
2046 |
remove_filter( 'the_content', 'tve_editor_content', 10 );
|
2047 |
}
|
2178 |
$permalink = wp_get_shortlink();
|
2179 |
?>
|
2180 |
<div class="sticky_social">
|
2181 |
+
<?php if ( true == ampforwp_get_setting('ampforwp-facebook-like-button')) {
|
2182 |
+
$facebook_like_url = '';
|
2183 |
+
$facebook_like_url = $amp_permalink;
|
2184 |
+
if ( $facebook_like_url ) { ?>
|
2185 |
+
<amp-facebook-like width=90 height=18 style="margin-bottom:-18px;"
|
2186 |
+
layout="fixed"
|
2187 |
+
data-size="large"
|
2188 |
+
data-layout="button_count"
|
2189 |
+
data-href="<?php echo esc_url($facebook_like_url); ?>">
|
2190 |
+
</amp-facebook-like>
|
2191 |
+
<?php }
|
2192 |
+
} ?>
|
2193 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
2194 |
<amp-social-share type="facebook" data-param-app_id="<?php echo esc_attr($redux_builder_amp['amp-facebook-app-id']); ?>" width="50" height="28"></amp-social-share>
|
2195 |
<a title="facebook share" class="s_fb" target="_blank" href="https://www.facebook.com/sharer.php?u=<?php echo esc_url($amp_permalink); ?>"></a>
|
2573 |
}
|
2574 |
// Custom Front Page Title From Yoast SEO #1163
|
2575 |
if ( ampforwp_is_front_page() || ampforwp_is_blog() ) {
|
2576 |
+
$yoast_title = $WPSEO_Frontend->get_content_title( $post );
|
2577 |
}
|
2578 |
if ( $yoast_title ) {
|
2579 |
$site_title = apply_filters( 'wpseo_title', $yoast_title );
|
2632 |
$site_title = $genesis_title;
|
2633 |
}
|
2634 |
}
|
2635 |
+
// SEOPress #1589
|
2636 |
+
if ( is_plugin_active('wp-seopress/seopress.php') && 'seopress' == ampforwp_get_setting('ampforwp-seo-selection') ) {
|
2637 |
+
$seopress_title = ampforwp_get_seopress_title();
|
2638 |
+
$seopress_title = ampforwp_seopress_title_sanitize($seopress_title);
|
2639 |
+
if ( $seopress_title ) {
|
2640 |
+
$site_title = $seopress_title;
|
2641 |
+
}
|
2642 |
+
}
|
2643 |
// All in One SEO #2816
|
2644 |
if ( class_exists('All_in_One_SEO_Pack') && ampforwp_is_front_page()){
|
2645 |
$aiseop_title = $post = '';
|
2666 |
return esc_html( convert_chars( wptexturize( trim( $site_title ) ) ) );
|
2667 |
}
|
2668 |
}
|
2669 |
+
// Get SEOPress Title #1589
|
2670 |
+
function ampforwp_get_seopress_title(){
|
2671 |
+
$seopress_title = $seopress_options = '';
|
2672 |
+
$post_id = ampforwp_get_the_ID();
|
2673 |
+
$post = get_post($post_id);
|
2674 |
+
$seopress_get_current_cpt = get_post_type($post);
|
2675 |
+
$seopress_options = get_option("seopress_titles_option_name");
|
2676 |
+
if ( get_post_meta($post_id,'_seopress_titles_title',true) ) {
|
2677 |
+
$seopress_title = get_post_meta($post_id,'_seopress_titles_title',true);
|
2678 |
+
}
|
2679 |
+
elseif ( isset($seopress_options['seopress_titles_single_titles'][$seopress_get_current_cpt]['title'])) {
|
2680 |
+
$seopress_title = $seopress_options['seopress_titles_single_titles'][$seopress_get_current_cpt]['title'];
|
2681 |
+
}
|
2682 |
+
if ( ampforwp_is_home() || ampforwp_is_blog() ) {
|
2683 |
+
$seopress_titles_template_variables_array = array('%%sitetitle%%','%%tagline%%');
|
2684 |
+
$seopress_titles_template_replace_array = array( get_bloginfo('name'), get_bloginfo('description') );
|
2685 |
+
$seopress_title = $seopress_options['seopress_titles_home_site_title'];
|
2686 |
+
$seopress_title = str_replace($seopress_titles_template_variables_array, $seopress_titles_template_replace_array, $seopress_title);
|
2687 |
+
}
|
2688 |
+
if ( is_archive() ) {
|
2689 |
+
$seopress_title = get_term_meta(get_queried_object()->{'term_id'},'_seopress_titles_title',true);
|
2690 |
+
}
|
2691 |
+
if ( $seopress_title ) {
|
2692 |
+
return $seopress_title;
|
2693 |
+
}
|
2694 |
+
}
|
2695 |
+
// Sanitize SEOPress Title #1589
|
2696 |
+
function ampforwp_seopress_title_sanitize($title){
|
2697 |
+
$seopress_titles_template_variables_array = array(
|
2698 |
+
'%%sep%%',
|
2699 |
+
'%%sitetitle%%',
|
2700 |
+
'%%sitename%%',
|
2701 |
+
'%%tagline%%',
|
2702 |
+
'%%post_title%%',
|
2703 |
+
'%%post_excerpt%%',
|
2704 |
+
'%%post_date%%',
|
2705 |
+
'%%post_modified_date%%',
|
2706 |
+
'%%post_author%%',
|
2707 |
+
'%%post_category%%',
|
2708 |
+
'%%post_tag%%',
|
2709 |
+
'%%_category_title%%',
|
2710 |
+
'%%_category_description%%',
|
2711 |
+
'%%tag_title%%',
|
2712 |
+
'%%tag_description%%',
|
2713 |
+
'%%term_title%%',
|
2714 |
+
'%%term_description%%',
|
2715 |
+
'%%search_keywords%%',
|
2716 |
+
'%%current_pagination%%',
|
2717 |
+
'%%cpt_plural%%',
|
2718 |
+
'%%archive_title%%',
|
2719 |
+
'%%archive_date%%',
|
2720 |
+
'%%archive_date_day%%',
|
2721 |
+
'%%archive_date_month%%',
|
2722 |
+
'%%archive_date_year%%',
|
2723 |
+
'%%wc_single_cat%%',
|
2724 |
+
'%%wc_single_tag%%',
|
2725 |
+
'%%wc_single_short_desc%%',
|
2726 |
+
'%%wc_single_price%%',
|
2727 |
+
'%%wc_single_price_exc_tax%%',
|
2728 |
+
'%%currentday%%',
|
2729 |
+
'%%currentmonth%%',
|
2730 |
+
'%%currentyear%%',
|
2731 |
+
'%%currentdate%%',
|
2732 |
+
'%%currenttime%%',
|
2733 |
+
);
|
2734 |
+
$sep = '';
|
2735 |
+
$seopress_titles_sep_option = get_option("seopress_titles_option_name");
|
2736 |
+
if (isset($seopress_titles_sep_option['seopress_titles_sep']) ) {
|
2737 |
+
$sep = $seopress_titles_sep_option['seopress_titles_sep'];
|
2738 |
+
} else {
|
2739 |
+
$sep = '-';
|
2740 |
+
}
|
2741 |
+
$seopress_titles_template_replace_array = array(
|
2742 |
+
$sep,
|
2743 |
+
get_bloginfo('name'),
|
2744 |
+
get_bloginfo('name'),
|
2745 |
+
get_bloginfo('description'),
|
2746 |
+
the_title_attribute('echo=0'),
|
2747 |
+
$seopress_get_the_excerpt,
|
2748 |
+
get_the_date(),
|
2749 |
+
get_the_modified_date(),
|
2750 |
+
$the_author_meta,
|
2751 |
+
$post_category,
|
2752 |
+
$post_tag,
|
2753 |
+
single_cat_title('', false),
|
2754 |
+
wp_trim_words(stripslashes_deep(wp_filter_nohtml_kses(category_description())),$seopress_excerpt_length),
|
2755 |
+
single_tag_title('', false),
|
2756 |
+
wp_trim_words(stripslashes_deep(wp_filter_nohtml_kses(tag_description())),$seopress_excerpt_length),
|
2757 |
+
single_term_title('', false),
|
2758 |
+
wp_trim_words(stripslashes_deep(wp_filter_nohtml_kses(term_description())),$seopress_excerpt_length),
|
2759 |
+
$get_search_query,
|
2760 |
+
$seopress_paged,
|
2761 |
+
post_type_archive_title('', false),
|
2762 |
+
get_the_archive_title(),
|
2763 |
+
get_the_archive_title(),
|
2764 |
+
get_query_var('day'),
|
2765 |
+
get_query_var('monthnum'),
|
2766 |
+
get_query_var('year'),
|
2767 |
+
$woo_single_cat_html,
|
2768 |
+
$woo_single_tag_html,
|
2769 |
+
$seopress_get_the_excerpt,
|
2770 |
+
$woo_single_price,
|
2771 |
+
$woo_single_price_exc_tax,
|
2772 |
+
date_i18n('j'),
|
2773 |
+
date_i18n('F'),
|
2774 |
+
date('Y'),
|
2775 |
+
date_i18n( get_option( 'date_format' )),
|
2776 |
+
current_time(get_option( 'time_format' )),
|
2777 |
+
);
|
2778 |
+
$seopress_titles_title_template = str_replace($seopress_titles_template_variables_array, $seopress_titles_template_replace_array, $title);
|
2779 |
+
return $seopress_titles_title_template;
|
2780 |
+
}
|
2781 |
function ampforwp_modify_archive_title( $title ) {
|
2782 |
if ( is_category() ) {
|
2783 |
$title = single_cat_title( '', false );
|
5260 |
$desc = $genesis_description;
|
5261 |
}
|
5262 |
}
|
5263 |
+
// SEOPress #1589
|
5264 |
+
if ( is_plugin_active('wp-seopress/seopress.php') && 'seopress' == ampforwp_get_setting('ampforwp-seo-selection') ) {
|
5265 |
+
$seopress_description = $seopress_options = '';
|
5266 |
+
$seopress_options = get_option("seopress_titles_option_name");
|
5267 |
+
if ( get_post_meta($post_id,'_seopress_titles_desc',true) ) {
|
5268 |
+
$seopress_description = get_post_meta($post_id,'_seopress_titles_desc',true);
|
5269 |
+
}
|
5270 |
+
if ( ampforwp_is_home() || ampforwp_is_blog() ) {
|
5271 |
+
$seopress_variables_array = array('%%sitetitle%%','%%tagline%%');
|
5272 |
+
$seopress_replace_array = array( get_bloginfo('name'), get_bloginfo('description') );
|
5273 |
+
$seopress_description = $seopress_options['seopress_titles_home_site_desc'];
|
5274 |
+
$seopress_description = str_replace($seopress_variables_array, $seopress_replace_array, $seopress_description);
|
5275 |
+
|
5276 |
+
}
|
5277 |
+
if ( is_archive() ) {
|
5278 |
+
$seopress_description = get_term_meta(get_queried_object()->{'term_id'},'_seopress_titles_desc',true);
|
5279 |
+
}
|
5280 |
+
if ( $seopress_description ) {
|
5281 |
+
$desc = $seopress_description;
|
5282 |
+
}
|
5283 |
+
}
|
5284 |
// Rank Math SEO #2701
|
5285 |
if ( defined( 'RANK_MATH_FILE' ) && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
|
5286 |
$rank_math_desc = '';
|
7082 |
}
|
7083 |
}
|
7084 |
|
7085 |
+
//for Single content Font Family
|
7086 |
+
if(ampforwp_get_setting('content-font-family-enable') && is_singular()){
|
7087 |
+
if(ampforwp_get_setting('google_current_font_data_content_single')){
|
7088 |
+
$font_data = json_decode(stripslashes(ampforwp_get_setting('google_current_font_data_content_single')));
|
7089 |
+
}
|
7090 |
+
$font_output .= "\n";
|
7091 |
+
if( ampforwp_get_setting('amp_font_type_content_single') ){
|
7092 |
+
$font_type = ampforwp_get_setting('amp_font_type_content_single');
|
7093 |
+
}
|
7094 |
+
if ( $font_type ) {
|
7095 |
+
foreach ($font_type as $key => $value) {
|
7096 |
+
// Font Weight generator
|
7097 |
+
$font_weight = (int) $value;
|
7098 |
+
$font_weight = ( $font_weight != 0 ? $font_weight : 400 );
|
7099 |
+
// Font Stlye Generator
|
7100 |
+
$font_style = preg_replace('/\d+/u', '', $value);
|
7101 |
+
$font_style = ( $font_style == 'italic' ? 'italic' : 'normal' );
|
7102 |
+
// Local Generator
|
7103 |
+
// Font Weight
|
7104 |
+
$font_local_weight = '';
|
7105 |
+
if ( $font_weight === 100 ) {
|
7106 |
+
$font_local_weight = 'Thin';
|
7107 |
+
}
|
7108 |
+
if ( $font_weight === 200 ) {
|
7109 |
+
$font_local_weight = 'Ultra Light';
|
7110 |
+
}
|
7111 |
+
if ( $font_weight === 300 ) {
|
7112 |
+
$font_local_weight = 'Light';
|
7113 |
+
}
|
7114 |
+
if ( $font_weight === 400 ) {
|
7115 |
+
$font_local_weight = 'Regular';
|
7116 |
+
}
|
7117 |
+
if ( $font_weight === 500 ) {
|
7118 |
+
$font_local_weight = 'Medium';
|
7119 |
+
}
|
7120 |
+
if ( $font_weight === 600 ) {
|
7121 |
+
$font_local_weight = 'SemiBold';
|
7122 |
+
}
|
7123 |
+
if ( $font_weight === 700 ) {
|
7124 |
+
$font_local_weight = 'Bold';
|
7125 |
+
}
|
7126 |
+
if ( $font_weight === 800 ) {
|
7127 |
+
$font_local_weight = 'ExtraBold';
|
7128 |
+
}
|
7129 |
+
if ( $font_weight === 900 ) {
|
7130 |
+
$font_local_weight = 'Black';
|
7131 |
+
}
|
7132 |
+
// Font Style
|
7133 |
+
$font_local_type = '';
|
7134 |
+
if ('italic' === $font_style) {
|
7135 |
+
$font_local_type = 'Italic';
|
7136 |
+
}
|
7137 |
+
$font_output .= "@font-face { ";
|
7138 |
+
$font_output .= "font-family: " . esc_attr(ampforwp_get_setting('amp_font_selector_content_single')). ';' ;
|
7139 |
+
$font_output .= "font-display: swap".';';
|
7140 |
+
$font_output .= "font-style: " . esc_attr($font_style) . ';';
|
7141 |
+
$font_output .= "font-weight: " . esc_attr($font_weight) . ';' ;
|
7142 |
+
$font_output .= "src: local('". esc_attr(ampforwp_get_setting('amp_font_selector_content_single'))." ".esc_attr($font_local_weight)." ".esc_attr($font_local_type)."'), local('". esc_attr(ampforwp_get_setting('amp_font_selector_content_single'))."-".esc_attr($font_local_weight).$font_local_type."'), url(" .esc_url(str_replace("http://", "https://", $font_data->files->$value)) . ');' ;
|
7143 |
+
$font_output .= "}";
|
7144 |
+
}
|
7145 |
+
}
|
7146 |
+
}
|
7147 |
+
|
7148 |
echo $font_output;
|
7149 |
}
|
7150 |
}
|
8359 |
$post_id = ampforwp_get_blog_details('id');
|
8360 |
}
|
8361 |
return $post_id;
|
8362 |
+
}
|
8363 |
+
|
8364 |
+
// schema.org/SiteNavigationElement missing from menus #1229 & #2952
|
8365 |
+
add_action('amp_post_template_footer','ampforwp_sd_sitenavigation');
|
8366 |
+
function ampforwp_sd_sitenavigation(){
|
8367 |
+
if ( ! class_exists('saswp_fields_generator') ) {
|
8368 |
+
$input = array();
|
8369 |
+
$navObj = array();
|
8370 |
+
$menuLocations = get_nav_menu_locations();
|
8371 |
+
if(!empty($menuLocations) ){
|
8372 |
+
foreach($menuLocations as $type => $id){
|
8373 |
+
$menuItems = wp_get_nav_menu_items($id);
|
8374 |
+
if($menuItems){
|
8375 |
+
if($type == 'amp-menu' || $type == 'amp-footer-menu' ){
|
8376 |
+
foreach($menuItems as $items){
|
8377 |
+
$navObj[] = array(
|
8378 |
+
"@context" => "https://schema.org",
|
8379 |
+
"@type" => "SiteNavigationElement",
|
8380 |
+
"@id" => trailingslashit(get_home_url()).$type,
|
8381 |
+
"name" => $items->title,
|
8382 |
+
"url" => $items->url
|
8383 |
+
);
|
8384 |
+
}
|
8385 |
+
}
|
8386 |
+
}
|
8387 |
+
}
|
8388 |
+
if($navObj){
|
8389 |
+
$input['@context'] = 'https://schema.org';
|
8390 |
+
$input['@graph'] = $navObj; ?>
|
8391 |
+
<script type="application/ld+json"><?php echo wp_json_encode( $input ); ?></script>
|
8392 |
+
<?php }
|
8393 |
+
}
|
8394 |
+
}
|
8395 |
+
}
|