Version Description
(5 March 2017) = * View more details at https://ampforwp.com/user-experience-52nd-update/ * Added Welcome Screen for better User experience. [Enhancement] * Undefined Index debug error resolved [Bug fix] * All in one SEO Support support tested [3rd party compatibility] * Frontpage title in Design 3 is out of the container #644 [Bug fix] * Default Table markup in AMP #643 [Enhancement] * AMP carousel is not working on Frontpage #641 [Bug fix] * Social share .js was getting added even when it was not required #638 [Bug fix] * Search Feature added for Design 1 & Design 2 [Major Improvement] * Accordion script loading issue in Design 3 #634 [Bug fix] * ?nonamp=1 links should be nofollow #622 [Bug fix] * Same Header and Color Scheme are making header elements invisible #629 [Enhancement] * In Search AMP rel canonical was different #631 [Bug fix] * Non-AMP link in Design 3 was not working when mobile redirection was enabled #632 [Bug fix] * Search form text strings are now added in the translation panel #607 [Bug fix] * Load AMP-ads conditionally only if ads are available #609 [Bug fix] * Added compatibility with Custom post type extension. Option to hide/show AMP on all custom post types #587 [Bug fix] * Report a Bug & Request feature links added [Enhancement] * If there was no menu set in Design 3 then all pages were getting displayed. #613 [Bug fix] * The tag Font is disallowed #616 [Validation Improved] * index/noindex separately added for Tags and also for Categories #606 [Enhancement] * Use of undefined constant AMP_QUERY_VAR #596 [Bug fixed] * Logo is not centered in Design 3 #586 [Bug fixed] * Remove defer, a very rare type of defer was getting added #589 [Validation Improved] * Disqus comments iframe had scrolling issues #566 [Bug fixed] * Left side blank gap in the RTL in design 2 #541 [Bug fixed] * Inline Styles not working correctly in Custom AMP Editor #533 [Bug fixed] * Re-save permalinks issues. Flushing rewrites with options saved. #511 [Improvement] * Code review and cleaning of the customizer #404 [Code Cleaning] * Google Search iframe had some header alignment issues in Design 3. #624 - Thank you Leo Osa @leoosa for the contribution! [Bug fixed] * AMP Frontpage + Override AMP Content
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 0.9.44 |
Comparing to | |
See all releases |
Code changes from version 0.9.43.6 to 0.9.44
- accelerated-moblie-pages.php +64 -30
- includes/options/admin-config.php +258 -78
- includes/options/redux-core/framework.php +2 -2
- includes/options/redux-core/inc/validation/preg_replace/validation_preg_replace.php +2 -2
- includes/options/redux-core/templates/panel/header_stickybar.tpl.php +12 -0
- includes/redirect.php +3 -3
- includes/welcome.php +415 -0
- readme.txt +45 -1
- templates/custom-amp-content.php +31 -21
- templates/design-manager/design-1/archive.php +20 -11
- templates/design-manager/design-1/elements/comments.php +2 -2
- templates/design-manager/design-1/elements/content.php +2 -2
- templates/design-manager/design-1/elements/meta-info.php +3 -1
- templates/design-manager/design-1/elements/meta-taxonomy.php +1 -1
- templates/design-manager/design-1/elements/related-posts.php +1 -1
- templates/design-manager/design-1/elements/simple-comment-button.php +1 -1
- templates/design-manager/design-1/footer.php +1 -1
- templates/design-manager/design-1/frontpage.php +3 -3
- templates/design-manager/design-1/header-bar.php +16 -14
- templates/design-manager/design-1/index.php +22 -10
- templates/design-manager/design-1/search.php +118 -0
- templates/design-manager/design-1/single.php +1 -1
- templates/design-manager/design-1/style.php +176 -816
- templates/design-manager/design-2/archive.php +19 -4
- templates/design-manager/design-2/elements/comments.php +2 -2
- templates/design-manager/design-2/elements/content.php +2 -2
- templates/design-manager/design-2/elements/related-posts.php +1 -1
- templates/design-manager/design-2/elements/simple-comment-button.php +1 -1
- templates/design-manager/design-2/footer.php +1 -1
- templates/design-manager/design-2/frontpage.php +2 -2
- templates/design-manager/design-2/header-bar.php +10 -6
- templates/design-manager/design-2/index.php +23 -7
- templates/design-manager/design-2/search.php +101 -0
- templates/design-manager/design-2/single.php +1 -1
- templates/design-manager/design-2/style.php +161 -51
- templates/design-manager/design-3/archive.php +21 -10
- templates/design-manager/design-3/elements/comments.php +2 -2
- templates/design-manager/design-3/elements/content.php +1 -1
- templates/design-manager/design-3/elements/related-posts.php +1 -1
- templates/design-manager/design-3/elements/simple-comment-button.php +1 -1
- templates/design-manager/design-3/elements/social-icons.php +3 -1
- templates/design-manager/design-3/footer.php +21 -15
- templates/design-manager/design-3/frontpage.php +3 -3
- templates/design-manager/design-3/functions.php +10 -33
- templates/design-manager/design-3/header-bar.php +7 -6
- templates/design-manager/design-3/index.php +29 -17
- templates/design-manager/design-3/search.php +20 -15
- templates/design-manager/design-3/single.php +1 -1
- templates/design-manager/design-3/style.php +74 -30
- templates/features.php +369 -104
- templates/report-bugs.php +35 -0
- templates/search-functions.php +100 -0
- templates/widget.php +170 -0
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: AMP for WP - Accelerated Mobile Pages for WordPress
|
6 |
-
Version: 0.9.
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/5
|
@@ -16,14 +16,17 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
16 |
define('AMPFORWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
|
17 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
|
18 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
19 |
-
define('AMPFORWP_VERSION','0.9.
|
|
|
|
|
|
|
20 |
|
21 |
// Rewrite the Endpoints after the plugin is activate, as priority is set to 11
|
22 |
function ampforwp_add_custom_post_support() {
|
23 |
global $redux_builder_amp;
|
24 |
if( $redux_builder_amp['amp-on-off-for-all-pages'] ) {
|
25 |
-
add_rewrite_endpoint(
|
26 |
-
add_post_type_support( 'page',
|
27 |
}
|
28 |
}
|
29 |
add_action( 'init', 'ampforwp_add_custom_post_support',11);
|
@@ -93,6 +96,9 @@ function ampforwp_rewrite_activation() {
|
|
93 |
// Flushing rewrite urls ONLY on activation
|
94 |
global $wp_rewrite;
|
95 |
$wp_rewrite->flush_rules();
|
|
|
|
|
|
|
96 |
|
97 |
}
|
98 |
|
@@ -101,6 +107,20 @@ function ampforwp_rewrite_deactivate() {
|
|
101 |
// Flushing rewrite urls ONLY on deactivation
|
102 |
global $wp_rewrite;
|
103 |
$wp_rewrite->flush_rules();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
}
|
105 |
|
106 |
// Redux panel inclusion code
|
@@ -109,43 +129,65 @@ function ampforwp_rewrite_deactivate() {
|
|
109 |
}
|
110 |
// Register all the main options
|
111 |
require_once dirname( __FILE__ ).'/includes/options/admin-config.php';
|
|
|
|
|
112 |
|
113 |
/*
|
114 |
* Load Files only in the backend
|
115 |
* As we don't need plugin activation code to run everytime the site loads
|
116 |
*/
|
117 |
if ( is_admin() ) {
|
118 |
-
|
119 |
-
add_action('init','ampforwp_plugin_notice');
|
120 |
-
|
121 |
|
|
|
|
|
|
|
|
|
122 |
function ampforwp_plugin_notice() {
|
123 |
|
124 |
if ( ! defined( 'AMP__FILE__' ) ) {
|
125 |
add_action( 'admin_notices', 'ampforwp_plugin_not_found_notice' );
|
126 |
-
function ampforwp_plugin_not_found_notice() {
|
127 |
|
128 |
$current_screen = get_current_screen();
|
129 |
|
130 |
-
if( $current_screen ->id == "plugin-install" ) {
|
131 |
return;
|
132 |
-
}
|
133 |
|
134 |
-
|
|
|
|
|
135 |
|
136 |
<?php add_thickbox(); ?>
|
137 |
<p>
|
138 |
<strong><?php _e( 'AMP Installation requires one last step:', 'ampforwp' ); ?></strong> <?php _e( 'AMP by Automattic plugin is not active', 'ampforwp' ); ?>
|
139 |
-
<strong> <span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;"><a href="
|
140 |
</span> </strong>
|
141 |
</p>
|
142 |
</div> <?php
|
143 |
}
|
144 |
|
145 |
add_action('admin_head','ampforwp_required_plugin_styling');
|
146 |
-
function ampforwp_required_plugin_styling() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
<style>
|
148 |
-
.notice, .notice-error, .is-dismissible, .ampinstallation{}
|
149 |
.plugin-card.plugin-card-amp:before{
|
150 |
content: "FINISH INSTALLATION: Install & Activate this plugin ↓";
|
151 |
font-weight: bold;
|
@@ -172,23 +214,9 @@ if ( is_admin() ) {
|
|
172 |
}
|
173 |
</style> <?php
|
174 |
}
|
175 |
-
} else {
|
176 |
-
// add_action('admin_notices', 'ampforwp_permalink_update_notice');
|
177 |
}
|
178 |
-
|
179 |
}
|
180 |
|
181 |
-
// display custom admin notice
|
182 |
-
function ampforwp_permalink_update_notice() { ?>
|
183 |
-
<div class="notice notice-warning is-dismissible">
|
184 |
-
<p>
|
185 |
-
<?php _e( 'Congratulation, your site is fully AMP enabled. Update your permalink setting once and you are done.', 'ampforwp' ); ?>
|
186 |
-
<strong> <span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;"><a href="<?php echo admin_url( 'options-permalink.php'); ?>"><?php _e( 'Update Permalink', 'ampforwp' ); ?></a> | <a href="#"><?php _e( 'Dismiss', 'ampforwp' ); ?></a>
|
187 |
-
</span> </strong>
|
188 |
-
</p>
|
189 |
-
</div>
|
190 |
-
<?php }
|
191 |
-
|
192 |
// Add Settings Button in Plugin backend
|
193 |
if ( ! function_exists( 'ampforwp_plugin_settings_link' ) ) {
|
194 |
|
@@ -208,7 +236,7 @@ if ( is_admin() ) {
|
|
208 |
if(is_plugin_active( 'amp/amp.php' )){
|
209 |
$actions = array_merge( $actions, $settings );
|
210 |
}else{
|
211 |
-
$please_activate_parent_plugin = array('Please Activate Parent plugin' => '<a href="'.get_admin_url() .'
|
212 |
$actions = array_merge( $please_activate_parent_plugin,$actions );
|
213 |
}
|
214 |
}
|
@@ -251,4 +279,10 @@ function ampforwp_plugin_init() {
|
|
251 |
new Ampforwp_Init;
|
252 |
}
|
253 |
}
|
254 |
-
add_action('init','ampforwp_plugin_init',9);
|
|
|
|
|
|
|
|
|
|
|
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: AMP for WP - Accelerated Mobile Pages for WordPress
|
6 |
+
Version: 0.9.44
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/5
|
16 |
define('AMPFORWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
|
17 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
|
18 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
19 |
+
define('AMPFORWP_VERSION','0.9.44');
|
20 |
+
// any changes to AMP_QUERY_VAR should be refelected here
|
21 |
+
define('AMPFORWP_AMP_QUERY_VAR', apply_filters( 'amp_query_var', 'amp' ) );
|
22 |
+
|
23 |
|
24 |
// Rewrite the Endpoints after the plugin is activate, as priority is set to 11
|
25 |
function ampforwp_add_custom_post_support() {
|
26 |
global $redux_builder_amp;
|
27 |
if( $redux_builder_amp['amp-on-off-for-all-pages'] ) {
|
28 |
+
add_rewrite_endpoint( AMPFORWP_AMP_QUERY_VAR, EP_PAGES | EP_PERMALINK | EP_ALL_ARCHIVES | EP_ROOT );
|
29 |
+
add_post_type_support( 'page', AMPFORWP_AMP_QUERY_VAR );
|
30 |
}
|
31 |
}
|
32 |
add_action( 'init', 'ampforwp_add_custom_post_support',11);
|
96 |
// Flushing rewrite urls ONLY on activation
|
97 |
global $wp_rewrite;
|
98 |
$wp_rewrite->flush_rules();
|
99 |
+
|
100 |
+
// Set transient for Welcome page
|
101 |
+
set_transient( 'ampforwp_welcome_screen_activation_redirect', true, 30 );
|
102 |
|
103 |
}
|
104 |
|
107 |
// Flushing rewrite urls ONLY on deactivation
|
108 |
global $wp_rewrite;
|
109 |
$wp_rewrite->flush_rules();
|
110 |
+
|
111 |
+
// Remove transient for Welcome page
|
112 |
+
delete_transient( 'ampforwp_welcome_screen_activation_redirect');
|
113 |
+
}
|
114 |
+
|
115 |
+
add_action( 'admin_init','ampforwp_parent_plugin_check');
|
116 |
+
function ampforwp_parent_plugin_check() {
|
117 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
118 |
+
$amp_plugin_activation_check = is_plugin_active( 'amp/amp.php' );
|
119 |
+
if ( $amp_plugin_activation_check ) {
|
120 |
+
// set_transient( 'ampforwp_parent_plugin_check', true, 30 );
|
121 |
+
} else {
|
122 |
+
delete_option( 'ampforwp_parent_plugin_check');
|
123 |
+
}
|
124 |
}
|
125 |
|
126 |
// Redux panel inclusion code
|
129 |
}
|
130 |
// Register all the main options
|
131 |
require_once dirname( __FILE__ ).'/includes/options/admin-config.php';
|
132 |
+
require_once AMPFORWP_PLUGIN_DIR .'templates/report-bugs.php' ;
|
133 |
+
|
134 |
|
135 |
/*
|
136 |
* Load Files only in the backend
|
137 |
* As we don't need plugin activation code to run everytime the site loads
|
138 |
*/
|
139 |
if ( is_admin() ) {
|
|
|
|
|
|
|
140 |
|
141 |
+
// Include Welcome page only on Admin pages
|
142 |
+
require AMPFORWP_PLUGIN_DIR .'/includes/welcome.php';
|
143 |
+
|
144 |
+
add_action('init','ampforwp_plugin_notice');
|
145 |
function ampforwp_plugin_notice() {
|
146 |
|
147 |
if ( ! defined( 'AMP__FILE__' ) ) {
|
148 |
add_action( 'admin_notices', 'ampforwp_plugin_not_found_notice' );
|
149 |
+
function ampforwp_plugin_not_found_notice() {
|
150 |
|
151 |
$current_screen = get_current_screen();
|
152 |
|
153 |
+
if( $current_screen ->id == "plugin-install" || $current_screen ->id == "dashboard_page_ampforwp-welcome-page" || $current_screen ->id == "ampforwp-welcome-page" ) {
|
154 |
return;
|
155 |
+
}
|
156 |
|
157 |
+
?>
|
158 |
+
|
159 |
+
<div class="notice notice-warning is-dismissible ampinstallation">
|
160 |
|
161 |
<?php add_thickbox(); ?>
|
162 |
<p>
|
163 |
<strong><?php _e( 'AMP Installation requires one last step:', 'ampforwp' ); ?></strong> <?php _e( 'AMP by Automattic plugin is not active', 'ampforwp' ); ?>
|
164 |
+
<strong> <span style="display: block; margin: 0.5em 0.5em 0 0; clear: both;"><a href="index.php?page=ampforwp-welcome-page"><?php _e( 'Continue Installation', 'ampforwp' ); ?></a> | <a href="https://www.youtube.com/embed/zzRy6Q_VGGc?TB_iframe=true&?rel=0&?autoplay=1" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','https://www.youtube.com/embed/zzRy6Q_VGGc?TB_iframe=true&?rel=0&?autoplay=1']);" class="thickbox"><?php _e( 'More Information', 'ampforwp' ); ?></a>
|
165 |
</span> </strong>
|
166 |
</p>
|
167 |
</div> <?php
|
168 |
}
|
169 |
|
170 |
add_action('admin_head','ampforwp_required_plugin_styling');
|
171 |
+
function ampforwp_required_plugin_styling() {
|
172 |
+
if ( ! defined( 'AMP__FILE__' ) ) { ?>
|
173 |
+
<style>
|
174 |
+
#toplevel_page_amp_options a .wp-menu-name:after {
|
175 |
+
content: "1";
|
176 |
+
background-color: #d54e21;
|
177 |
+
color: #fff;
|
178 |
+
border-radius: 10px;
|
179 |
+
font-size: 9px;
|
180 |
+
line-height: 17px;
|
181 |
+
font-weight: 600;
|
182 |
+
padding: 3px 7px;
|
183 |
+
margin-left: 5px;
|
184 |
+
}
|
185 |
+
</style>
|
186 |
+
<?php
|
187 |
+
}
|
188 |
+
?>
|
189 |
<style>
|
190 |
+
.notice, .notice-error, .is-dismissible, .ampinstallation{}
|
191 |
.plugin-card.plugin-card-amp:before{
|
192 |
content: "FINISH INSTALLATION: Install & Activate this plugin ↓";
|
193 |
font-weight: bold;
|
214 |
}
|
215 |
</style> <?php
|
216 |
}
|
|
|
|
|
217 |
}
|
|
|
218 |
}
|
219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
// Add Settings Button in Plugin backend
|
221 |
if ( ! function_exists( 'ampforwp_plugin_settings_link' ) ) {
|
222 |
|
236 |
if(is_plugin_active( 'amp/amp.php' )){
|
237 |
$actions = array_merge( $actions, $settings );
|
238 |
}else{
|
239 |
+
$please_activate_parent_plugin = array('Please Activate Parent plugin' => '<a href="'.get_admin_url() .'index.php?page=ampforwp-welcome-page">' . __('<span style="color:#b30000">Action Required: Continue Installation</span>', 'ampforwp') . '</a>');
|
240 |
$actions = array_merge( $please_activate_parent_plugin,$actions );
|
241 |
}
|
242 |
}
|
279 |
new Ampforwp_Init;
|
280 |
}
|
281 |
}
|
282 |
+
add_action('init','ampforwp_plugin_init',9);
|
283 |
+
|
284 |
+
/*
|
285 |
+
* customized output widget
|
286 |
+
* to be used be used in before or after Loop
|
287 |
+
*/
|
288 |
+
require AMPFORWP_PLUGIN_DIR.'/templates/widget.php';
|
@@ -87,6 +87,31 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
87 |
* <--- END HELP TABS
|
88 |
*/
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
/*
|
92 |
*
|
@@ -112,22 +137,20 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
112 |
Redux::setSection( $opt_name, array(
|
113 |
'title' => __( 'Getting Started', 'redux-framework-demo' ),
|
114 |
'id' => 'basic',
|
115 |
-
'desc' => __( '<div class="amp-faq">Thank you for using Accelerated Mobile Pages plugin. '. ' ' . sprintf( __( 'We are actively working on updating the plugin. We have built user friendly options which allows you to make changes on your AMP version.', 'redux-framework-demo' ), 'redux-framework-demo' ) .
|
116 |
. '<h2>' . __( 'Here are some quick links to help you get started:', 'redux-framework-demo' ) . '</h2>'
|
117 |
. '<p><strong>' . __( '1. <a href="http://ampforwp.com/help/" target="_blank">User Documentation</a>: ', 'redux-framework-demo' ) . '</strong>' . __( 'The AMP for WP plugin is easy to setup but we have some tutorials and guides prepared for you which will help you dive deep with the plugin.' ) . '</p>'
|
118 |
-
. '<p><strong>' . __( '2. <a href="https://ampforwp.com/
|
119 |
-
. '<p><strong>' . __( '3. <a href="
|
120 |
-
' ) . '</p>'
|
121 |
-
. '<p><strong>' . __( '
|
122 |
-
. '<p><strong>' . __( '
|
123 |
-
. '<p><strong>' . __( '
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
</
|
128 |
-
|
129 |
-
', 'redux-framework-demo' ), '<a target="_blank" href="' . esc_url( 'https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages?rate=5#postform' ) . '">', '</a>' )
|
130 |
-
. '</p></div>'
|
131 |
|
132 |
, 'redux-framework-demo' ),
|
133 |
'icon' => 'el el-home'
|
@@ -161,7 +184,6 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
161 |
'desc' => __('Default width is 190 pixels', 'redux-framework-demo'),
|
162 |
'default' => '190',
|
163 |
'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
|
164 |
-
|
165 |
),
|
166 |
array(
|
167 |
'id' => 'opt-media-height',
|
@@ -172,8 +194,43 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
172 |
'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
|
173 |
|
174 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
array(
|
178 |
'id' =>'amp-frontpage-select-option',
|
179 |
'type' => 'switch',
|
@@ -182,6 +239,7 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
182 |
'subtitle' => __('Custom AMP front page', 'redux-framework-demo'),
|
183 |
'true' => 'true',
|
184 |
'false' => 'false',
|
|
|
185 |
),
|
186 |
array(
|
187 |
'id' => 'amp-frontpage-select-option-pages',
|
@@ -204,52 +262,64 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
204 |
'subtitle' => __('Enable/Disable display of title on the Static Front Page.', 'redux-framework-demo'),
|
205 |
'default' => 0,
|
206 |
'required' => array('amp-frontpage-select-option', '=' , '1'),
|
207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
array(
|
209 |
-
'id'
|
210 |
-
'type'
|
211 |
-
'title'
|
212 |
-
'subtitle'
|
213 |
-
'default'
|
214 |
-
'
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
|
|
|
|
|
|
|
|
|
|
250 |
|
251 |
-
)
|
252 |
-
) );//END
|
253 |
|
254 |
// AMP GTM SECTION
|
255 |
Redux::setSection( $opt_name, array(
|
@@ -369,6 +439,15 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
369 |
endif;
|
370 |
//End of code for fetching ctegories to show as a list in redux settings
|
371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
// AMP Design SECTION
|
373 |
Redux::setSection( $opt_name, array(
|
374 |
'title' => __( 'Design', 'redux-framework-demo' ),
|
@@ -405,7 +484,7 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
405 |
array(
|
406 |
'id' => 'amp-opt-color-rgba-headercolor',
|
407 |
'type' => 'color_rgba',
|
408 |
-
'title' => 'Header Color',
|
409 |
'default' => array(
|
410 |
'color' => '#FFFFFF',
|
411 |
),
|
@@ -422,8 +501,20 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
422 |
),
|
423 |
'required' => array(
|
424 |
array('amp-design-selector', '=' , '3')
|
425 |
-
|
426 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
|
428 |
array(
|
429 |
'id' => 'amp-design-3-featured-slider',
|
@@ -447,12 +538,39 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
447 |
array(
|
448 |
'id' => 'amp-design-3-search-feature',
|
449 |
'type' => 'switch',
|
|
|
450 |
'title' => __( 'Search', 'redux-framework-demo' ),
|
451 |
'required' => array(
|
452 |
array('amp-design-selector', '=' , '3')
|
453 |
),
|
|
|
454 |
'default' => '0'
|
455 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
array(
|
457 |
'id' => 'amp-design-3-credit-link',
|
458 |
'type' => 'switch',
|
@@ -547,7 +665,7 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
547 |
|
548 |
),
|
549 |
array(
|
550 |
-
'id' => 'ampforwp-robots-archive-date-
|
551 |
'type' => 'switch',
|
552 |
'title' => __('Date Archive pages', 'redux-framework-demo'),
|
553 |
'default' => 1,
|
@@ -556,13 +674,20 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
556 |
|
557 |
),
|
558 |
array(
|
559 |
-
'id' => 'ampforwp-robots-archive-
|
560 |
'type' => 'switch',
|
561 |
-
'title' => __('Categories
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
562 |
'default' => 1,
|
563 |
'on' => 'index',
|
564 |
'off' => 'noindex'
|
565 |
-
|
566 |
),
|
567 |
|
568 |
|
@@ -576,7 +701,20 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
576 |
'title' => __( 'Menu', 'redux-framework-demo' ),
|
577 |
'desc' => __( 'Add Menus to your AMP pages by clicking on this <a href="'.trailingslashit(get_admin_url()).'nav-menus.php?action=locations">link</a>'),
|
578 |
'id' => 'amp-menus',
|
579 |
-
'subsection' => true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
|
581 |
) ;
|
582 |
|
@@ -1227,13 +1365,6 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1227 |
'id' => 'amp-translator',
|
1228 |
'subsection' => true,
|
1229 |
'fields' => array(
|
1230 |
-
array(
|
1231 |
-
'id' => 'amp-translator-search-text',
|
1232 |
-
'type' => 'text',
|
1233 |
-
'title' => __(' You searched for: ', 'redux-framework-demo'),
|
1234 |
-
'default' => ' You searched for: ',
|
1235 |
-
'placeholder'=>'write here'
|
1236 |
-
),
|
1237 |
array(
|
1238 |
'id' => 'amp-translator-show-more-posts-text',
|
1239 |
'type' => 'text',
|
@@ -1394,6 +1525,13 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1394 |
'title' => __('Tag (archive title)', 'redux-framework-demo'),
|
1395 |
'default' => 'Tag: ',
|
1396 |
'placeholder'=>'write here'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1397 |
),
|
1398 |
array(
|
1399 |
'id' => 'amp-translator-next-read-text',
|
@@ -1402,6 +1540,44 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1402 |
'default' => 'Next Read: ',
|
1403 |
'placeholder'=>'write here'
|
1404 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1405 |
)
|
1406 |
) );
|
1407 |
|
@@ -1431,7 +1607,7 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1431 |
// Disqus Comments
|
1432 |
Redux::setSection( $opt_name, array(
|
1433 |
'title' => __( 'Disqus Comments', 'redux-framework-demo' ),
|
1434 |
-
'desc' => '<a href="https://github.com/disqus/disqus-install-examples/tree/master/google-amp"> Link to Official Disqus documentation. </a>',
|
1435 |
'id' => 'disqus-comments',
|
1436 |
'subsection' => true,
|
1437 |
'fields' => array(
|
@@ -1448,6 +1624,7 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1448 |
'title' => __('Disqus Name', 'redux-framework-demo'),
|
1449 |
'subtitle' => __('Eg: https://xyz.disqus.com', 'redux-framework-demo'),
|
1450 |
'required' => array('ampforwp-disqus-comments-support', '=' , '1'),
|
|
|
1451 |
),
|
1452 |
|
1453 |
array(
|
@@ -1463,7 +1640,7 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1463 |
'id' => 'ampforwp-disqus-host-file',
|
1464 |
'type' => 'text',
|
1465 |
'title' => __('Disqus Host File', 'redux-framework-demo'),
|
1466 |
-
'subtitle' => __('<a href="
|
1467 |
'placeholder' => 'https://comments.example.com/disqus.php',
|
1468 |
'required' => array('ampforwp-disqus-host-position', '=' , '0'),
|
1469 |
),
|
@@ -1479,19 +1656,22 @@ Redux::setSection( $opt_name, array(
|
|
1479 |
'subsection' => true,
|
1480 |
'fields' => array(
|
1481 |
|
1482 |
-
|
1483 |
'id' => 'ampforwp-homepage-on-off-support',
|
1484 |
'type' => 'switch',
|
1485 |
'title' => __('Homepage Support', 'redux-framework-demo'),
|
1486 |
'subtitle' => __('Enable/Disable Home page using this switch.', 'redux-framework-demo'),
|
1487 |
'default' => '1'
|
1488 |
-
)
|
1489 |
array(
|
1490 |
'id' =>'amp-on-off-support-for-non-amp-home-page',
|
1491 |
'type' => 'switch',
|
1492 |
'title' => __('Non-AMP HomePage link in Header and Logo', 'redux-framework-demo'),
|
1493 |
'subtitle' => __('If you want users in header to go to non-AMP website from the Header, then you can enable this option', 'redux-framework-demo'),
|
1494 |
'default' => 0,
|
|
|
|
|
|
|
1495 |
),
|
1496 |
array(
|
1497 |
'id' => 'ampforwp-archive-support',
|
87 |
* <--- END HELP TABS
|
88 |
*/
|
89 |
|
90 |
+
function ampforwp_plugin_activation_notice() {
|
91 |
+
$output ='';
|
92 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
93 |
+
if ( is_plugin_inactive( 'amp/amp.php' ) ) {
|
94 |
+
$output = '<h1 style=" color: #388E3C;
|
95 |
+
font-weight: 500;
|
96 |
+
margin-top: 38px;"><i class="dashicons dashicons-editor-help" style="
|
97 |
+
font-size: 36px;
|
98 |
+
margin-right: 20px;
|
99 |
+
margin-top: -1px;"></i>Need Help?</h1>
|
100 |
+
<p style="
|
101 |
+
font-family: georgia;
|
102 |
+
font-size: 20px;
|
103 |
+
font-style: italic;
|
104 |
+
margin-bottom: 3px;
|
105 |
+
line-height: 1.5;
|
106 |
+
margin-top: 11px;
|
107 |
+
color: #666;">Were bunch of passionate people that are dedicated towards helping our users. We will be happy to help you!</p>
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
';
|
112 |
+
}
|
113 |
+
return $output ;
|
114 |
+
}
|
115 |
|
116 |
/*
|
117 |
*
|
137 |
Redux::setSection( $opt_name, array(
|
138 |
'title' => __( 'Getting Started', 'redux-framework-demo' ),
|
139 |
'id' => 'basic',
|
140 |
+
'desc' => __( '<div class="amp-faq">Thank you for using Accelerated Mobile Pages plugin. '. ' ' . sprintf( __( 'We are actively working on updating the plugin. We have built user friendly options which allows you to make changes on your AMP version.', 'redux-framework-demo' ), 'redux-framework-demo' ) . ampforwp_plugin_activation_notice()
|
141 |
. '<h2>' . __( 'Here are some quick links to help you get started:', 'redux-framework-demo' ) . '</h2>'
|
142 |
. '<p><strong>' . __( '1. <a href="http://ampforwp.com/help/" target="_blank">User Documentation</a>: ', 'redux-framework-demo' ) . '</strong>' . __( 'The AMP for WP plugin is easy to setup but we have some tutorials and guides prepared for you which will help you dive deep with the plugin.' ) . '</p>'
|
143 |
+
. '<p><strong>' . __( '2. <a href="https://ampforwp.com/chat/" target="_blank">Chat with Team AMP</a>: ', 'redux-framework-demo' ) . '</strong>' . __( 'We’re bunch of passionate people that are dedicated towards helping our users. We will be happy to help you!' ) . '</p>'
|
144 |
+
. '<p><strong>' . __( '3. <a href="https://ampforwp.com/help/#extend" target="_blank">Developer Docs</a>: ', 'redux-framework-demo' ) . '</strong>' . __( 'We have created special documentations for developers and semi technical users who are willing to modify the plugin according to their own needs.' ) . '</p>'
|
145 |
+
. '<p><strong>' . __( '4. <a href="admin.php?page=amp_options&tab=14" target="_blank">Fixing AMP Validation Errors</a>: ', 'redux-framework-demo' ) . '</strong>' . __( 'We will personally take care that your website’s AMP version is perfectly validated. We will make sure that your AMP version gets approved and indexed by Google Webmaster Tools properly and we will even keep an eye on AMP updates from Google and implement them into your website.' ) . '</p>'
|
146 |
+
. '<p><strong>' . __( '5. <a href="https://ampforwp.com/help/#support-forum" target="_blank">Community Support Forum</a>: ', 'redux-framework-demo' ) . '</strong>' . __( 'We have a special community support forum where you can ask us questions and get help about your AMP related questions. Delivering a good user experience means alot to us and so we try our best to reply each and every question that gets asked.' ) . '</p>'
|
147 |
+
. '<p><strong>' . __( '6. <a href="https://ampforwp.com/help/#contact" target="_blank">Hire Us / Other queries</a>: ', 'redux-framework-demo' ) . '</strong>' . __( 'We try to answer each and every email, so remember to give us some time. For any other queries, please use the contact form. Please be descriptive as possible.' ) . '</p>'
|
148 |
+
. '<p><strong>' . __( '7. <a href="http://ampforwp.com/new/" target="_blank"> What\'s New in this Version?</a>: ', 'redux-framework-demo' ) . '</strong>' . __( 'If you want to know whats new in the latest version of the plugin, then please use this link. ') . '</p>'
|
149 |
+
|
150 |
+
. sprintf( __( ' </br /></br />
|
151 |
+
<h2>%1$sLike this plugin? Support us by leaving a 5 Star Rating%2$s</h2><br />
|
152 |
+
', 'redux-framework-demo' ), '<a target="_blank" href="' . esc_url( 'https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages?rate=5#postform' ) . '">', '</a>' )
|
153 |
+
. '</p></div>'
|
|
|
|
|
154 |
|
155 |
, 'redux-framework-demo' ),
|
156 |
'icon' => 'el el-home'
|
184 |
'desc' => __('Default width is 190 pixels', 'redux-framework-demo'),
|
185 |
'default' => '190',
|
186 |
'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
|
|
|
187 |
),
|
188 |
array(
|
189 |
'id' => 'opt-media-height',
|
194 |
'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
|
195 |
|
196 |
),
|
197 |
+
array(
|
198 |
+
'id' =>'amp-on-off-for-all-pages',
|
199 |
+
'type' => 'switch',
|
200 |
+
'title' => __('AMP on Pages', 'redux-framework-demo'),
|
201 |
+
'subtitle' => __('Enable or Disable AMP on all Pages', 'redux-framework-demo'),
|
202 |
+
'default' => 1,
|
203 |
+
'desc' => __( 'Re-Save permalink if you make changes in this option, please have a look <a href="https://ampforwp.com/flush-rewrite-urls/">here</a> on how to do it', 'redux-framework-demo' ),
|
204 |
+
),
|
205 |
|
206 |
+
// array(
|
207 |
+
// 'id' => 'amp-ad-places',
|
208 |
+
// 'type' => 'select',
|
209 |
+
// 'title' => __( 'Ads on Page', 'redux-framework-demo' ),
|
210 |
+
// 'subtitle' => __( 'select your preferece for Ads on Post Types', 'redux-framework-demo' ),
|
211 |
+
// 'options' => array(
|
212 |
+
// '1' => __('Only on Posts', 'redux-framework-demo' ),
|
213 |
+
// '2' => __('Only on Pages', 'redux-framework-demo' ),
|
214 |
+
// '3' => __('on Both', 'redux-framework-demo' ),
|
215 |
+
// ),
|
216 |
+
// 'default' => '3'
|
217 |
+
// ),
|
218 |
|
219 |
+
)
|
220 |
+
) );//END
|
221 |
+
// Homepage Section
|
222 |
+
Redux::setSection( $opt_name, array(
|
223 |
+
'title' => __( 'Homepage', 'redux-framework-demo' ),
|
224 |
+
'id' => 'amp-homepage-settings',
|
225 |
+
'subsection' => true,
|
226 |
+
'fields' => array(
|
227 |
+
array(
|
228 |
+
'id' => 'ampforwp-homepage-on-off-support',
|
229 |
+
'type' => 'switch',
|
230 |
+
'title' => __('Homepage Support', 'redux-framework-demo'),
|
231 |
+
'subtitle' => __('Enable/Disable Home page using this switch.', 'redux-framework-demo'),
|
232 |
+
'default' => '1'
|
233 |
+
),
|
234 |
array(
|
235 |
'id' =>'amp-frontpage-select-option',
|
236 |
'type' => 'switch',
|
239 |
'subtitle' => __('Custom AMP front page', 'redux-framework-demo'),
|
240 |
'true' => 'true',
|
241 |
'false' => 'false',
|
242 |
+
'required' => array('ampforwp-homepage-on-off-support','=','1'),
|
243 |
),
|
244 |
array(
|
245 |
'id' => 'amp-frontpage-select-option-pages',
|
262 |
'subtitle' => __('Enable/Disable display of title on the Static Front Page.', 'redux-framework-demo'),
|
263 |
'default' => 0,
|
264 |
'required' => array('amp-frontpage-select-option', '=' , '1'),
|
265 |
+
),
|
266 |
+
array(
|
267 |
+
'id' => 'ampforwp-homepage-posts-image-modify-size',
|
268 |
+
'type' => 'switch',
|
269 |
+
'title' => __('Override Homepage Thumbnail Size', 'redux-framework-demo'),
|
270 |
+
'default' => 0,
|
271 |
+
'required' => array(
|
272 |
+
array('amp-design-selector','!=',3)
|
273 |
+
)
|
274 |
+
),
|
275 |
array(
|
276 |
+
'id' => 'ampforwp-homepage-posts-design-1-2-width',
|
277 |
+
'type' => 'text',
|
278 |
+
'title' => __('Image Width', 'redux-framework-demo'),
|
279 |
+
'subtitle' => __('Defaults to 100', 'redux-framework-demo'),
|
280 |
+
'default' => 100,
|
281 |
+
'required' => array(
|
282 |
+
array('amp-design-selector','!=',3),
|
283 |
+
array('ampforwp-homepage-posts-image-modify-size','=',1)
|
284 |
+
)
|
285 |
+
),
|
286 |
+
array(
|
287 |
+
'id' => 'ampforwp-homepage-posts-design-1-2-height',
|
288 |
+
'type' => 'text',
|
289 |
+
'title' => __('Image Height', 'redux-framework-demo'),
|
290 |
+
'subtitle' => __('Defaults to 75', 'redux-framework-demo'),
|
291 |
+
'default' => 75,
|
292 |
+
'required' => array(
|
293 |
+
array('amp-design-selector','!=',3),
|
294 |
+
array('ampforwp-homepage-posts-image-modify-size','=',1)
|
295 |
+
)
|
296 |
+
),
|
297 |
+
array(
|
298 |
+
'id' => 'ampforwp-homepage-posts-design-3-width',
|
299 |
+
'type' => 'text',
|
300 |
+
'title' => __('Image Width', 'redux-framework-demo'),
|
301 |
+
'subtitle' => __('Defaults to 450', 'redux-framework-demo'),
|
302 |
+
'default' => 330,
|
303 |
+
'required' => array(
|
304 |
+
array('amp-design-selector','=',3),
|
305 |
+
array('ampforwp-homepage-posts-image-modify-size','=',1)
|
306 |
+
)
|
307 |
+
),
|
308 |
+
array(
|
309 |
+
'id' => 'ampforwp-homepage-posts-design-3-height',
|
310 |
+
'type' => 'text',
|
311 |
+
'title' => __('Image Height', 'redux-framework-demo'),
|
312 |
+
'subtitle' => __('Defaults to 270', 'redux-framework-demo'),
|
313 |
+
'default' => 198,
|
314 |
+
'required' => array(
|
315 |
+
array('amp-design-selector','=',3),
|
316 |
+
array('ampforwp-homepage-posts-image-modify-size','=',1)
|
317 |
+
)
|
318 |
+
)
|
319 |
+
)
|
320 |
+
)
|
321 |
+
);
|
322 |
|
|
|
|
|
323 |
|
324 |
// AMP GTM SECTION
|
325 |
Redux::setSection( $opt_name, array(
|
439 |
endif;
|
440 |
//End of code for fetching ctegories to show as a list in redux settings
|
441 |
|
442 |
+
function ampforwp_get_element_default_color() {
|
443 |
+
$default_value = get_option('redux_builder_amp', true);
|
444 |
+
$default_value = $default_value['amp-opt-color-rgba-colorscheme']['color'];
|
445 |
+
if ( empty( $default_value ) ) {
|
446 |
+
$default_value = '#333';
|
447 |
+
}
|
448 |
+
return $default_value;
|
449 |
+
}
|
450 |
+
|
451 |
// AMP Design SECTION
|
452 |
Redux::setSection( $opt_name, array(
|
453 |
'title' => __( 'Design', 'redux-framework-demo' ),
|
484 |
array(
|
485 |
'id' => 'amp-opt-color-rgba-headercolor',
|
486 |
'type' => 'color_rgba',
|
487 |
+
'title' => 'Header Background Color',
|
488 |
'default' => array(
|
489 |
'color' => '#FFFFFF',
|
490 |
),
|
501 |
),
|
502 |
'required' => array(
|
503 |
array('amp-design-selector', '=' , '3')
|
504 |
+
)
|
505 |
+
),
|
506 |
+
array(
|
507 |
+
'id' => 'amp-opt-color-rgba-headerelements',
|
508 |
+
'type' => 'color_rgba',
|
509 |
+
'title' => 'Header Elements Color',
|
510 |
+
'default' => array(
|
511 |
+
'color' => ampforwp_get_element_default_color(),
|
512 |
+
),
|
513 |
+
'required' => array(
|
514 |
+
array('amp-design-selector', '=' , '3')
|
515 |
+
)
|
516 |
+
),
|
517 |
+
|
518 |
|
519 |
array(
|
520 |
'id' => 'amp-design-3-featured-slider',
|
538 |
array(
|
539 |
'id' => 'amp-design-3-search-feature',
|
540 |
'type' => 'switch',
|
541 |
+
'subtitle' => __('HTTPS is mandatory for Search', 'redux-framework-demo'),
|
542 |
'title' => __( 'Search', 'redux-framework-demo' ),
|
543 |
'required' => array(
|
544 |
array('amp-design-selector', '=' , '3')
|
545 |
),
|
546 |
+
'desc' => __('HTTPS is required for search to work on AMP pages.', 'redux-framework-demo' ),
|
547 |
'default' => '0'
|
548 |
),
|
549 |
+
|
550 |
+
array(
|
551 |
+
'id' => 'amp-design-2-search-feature',
|
552 |
+
'subtitle' => __('HTTPS is mandatory for Search', 'redux-framework-demo'),
|
553 |
+
'type' => 'switch',
|
554 |
+
'title' => __( 'Search', 'redux-framework-demo' ),
|
555 |
+
'required' => array(
|
556 |
+
array('amp-design-selector', '=' , '2')
|
557 |
+
),
|
558 |
+
'desc' => __('HTTPS is required for search to work on AMP pages.', 'redux-framework-demo' ),
|
559 |
+
'default' => '0'
|
560 |
+
),
|
561 |
+
|
562 |
+
array(
|
563 |
+
'id' => 'amp-design-1-search-feature',
|
564 |
+
'subtitle' => __('HTTPS is mandatory for Search', 'redux-framework-demo'),
|
565 |
+
'type' => 'switch',
|
566 |
+
'title' => __( 'Search', 'redux-framework-demo' ),
|
567 |
+
'required' => array(
|
568 |
+
array('amp-design-selector', '=' , '1')
|
569 |
+
),
|
570 |
+
'desc' => __('HTTPS is required for search to work on AMP pages.', 'redux-framework-demo' ),
|
571 |
+
'default' => '0'
|
572 |
+
),
|
573 |
+
|
574 |
array(
|
575 |
'id' => 'amp-design-3-credit-link',
|
576 |
'type' => 'switch',
|
665 |
|
666 |
),
|
667 |
array(
|
668 |
+
'id' => 'ampforwp-robots-archive-date-pages',
|
669 |
'type' => 'switch',
|
670 |
'title' => __('Date Archive pages', 'redux-framework-demo'),
|
671 |
'default' => 1,
|
674 |
|
675 |
),
|
676 |
array(
|
677 |
+
'id' => 'ampforwp-robots-archive-category-pages',
|
678 |
'type' => 'switch',
|
679 |
+
'title' => __('Categories', 'redux-framework-demo'),
|
680 |
+
'default' => 1,
|
681 |
+
'on' => 'index',
|
682 |
+
'off' => 'noindex'
|
683 |
+
),
|
684 |
+
array(
|
685 |
+
'id' => 'ampforwp-robots-archive-tag-pages',
|
686 |
+
'type' => 'switch',
|
687 |
+
'title' => __('Tags', 'redux-framework-demo'),
|
688 |
'default' => 1,
|
689 |
'on' => 'index',
|
690 |
'off' => 'noindex'
|
|
|
691 |
),
|
692 |
|
693 |
|
701 |
'title' => __( 'Menu', 'redux-framework-demo' ),
|
702 |
'desc' => __( 'Add Menus to your AMP pages by clicking on this <a href="'.trailingslashit(get_admin_url()).'nav-menus.php?action=locations">link</a>'),
|
703 |
'id' => 'amp-menus',
|
704 |
+
'subsection' => true,
|
705 |
+
'fields' => array(
|
706 |
+
|
707 |
+
array(
|
708 |
+
'id' => 'ampforwp-auto-amp-menu-link',
|
709 |
+
'type' => 'switch',
|
710 |
+
'title' => __('Auto Add AMP in Menu URL', 'redux-framework-demo'),
|
711 |
+
'subtitle' => __('Automatically add <code>AMP</code> at the end of menu url', 'redux-framework-demo'),
|
712 |
+
'true' => 'true',
|
713 |
+
'false' => 'false',
|
714 |
+
'default' => 0
|
715 |
+
),
|
716 |
+
)
|
717 |
+
)
|
718 |
|
719 |
) ;
|
720 |
|
1365 |
'id' => 'amp-translator',
|
1366 |
'subsection' => true,
|
1367 |
'fields' => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1368 |
array(
|
1369 |
'id' => 'amp-translator-show-more-posts-text',
|
1370 |
'type' => 'text',
|
1525 |
'title' => __('Tag (archive title)', 'redux-framework-demo'),
|
1526 |
'default' => 'Tag: ',
|
1527 |
'placeholder'=>'write here'
|
1528 |
+
),
|
1529 |
+
array(
|
1530 |
+
'id' => 'amp-translator-show-more-text',
|
1531 |
+
'type' => 'text',
|
1532 |
+
'title' => __('View More Posts (Widget Button)', 'redux-framework-demo'),
|
1533 |
+
'default' => 'View More Posts',
|
1534 |
+
'placeholder'=>'write here'
|
1535 |
),
|
1536 |
array(
|
1537 |
'id' => 'amp-translator-next-read-text',
|
1540 |
'default' => 'Next Read: ',
|
1541 |
'placeholder'=>'write here'
|
1542 |
),
|
1543 |
+
array(
|
1544 |
+
'id' => 'amp-translator-search-text',
|
1545 |
+
'type' => 'text',
|
1546 |
+
'title' => __(' You searched for: ', 'redux-framework-demo'),
|
1547 |
+
'default' => ' You searched for: ',
|
1548 |
+
'placeholder'=>'write here'
|
1549 |
+
),
|
1550 |
+
array(
|
1551 |
+
'id' => 'amp-translator-search-no-found',
|
1552 |
+
'type' => 'text',
|
1553 |
+
'title' => __(' It seems we can\'t find what you\'re looking for. ', 'redux-framework-demo'),
|
1554 |
+
'default' => ' It seems we can\'t find what you\'re looking for. ',
|
1555 |
+
'placeholder'=>'write here'
|
1556 |
+
),
|
1557 |
+
array(
|
1558 |
+
'id' => 'design-3-search-subsection',
|
1559 |
+
'type' => 'section',
|
1560 |
+
'title' => __('Search bar Translation Text', 'redux-framework-demo'),
|
1561 |
+
'indent' => true,
|
1562 |
+
),
|
1563 |
+
array(
|
1564 |
+
'id' => 'ampforwp-search-placeholder',
|
1565 |
+
'type' => 'text',
|
1566 |
+
'title' => __('Type Here', 'redux-framework-demo'),
|
1567 |
+
'default' => 'Type Here',
|
1568 |
+
'desc' => 'This is the text that gets shown in for Search Box',
|
1569 |
+
'placeholder'=>'write here',
|
1570 |
+
|
1571 |
+
),
|
1572 |
+
array(
|
1573 |
+
'id' => 'ampforwp-search-label',
|
1574 |
+
'type' => 'text',
|
1575 |
+
'title' => __('Type your search query and hit enter', 'redux-framework-demo'),
|
1576 |
+
'desc' => 'This is the text that gets shown above Search Box',
|
1577 |
+
'default' => 'Type your search query and hit enter: ',
|
1578 |
+
'placeholder'=>'write here',
|
1579 |
+
|
1580 |
+
),
|
1581 |
)
|
1582 |
) );
|
1583 |
|
1607 |
// Disqus Comments
|
1608 |
Redux::setSection( $opt_name, array(
|
1609 |
'title' => __( 'Disqus Comments', 'redux-framework-demo' ),
|
1610 |
+
// 'desc' => '<a href="https://github.com/disqus/disqus-install-examples/tree/master/google-amp"> Link to Official Disqus documentation. </a>',
|
1611 |
'id' => 'disqus-comments',
|
1612 |
'subsection' => true,
|
1613 |
'fields' => array(
|
1624 |
'title' => __('Disqus Name', 'redux-framework-demo'),
|
1625 |
'subtitle' => __('Eg: https://xyz.disqus.com', 'redux-framework-demo'),
|
1626 |
'required' => array('ampforwp-disqus-comments-support', '=' , '1'),
|
1627 |
+
'default' => ''
|
1628 |
),
|
1629 |
|
1630 |
array(
|
1640 |
'id' => 'ampforwp-disqus-host-file',
|
1641 |
'type' => 'text',
|
1642 |
'title' => __('Disqus Host File', 'redux-framework-demo'),
|
1643 |
+
'subtitle' => __('<a href="https://ampforwp.com/host-disqus-comments/"> Click here to know, How to Setup Disqus Host file on your servers </a>', 'redux-framework-demo'),
|
1644 |
'placeholder' => 'https://comments.example.com/disqus.php',
|
1645 |
'required' => array('ampforwp-disqus-host-position', '=' , '0'),
|
1646 |
),
|
1656 |
'subsection' => true,
|
1657 |
'fields' => array(
|
1658 |
|
1659 |
+
/* array(
|
1660 |
'id' => 'ampforwp-homepage-on-off-support',
|
1661 |
'type' => 'switch',
|
1662 |
'title' => __('Homepage Support', 'redux-framework-demo'),
|
1663 |
'subtitle' => __('Enable/Disable Home page using this switch.', 'redux-framework-demo'),
|
1664 |
'default' => '1'
|
1665 |
+
),*/
|
1666 |
array(
|
1667 |
'id' =>'amp-on-off-support-for-non-amp-home-page',
|
1668 |
'type' => 'switch',
|
1669 |
'title' => __('Non-AMP HomePage link in Header and Logo', 'redux-framework-demo'),
|
1670 |
'subtitle' => __('If you want users in header to go to non-AMP website from the Header, then you can enable this option', 'redux-framework-demo'),
|
1671 |
'default' => 0,
|
1672 |
+
'required' => array(
|
1673 |
+
array('ampforwp-homepage-on-off-support','=',1)
|
1674 |
+
)
|
1675 |
),
|
1676 |
array(
|
1677 |
'id' => 'ampforwp-archive-support',
|
@@ -407,8 +407,8 @@
|
|
407 |
add_action( "wp_ajax_" . $this->args['opt_name'] . '_ajax_save', array( $this, "ajax_save" ) );
|
408 |
|
409 |
if ( $this->args['dev_mode'] == true || Redux_Helpers::isLocalHost() == true ) {
|
410 |
-
|
411 |
-
new reduxDashboardWidget( $this );
|
412 |
|
413 |
// if ( ! isset ( $GLOBALS['redux_notice_check'] ) ) {
|
414 |
// require_once 'core/newsflash.php';
|
407 |
add_action( "wp_ajax_" . $this->args['opt_name'] . '_ajax_save', array( $this, "ajax_save" ) );
|
408 |
|
409 |
if ( $this->args['dev_mode'] == true || Redux_Helpers::isLocalHost() == true ) {
|
410 |
+
// require_once 'core/dashboard.php';
|
411 |
+
// new reduxDashboardWidget( $this );
|
412 |
|
413 |
// if ( ! isset ( $GLOBALS['redux_notice_check'] ) ) {
|
414 |
// require_once 'core/newsflash.php';
|
@@ -26,8 +26,8 @@
|
|
26 |
* @since ReduxFramework 1.0.0
|
27 |
*/
|
28 |
function validate() {
|
29 |
-
|
30 |
-
$this->value =
|
31 |
} //function
|
32 |
} //class
|
33 |
}
|
26 |
* @since ReduxFramework 1.0.0
|
27 |
*/
|
28 |
function validate() {
|
29 |
+
|
30 |
+
$this->value = preg_replace_callback($this->field['preg']['pattern'], function($matches){return $this->field['preg']['replacement'];}, $this->value);
|
31 |
} //function
|
32 |
} //class
|
33 |
}
|
@@ -15,6 +15,18 @@
|
|
15 |
<?php esc_attr_e( 'Expand', 'redux-framework' ); ?>
|
16 |
</a>
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
<div class="redux-action_bar">
|
19 |
<span class="spinner"></span>
|
20 |
<?php if ( false === $this->parent->args['hide_save'] ) { ?>
|
15 |
<?php esc_attr_e( 'Expand', 'redux-framework' ); ?>
|
16 |
</a>
|
17 |
|
18 |
+
<?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
19 |
+
if ( is_plugin_inactive( 'amp/amp.php' ) ) {?>
|
20 |
+
|
21 |
+
<p style=" text-align: left;
|
22 |
+
margin-left: 50px;
|
23 |
+
margin-top: 7px;">
|
24 |
+
<a style="color: #e91e63;text-decoration: none;font-size: 15px;line-height: 1;" href="index.php?page=ampforwp-welcome-page">Action Required
|
25 |
+
<span style="box-shadow: 0px 1px 13px rgba(0, 0, 0, 0.2);border-radius: 40px;padding: 6px 18px 8px 20px;margin-left: 12px;color: #fff;background: #e91e63;font-size: 13px;">Finish Installation</span>
|
26 |
+
</a>
|
27 |
+
</p>
|
28 |
+
<?php } ?>
|
29 |
+
|
30 |
<div class="redux-action_bar">
|
31 |
<span class="spinner"></span>
|
32 |
<?php if ( false === $this->parent->args['hide_save'] ) { ?>
|
@@ -44,7 +44,7 @@ function ampforwp_page_template_redirect() {
|
|
44 |
$_SESSION['ampforwp_amp_mode']='mobile-on';
|
45 |
if ( is_home() ) {
|
46 |
if ( $redux_builder_amp['ampforwp-homepage-on-off-support'] == 1 ) {
|
47 |
-
wp_redirect( trailingslashit( esc_url( home_url() ) ) .
|
48 |
exit();
|
49 |
}
|
50 |
}
|
@@ -52,7 +52,7 @@ function ampforwp_page_template_redirect() {
|
|
52 |
if ( $redux_builder_amp['ampforwp-archive-support'] == 1 ) {
|
53 |
global $wp;
|
54 |
$current_archive_url = home_url( $wp->request );
|
55 |
-
wp_redirect( trailingslashit( esc_url( $current_archive_url ) ) .
|
56 |
exit();
|
57 |
}
|
58 |
} else {
|
@@ -60,7 +60,7 @@ function ampforwp_page_template_redirect() {
|
|
60 |
if( $ampforwp_amp_post_on_off_meta === 'hide-amp' ) {
|
61 |
//dont Echo anything
|
62 |
} else {
|
63 |
-
wp_redirect( trailingslashit( esc_url( ( get_permalink( $id ) ) ) ) .
|
64 |
exit();
|
65 |
}
|
66 |
}
|
44 |
$_SESSION['ampforwp_amp_mode']='mobile-on';
|
45 |
if ( is_home() ) {
|
46 |
if ( $redux_builder_amp['ampforwp-homepage-on-off-support'] == 1 ) {
|
47 |
+
wp_redirect( trailingslashit( esc_url( home_url() ) ) . AMPFORWP_AMP_QUERY_VAR , 301 );
|
48 |
exit();
|
49 |
}
|
50 |
}
|
52 |
if ( $redux_builder_amp['ampforwp-archive-support'] == 1 ) {
|
53 |
global $wp;
|
54 |
$current_archive_url = home_url( $wp->request );
|
55 |
+
wp_redirect( trailingslashit( esc_url( $current_archive_url ) ) . AMPFORWP_AMP_QUERY_VAR , 301 );
|
56 |
exit();
|
57 |
}
|
58 |
} else {
|
60 |
if( $ampforwp_amp_post_on_off_meta === 'hide-amp' ) {
|
61 |
//dont Echo anything
|
62 |
} else {
|
63 |
+
wp_redirect( trailingslashit( esc_url( ( get_permalink( $id ) ) ) ) . AMPFORWP_AMP_QUERY_VAR , 301 );
|
64 |
exit();
|
65 |
}
|
66 |
}
|
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
add_action( 'admin_init', 'ampforwp_welcome_screen_do_activation_redirect' );
|
3 |
+
function ampforwp_welcome_screen_do_activation_redirect() {
|
4 |
+
// Bail if no activation redirect
|
5 |
+
if ( ! get_transient( 'ampforwp_welcome_screen_activation_redirect' ) ) {
|
6 |
+
return;
|
7 |
+
}
|
8 |
+
|
9 |
+
// Delete the redirect transient
|
10 |
+
delete_transient( 'ampforwp_welcome_screen_activation_redirect' );
|
11 |
+
|
12 |
+
// Bail if activating from network, or bulk
|
13 |
+
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
|
14 |
+
return;
|
15 |
+
}
|
16 |
+
|
17 |
+
// Redirect to welcome page
|
18 |
+
wp_safe_redirect( add_query_arg( array( 'page' => 'ampforwp-welcome-page' ), admin_url( 'index.php' ) ) );
|
19 |
+
}
|
20 |
+
|
21 |
+
add_action( 'admin_init', 'ampforwp_welcome_screen_do_activation_redirect_parent' );
|
22 |
+
function ampforwp_welcome_screen_do_activation_redirect_parent() {
|
23 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
24 |
+
$amp_plugin_activation_check = is_plugin_active( 'amp/amp.php' );
|
25 |
+
|
26 |
+
// Bail if option is already set or plugin is deactivated
|
27 |
+
if ( get_option( 'ampforwp_parent_plugin_check' ) || $amp_plugin_activation_check == false ) {
|
28 |
+
return;
|
29 |
+
}
|
30 |
+
|
31 |
+
// Bail if activating from network, or bulk
|
32 |
+
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
|
33 |
+
return;
|
34 |
+
}
|
35 |
+
|
36 |
+
// Redirect to welcome page
|
37 |
+
wp_safe_redirect( add_query_arg( array( 'page' => 'ampforwp-welcome-page' ), admin_url( 'index.php' ) ) );
|
38 |
+
|
39 |
+
update_option( 'ampforwp_parent_plugin_check', true );
|
40 |
+
}
|
41 |
+
|
42 |
+
add_action('admin_menu', 'ampforwp_welcome_screen_pages');
|
43 |
+
|
44 |
+
function ampforwp_welcome_screen_pages() {
|
45 |
+
add_dashboard_page(
|
46 |
+
'Welcome To AMPforWP plugin',
|
47 |
+
'Welcome to AMP',
|
48 |
+
'read',
|
49 |
+
'ampforwp-welcome-page',
|
50 |
+
'ampforwp_welcome_screen_content'
|
51 |
+
);
|
52 |
+
}
|
53 |
+
|
54 |
+
function ampforwp_welcome_screen_content() {
|
55 |
+
?>
|
56 |
+
<div class="wrap">
|
57 |
+
<?php echo ampforwp_plugin_parent_activation(); ?>
|
58 |
+
|
59 |
+
<div class="clear"></div>
|
60 |
+
|
61 |
+
<div class="ampforwp-post-installtion-instructions">
|
62 |
+
|
63 |
+
<h1 style="color:#388E3C;font-weight:500"><i class="dashicons dashicons-yes"></i>AMP is now Installed!</h1>
|
64 |
+
<p style=" font-family: georgia; font-size: 20px; font-style: italic; margin-bottom: 3px; line-height: 1.5; color: #666;">Thank you so much for installing the AMPforWP plugin!</p>
|
65 |
+
<p style="font-family: georgia;font-size: 20px;margin-top: 4px;font-style: italic;line-height: 1.5;color: #666;">Our team works really hard to deliver good user experience to you.</p>
|
66 |
+
<div class="install_options">
|
67 |
+
<div class="install_options_left">
|
68 |
+
<p style="margin-top:0;margin-bottom:0;font-size: 15px;line-height: 1;"><b>Head Over to Settings</b></p>
|
69 |
+
<p style="margin-top: 8px;margin-bottom:0px;">Time to customize the your AMP!</p>
|
70 |
+
</div>
|
71 |
+
<div class="install_options_right">
|
72 |
+
<a href="<?php echo esc_url( admin_url('admin.php?page=amp_options') );?>">AMP Options Panel</a>
|
73 |
+
</div>
|
74 |
+
<div class="clear"></div>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
<h1 style="color: #303F9F;font-weight: 500;margin-top: 48px;">
|
80 |
+
<i class="dashicons dashicons-editor-help" style="font-size: 36px; margin-right: 20px; margin-top: -1px;"></i>Need Help?
|
81 |
+
</h1>
|
82 |
+
<p style="font-family: georgia;font-size: 20px;font-style: italic;margin-bottom: 3px;line-height: 1.5;margin-top: 11px;color: #666;">We're bunch of passionate people that are dedicated towards helping our users. We will be happy to help you!</p>
|
83 |
+
<div class="getstarted_wrapper">
|
84 |
+
<div class="getstarted_options">
|
85 |
+
<p><b>Links to help you started:</b>
|
86 |
+
<ul class="getstarted_ul">
|
87 |
+
<li><a href="https://ampforwp.com/getting-started-with-amp" target="_blank">Getting Started with AMP</a></li>
|
88 |
+
<li><a href="https://ampforwp.com/add-menus-amp/" target="_blank">Adding Navigation Menu</a></li>
|
89 |
+
<li><a href="https://ampforwp.com/add-analytics-amp/" target="_blank">Adding Google Analtyics</a></li>
|
90 |
+
<a class="getstarted_btn" href="https://ampforwp.com/help/" target="_blank">View all Tutorials</a>
|
91 |
+
</ul> </p>
|
92 |
+
</div>
|
93 |
+
<div class="getstarted_links">
|
94 |
+
<p><b>There are 3 ways to get help:</b></p>
|
95 |
+
<ul class="getstarted_ul">
|
96 |
+
<li><a href="https://wordpress.org/support/plugin/accelerated-mobile-pages" target="_blank">Support Forum</a></li>
|
97 |
+
<li><a href="https://ampforwp.com/chat/" target="_blank">Live Chat with Our Team</a></li>
|
98 |
+
<li><a href="https://ampforwp.com/help" target="_blank">View Documentation</a></li>
|
99 |
+
</ul>
|
100 |
+
</div><div class="clear"></div>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
</div>
|
104 |
+
|
105 |
+
</div> <?php
|
106 |
+
}
|
107 |
+
|
108 |
+
function ampforwp_plugin_parent_activation() {
|
109 |
+
|
110 |
+
add_thickbox(); // @since 1.0.53
|
111 |
+
|
112 |
+
include( ABSPATH . "wp-admin/includes/plugin-install.php" );
|
113 |
+
global $tabs, $tab, $paged, $type, $term;
|
114 |
+
$tabs = array();
|
115 |
+
$tab = "search";
|
116 |
+
$per_page = 1;
|
117 |
+
$args = array
|
118 |
+
(
|
119 |
+
"search" => "amp",
|
120 |
+
"page" => $paged,
|
121 |
+
"per_page" => $per_page,
|
122 |
+
"fields" => array( "last_updated" => true, "downloaded" => true, "icons" => true ),
|
123 |
+
"locale" => get_locale(),
|
124 |
+
);
|
125 |
+
$args = apply_filters( "install_plugins_table_api_args_$tab", $args );
|
126 |
+
$api = plugins_api( "query_plugins", $args );
|
127 |
+
$item = $api->plugins;
|
128 |
+
|
129 |
+
$plugins_allowedtags = array(
|
130 |
+
'a' => array( 'href' => array(), 'title' => array(), 'target' => array() ),
|
131 |
+
'abbr' => array( 'title' => array() ), 'acronym' => array( 'title' => array() ),
|
132 |
+
'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(),
|
133 |
+
'div' => array( 'class' => array() ), 'span' => array( 'class' => array() ),
|
134 |
+
'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(),
|
135 |
+
'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(),
|
136 |
+
'img' => array( 'src' => array(), 'class' => array(), 'alt' => array() )
|
137 |
+
);
|
138 |
+
|
139 |
+
?>
|
140 |
+
<form id="plugin-filter">
|
141 |
+
|
142 |
+
<div class="wrap">
|
143 |
+
<div class="ampforwp-pre-installtion-instructions">
|
144 |
+
<h1 style="color:#388E3C;font-weight:500"><i class="dashicons dashicons-warning"></i>Almost done. One last step remaining.</h1>
|
145 |
+
<p><b>This plugin requires the following plugin: <i>AMP</i></b></p>
|
146 |
+
<p>Automattic, the company behind WordPress has created a framework for AMP (also known as Default AMP plugin) which we are using as the core.</p><p>To complete the installation, you just need to click on the 'Finish Installation' button and default AMP plugin will be installed. Remember, to activate the plugin and you will be redirected to this screen again.</p>
|
147 |
+
<div id="ampforwp-network-status"></div>
|
148 |
+
</div>
|
149 |
+
|
150 |
+
<style>
|
151 |
+
.install_options{ max-width: 550px;
|
152 |
+
background: #fff;
|
153 |
+
border: 1px solid #ddd;
|
154 |
+
padding: 25px 27px 25px 26px;
|
155 |
+
border-radius: 2px;
|
156 |
+
margin-top: 19px;}
|
157 |
+
.install_options_left{float:left}
|
158 |
+
.install_options_right{float:right}
|
159 |
+
.install_options_right a{
|
160 |
+
background: #4CAF50;
|
161 |
+
padding: 11px 20px 12px 20px;
|
162 |
+
text-decoration: none;
|
163 |
+
color: #fff;
|
164 |
+
margin-top: 1px;
|
165 |
+
display: inline-block;
|
166 |
+
font-size: 16px;
|
167 |
+
border-radius: 3px;}
|
168 |
+
.getstarted_wrapper{
|
169 |
+
max-width: 510px;
|
170 |
+
margin-top: 20px; }
|
171 |
+
.getstarted_options{ float: left}
|
172 |
+
.getstarted_options{float: left; background: #fff; border: 1px solid #ddd; padding: 10px 30px 10px 30px; border-radius: 2px; }
|
173 |
+
.getstarted_links{float: right; background: #fff; border: 1px solid #ddd; padding: 10px 30px 10px 30px; border-radius: 2px; }
|
174 |
+
.ampforwp-post-installtion-instructions, .ampforwp-pre-installtion-instructions{ margin-left: 15px;}
|
175 |
+
.getstarted_ul li{ list-style-type: decimal; list-style-position: inside; }
|
176 |
+
a.getstarted_btn{ background: #666;
|
177 |
+
color: #fff;
|
178 |
+
padding: 9px 35px 9px 35px;
|
179 |
+
font-size: 13px;
|
180 |
+
line-height: 1;
|
181 |
+
text-decoration: none;
|
182 |
+
margin-top: 8px;
|
183 |
+
display: inline-block;}
|
184 |
+
.dashicons-warning, .dashicons-yes{
|
185 |
+
font-family: dashicons;
|
186 |
+
font-style: normal;
|
187 |
+
position: relative;
|
188 |
+
top: 1px;
|
189 |
+
font-size: 32px;
|
190 |
+
margin-right: 18px;
|
191 |
+
}
|
192 |
+
.dashicons-yes{
|
193 |
+
margin-right: 25px;
|
194 |
+
}
|
195 |
+
.dashicons-yes:before {
|
196 |
+
content: "\f147";
|
197 |
+
background: #388e3c;
|
198 |
+
color: #fff;
|
199 |
+
border-radius: 40px;
|
200 |
+
padding-right: 3px;
|
201 |
+
padding-top: 1px;
|
202 |
+
}
|
203 |
+
.ampforwp-plugin-action-buttons {
|
204 |
+
text-align:right;
|
205 |
+
margin-top: 0;
|
206 |
+
}
|
207 |
+
.ampforwp-plugin-action-buttons li {
|
208 |
+
display: inline-block;
|
209 |
+
margin-left: 1em;
|
210 |
+
}
|
211 |
+
.ampforwp-button-con {
|
212 |
+
padding-right: 15px;
|
213 |
+
}
|
214 |
+
.ampforwp-button-install {
|
215 |
+
background: none repeat scroll 0% 0% #2EA2CC !important;
|
216 |
+
border-color: #0074A2 !important;
|
217 |
+
box-shadow: 0px 1px 0px rgba(120, 200, 230, 0.5) inset, 0px 1px 0px rgba(0, 0, 0, 0.15) !important;
|
218 |
+
color: #FFF !important;
|
219 |
+
}
|
220 |
+
.ampforwp-button-install:focus {
|
221 |
+
box-shadow: 0px 0px 0px 1px #5B9DD9, 0px 0px 2px 1px rgba(30, 140, 190, 0.8) !important;
|
222 |
+
}
|
223 |
+
.ampforwp-button-install:hover {
|
224 |
+
color: #FFF !important;
|
225 |
+
background: none repeat scroll 0% 0% #5B9DD9 !important;
|
226 |
+
}
|
227 |
+
.ampforwp-button-update {
|
228 |
+
background: none repeat scroll 0% 0% #E74F34 !important;
|
229 |
+
border-color: #C52F2F !important;
|
230 |
+
box-shadow: 0px 1px 0px rgba(255, 235, 235, 0.5) inset, 0px 1px 0px rgba(0, 0, 0, 0.15) !important;
|
231 |
+
color: #FFF !important;
|
232 |
+
}
|
233 |
+
.ampforwp-button-update:focus {
|
234 |
+
box-shadow: 0px 0px 0px 1px #DA3232, 0px 0px 2px 1px rgba(255, 140, 140, 0.8) !important;
|
235 |
+
}
|
236 |
+
.ampforwp-button-update:hover {
|
237 |
+
color: #FFF !important;
|
238 |
+
background: none repeat scroll 0% 0% #DA3232 !important;
|
239 |
+
}
|
240 |
+
.drop-shadow {
|
241 |
+
position:relative;
|
242 |
+
background:#fff;
|
243 |
+
margin-bottom:40px;
|
244 |
+
}
|
245 |
+
.drop-shadow:before,
|
246 |
+
.drop-shadow:after {
|
247 |
+
content:"";
|
248 |
+
position:absolute;
|
249 |
+
z-index:-2;
|
250 |
+
} .authors{font-style: italic}
|
251 |
+
.ampforwp-custom-btn a{ font-size: 18px !important; background: #388E3C !important; border: 0px !important; border-radius: 2px !important; box-shadow: none !important; padding: 8px 20px !important; height: auto !important}
|
252 |
+
.plugin-card-top h4{margin-top: 10px;}
|
253 |
+
</style>
|
254 |
+
|
255 |
+
<div style="margin-top:30px;" class="wp-list-table widefat plugin-install">
|
256 |
+
<div id="the-list">
|
257 |
+
|
258 |
+
<?php
|
259 |
+
function ampforwp_plugin_activation_link($plugin) {
|
260 |
+
$activateUrl = sprintf(admin_url('plugins.php?action=activate&plugin=%s&plugin_status=all&paged=1&s'), $plugin);
|
261 |
+
// change the plugin request to the plugin to pass the nonce check
|
262 |
+
$_REQUEST['plugin'] = $plugin;
|
263 |
+
$activateUrl = wp_nonce_url($activateUrl, 'activate-plugin_' . $plugin, '_wpnonce');
|
264 |
+
|
265 |
+
return $activateUrl;
|
266 |
+
}
|
267 |
+
|
268 |
+
foreach ( (array) $item as $plugin ) {
|
269 |
+
if ( is_object( $plugin ) ) {
|
270 |
+
$plugin = (array) $plugin;
|
271 |
+
}
|
272 |
+
|
273 |
+
$title = wp_kses( $plugin['name'], $plugins_allowedtags );
|
274 |
+
// Remove any HTML from the description.
|
275 |
+
$description = strip_tags( $plugin['short_description'] );
|
276 |
+
$version = wp_kses( $plugin['version'], $plugins_allowedtags );
|
277 |
+
|
278 |
+
$name = strip_tags( $title . ' ' . $version );
|
279 |
+
|
280 |
+
$author = wp_kses( $plugin['author'], $plugins_allowedtags );
|
281 |
+
if ( ! empty( $author ) ) {
|
282 |
+
$author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '</cite>';
|
283 |
+
}
|
284 |
+
|
285 |
+
$action_links = array();
|
286 |
+
|
287 |
+
if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
|
288 |
+
$status = install_plugin_install_status( $plugin );
|
289 |
+
|
290 |
+
if ( $status['status'] == 'latest_installed' && is_plugin_inactive( $status['file'] ) ) {
|
291 |
+
$status['activation'] = 'not_activated';
|
292 |
+
} elseif ( $status['status'] == 'latest_installed' && is_plugin_active( $status['file'] ) ) {
|
293 |
+
$status['activation'] = 'activated';
|
294 |
+
|
295 |
+
} elseif ( $status['status'] == 'update_available' && is_plugin_active( $status['file'] ) ) {
|
296 |
+
$status['activation'] = 'activated_update_required';
|
297 |
+
|
298 |
+
} else {
|
299 |
+
$status['activation'] = 'not_installed';
|
300 |
+
}
|
301 |
+
|
302 |
+
$activation_link = ampforwp_plugin_activation_link($status['file']);
|
303 |
+
|
304 |
+
switch ( $status['status'] ) {
|
305 |
+
case 'install':
|
306 |
+
if ( $status['url'] ) {
|
307 |
+
/* translators: 1: Plugin name and version. */
|
308 |
+
$action_links[] = '<a class="install-now button-secondary ampforwp-button-install" href="' . $status['url'] . '" aria-label="' . esc_attr( sprintf( __( 'Install %s now' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
|
309 |
+
}
|
310 |
+
|
311 |
+
break;
|
312 |
+
case 'update_available':
|
313 |
+
if ( $status['url'] ) {
|
314 |
+
/* translators: 1: Plugin name and version */
|
315 |
+
$action_links[] = '<a class="button ampforwp-button-update" href="' . $status['url'] . '" aria-label="' . esc_attr( sprintf( __( 'Update %s now' ), $name ) ) . '">' . __( 'Update Now' ) . '</a>';
|
316 |
+
}
|
317 |
+
|
318 |
+
break;
|
319 |
+
case 'latest_installed':
|
320 |
+
if ( $status['activation'] == 'not_activated') {
|
321 |
+
$action_links[] = '<a class="install-now button-secondary ampforwp-button-install" href="' . $activation_link . '" aria-label="' . esc_attr( sprintf( __( 'Activate %s ' ), $name ) ) . '">' . __( 'Activate' ) . '</a>';
|
322 |
+
}
|
323 |
+
break;
|
324 |
+
case 'newer_installed':
|
325 |
+
$action_links[] = '<span class="button button-disabled" title="' . esc_attr__( 'This plugin is already installed and is up to date' ) . ' ">' . _x( 'Installed', 'plugin' ) . '</span>';
|
326 |
+
break;
|
327 |
+
}
|
328 |
+
}
|
329 |
+
|
330 |
+
$details_link = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] .
|
331 |
+
'&TB_iframe=true&width=750&height=550' );
|
332 |
+
|
333 |
+
/* translators: 1: Plugin name and version. */
|
334 |
+
$action_links[] = '<a href="' . esc_url( $details_link ) . '" class="thickbox" aria-label="' . esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '" data-title="' . esc_attr( $name ) . '">' . __( 'More Details' ) . '</a>';
|
335 |
+
|
336 |
+
if ( !empty( $plugin['icons']['svg'] ) ) {
|
337 |
+
$plugin_icon_url = $plugin['icons']['svg'];
|
338 |
+
} elseif ( !empty( $plugin['icons']['2x'] ) ) {
|
339 |
+
$plugin_icon_url = $plugin['icons']['2x'];
|
340 |
+
} elseif ( !empty( $plugin['icons']['1x'] ) ) {
|
341 |
+
$plugin_icon_url = $plugin['icons']['1x'];
|
342 |
+
} else {
|
343 |
+
$plugin_icon_url = $plugin['icons']['default'];
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* Filter the install action links for a plugin.
|
348 |
+
*
|
349 |
+
* @since 2.7.0
|
350 |
+
*
|
351 |
+
* @param array $action_links An array of plugin action hyperlinks. Defaults are links to Details and Install Now.
|
352 |
+
* @param array $plugin The plugin currently being listed.
|
353 |
+
*/
|
354 |
+
$action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
|
355 |
+
?>
|
356 |
+
<div class="plugin-card drop-shadow lifted" >
|
357 |
+
<div class="plugin-card-top" style="min-height: 135px !important;">
|
358 |
+
<?php if ( isset( $plugin["slug"] ) && $plugin["slug"] == 'easy-media-gallery' ) {echo '<div class="most_popular"></div>';} ?>
|
359 |
+
<span href="<?php echo esc_url( $details_link ); ?>" class="thickbox plugin-icon"><img width="128" height="128" src="<?php echo esc_attr( $plugin_icon_url ) ?>" /></span>
|
360 |
+
<div class="name column-name" style="margin-right: 20px !important;">
|
361 |
+
<h4><?php echo $title; ?></h4>
|
362 |
+
</div>
|
363 |
+
<div class="desc column-description" style="margin-right: 20px !important;">
|
364 |
+
<p><?php echo $description; ?></p>
|
365 |
+
<p class="authors">by Automattic</p>
|
366 |
+
</div>
|
367 |
+
</div>
|
368 |
+
<div class="ampforwp-button-con">
|
369 |
+
<?php
|
370 |
+
if ( $action_links ) {
|
371 |
+
echo '<ul class="ampforwp-plugin-action-buttons ampforwp-custom-btn">';
|
372 |
+
echo '<li>' . $action_links[0] . '</li>';
|
373 |
+
echo '</ul>';
|
374 |
+
} ?>
|
375 |
+
</div>
|
376 |
+
</div>
|
377 |
+
<?php
|
378 |
+
} ?>
|
379 |
+
|
380 |
+
</div>
|
381 |
+
</div>
|
382 |
+
</div>
|
383 |
+
</form>
|
384 |
+
|
385 |
+
<?php
|
386 |
+
}
|
387 |
+
|
388 |
+
add_action('admin_footer','ampforwp_offline_admin_notice');
|
389 |
+
function ampforwp_offline_admin_notice() {
|
390 |
+
|
391 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
392 |
+
$amp_plugin_activation_check = is_plugin_active( 'amp/amp.php' );
|
393 |
+
|
394 |
+
if ( $amp_plugin_activation_check ) { ?>
|
395 |
+
<style>
|
396 |
+
.dashboard_page_ampforwp-welcome-page .plugin-card.drop-shadow.lifted,
|
397 |
+
.ampforwp-pre-installtion-instructions{
|
398 |
+
display: none;
|
399 |
+
}
|
400 |
+
</style>
|
401 |
+
<?php } else { ?>
|
402 |
+
<style>
|
403 |
+
.ampforwp-post-installtion-instructions{ display: none; }
|
404 |
+
</style>
|
405 |
+
<?php } ?>
|
406 |
+
<script>
|
407 |
+
const statusContainer = document.getElementById('ampforwp-network-status');
|
408 |
+
if(! navigator.onLine) {
|
409 |
+
statusContainer.innerHTML = "<h1 style='color:#E91E63'> You seems to have been Offline. Please connect to network to continue the installation.</h1>";
|
410 |
+
} else {
|
411 |
+
statusContainer.innerHTML = "";
|
412 |
+
}
|
413 |
+
</script>
|
414 |
+
<?php
|
415 |
+
}
|
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/5
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.7.2
|
7 |
-
Stable tag: 0.9.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -29,6 +29,7 @@ AMP for WP automatically adds Accelerated Mobile Pages (Google AMP Project) func
|
|
29 |
|
30 |
= Features: =
|
31 |
|
|
|
32 |
* NEW - Design 3 [Watch the Video Overview](https://www.youtube.com/watch?v=ub1pwskt3Rc)
|
33 |
* NEW - Disqus Comments Support
|
34 |
* NEW - Google Tag Manager Support
|
@@ -126,6 +127,49 @@ You can contact me using this url: http://ampforwp.com/contact/
|
|
126 |
|
127 |
== Changelog ==
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
= 0.9.43.6 =
|
130 |
* View more details at https://ampforwp.com/stability-sprint-3-51st-update/
|
131 |
* Typo in the is_home() function fixed
|
4 |
Donate link: https://www.paypal.me/Kaludi/5
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.7.2
|
7 |
+
Stable tag: 0.9.44
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
29 |
|
30 |
= Features: =
|
31 |
|
32 |
+
* NEW - Native AMP Search functionality.
|
33 |
* NEW - Design 3 [Watch the Video Overview](https://www.youtube.com/watch?v=ub1pwskt3Rc)
|
34 |
* NEW - Disqus Comments Support
|
35 |
* NEW - Google Tag Manager Support
|
127 |
|
128 |
== Changelog ==
|
129 |
|
130 |
+
= 0.9.44 (5 March 2017) =
|
131 |
+
* View more details at https://ampforwp.com/user-experience-52nd-update/
|
132 |
+
* Added Welcome Screen for better User experience. [Enhancement]
|
133 |
+
* Undefined Index debug error resolved [Bug fix]
|
134 |
+
* All in one SEO Support support tested [3rd party compatibility]
|
135 |
+
* Frontpage title in Design 3 is out of the container #644 [Bug fix]
|
136 |
+
* Default Table markup in AMP #643 [Enhancement]
|
137 |
+
* AMP carousel is not working on Frontpage #641 [Bug fix]
|
138 |
+
* Social share .js was getting added even when it was not required #638 [Bug fix]
|
139 |
+
* Search Feature added for Design 1 & Design 2 [Major Improvement]
|
140 |
+
* Accordion script loading issue in Design 3 #634 [Bug fix]
|
141 |
+
* ?nonamp=1 links should be nofollow #622 [Bug fix]
|
142 |
+
* Same Header and Color Scheme are making header elements invisible #629 [Enhancement]
|
143 |
+
* In Search AMP rel canonical was different #631 [Bug fix]
|
144 |
+
* Non-AMP link in Design 3 was not working when mobile redirection was enabled #632 [Bug fix]
|
145 |
+
* Search form text strings are now added in the translation panel #607 [Bug fix]
|
146 |
+
* Load AMP-ads conditionally only if ads are available #609 [Bug fix]
|
147 |
+
* Added compatibility with Custom post type extension. Option to hide/show AMP on all custom post types #587 [Bug fix]
|
148 |
+
* Report a Bug & Request feature links added [Enhancement]
|
149 |
+
* If there was no menu set in Design 3 then all pages were getting displayed. #613 [Bug fix]
|
150 |
+
* The tag Font is disallowed #616 [Validation Improved]
|
151 |
+
* index/noindex separately added for Tags and also for Categories #606 [Enhancement]
|
152 |
+
* Use of undefined constant AMP_QUERY_VAR #596 [Bug fixed]
|
153 |
+
* Logo is not centered in Design 3 #586 [Bug fixed]
|
154 |
+
* Remove defer, a very rare type of defer was getting added #589 [Validation Improved]
|
155 |
+
* Disqus comments iframe had scrolling issues #566 [Bug fixed]
|
156 |
+
* Left side blank gap in the RTL in design 2 #541 [Bug fixed]
|
157 |
+
* Inline Styles not working correctly in Custom AMP Editor #533 [Bug fixed]
|
158 |
+
* Re-save permalinks issues. Flushing rewrites with options saved. #511 [Improvement]
|
159 |
+
* Code review and cleaning of the customizer #404 [Code Cleaning]
|
160 |
+
* Google Search iframe had some header alignment issues in Design 3. #624 - Thank you Leo Osa @leoosa for the contribution! [Bug fixed]
|
161 |
+
* AMP Frontpage + Override AMP Content = Blank page #604 [Bug fixed]
|
162 |
+
* Widget area added on the homepage with an 'AMP Category Blocks' widget. It means you can display multiple category blocks the homepage. This allows you to display complex layouts, even on AMP. [Major Improvement]
|
163 |
+
* Auto-append /amp at the end of internal links in Menu with an option in the Menu section of the options panel #531 [Major Improvement]
|
164 |
+
Reformatting and Minifying of stylesheet [Code Cleaning]
|
165 |
+
* Created a new section for Homepage and moved some controls from other areas to the home section for the better user experience. [User Experience]
|
166 |
+
* Override Homepage Thumbnail size option added. It will give you more control over your thumbnails. [Major Improvement]
|
167 |
+
* New color picker added to change the color of the header elements in the Design 3 to give you better control over the design. [Enhancement]
|
168 |
+
* Extra amp-carousel script loading is now fixed. [Bug fixed]
|
169 |
+
* Crafting of layout code in design 2 and design 3, especially with social icons area. [Code Cleaning]
|
170 |
+
* Design of search form was not clickable in iOS devices #621 [Bug fixed]
|
171 |
+
* Disqus iframe was loading even when there was no disqus name was added in the option. We found that many users might be enabling it without knowing the output and then they seem to forget, which was causing them validation warnings. [Bug fixed]
|
172 |
+
|
173 |
= 0.9.43.6 =
|
174 |
* View more details at https://ampforwp.com/stability-sprint-3-51st-update/
|
175 |
* Typo in the is_home() function fixed
|
@@ -11,8 +11,12 @@ function ampforwp_custom_post_content_sanitizer( $data, $post ) {
|
|
11 |
}
|
12 |
|
13 |
global $post;
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
16 |
|
17 |
if ( empty( $amp_custom_post_content_input ) ) {
|
18 |
$data['ampforwp_amp_content'] = false;
|
@@ -20,31 +24,31 @@ function ampforwp_custom_post_content_sanitizer( $data, $post ) {
|
|
20 |
}
|
21 |
|
22 |
if ( $amp_custom_post_content_check === 'yes') {
|
23 |
-
|
24 |
$amp_custom_content = new AMP_Content( $amp_custom_post_content_input,
|
25 |
apply_filters( 'amp_content_embed_handlers', array(
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
) ),
|
33 |
-
apply_filters(
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
42 |
);
|
43 |
|
44 |
if ( $amp_custom_content ) {
|
45 |
$data[ 'ampforwp_amp_content' ] = $amp_custom_content->get_amp_content();
|
46 |
$data['amp_component_scripts'] = $amp_custom_content->get_amp_scripts();
|
47 |
-
|
48 |
}
|
49 |
}
|
50 |
|
@@ -63,9 +67,15 @@ add_action('add_meta_boxes','ampforwp_custom_content_meta_register');
|
|
63 |
|
64 |
|
65 |
function amp_content_editor_title_callback( $post ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
wp_nonce_field( basename( __FILE__) , 'amp_content_editor_nonce' );
|
68 |
-
$amp_content_on_off = get_post_meta($
|
69 |
$amp_content_on_off = esc_attr($amp_content_on_off);
|
70 |
?>
|
71 |
<!--HTML content starts here-->
|
@@ -78,7 +88,7 @@ function amp_content_editor_title_callback( $post ) {
|
|
78 |
|
79 |
<!--HTML content Ends here-->
|
80 |
<?php
|
81 |
-
$content = get_post_meta ( $
|
82 |
$editor_id = 'ampforwp_custom_content_editor';
|
83 |
wp_editor( $content, $editor_id );
|
84 |
}
|
11 |
}
|
12 |
|
13 |
global $post;
|
14 |
+
$amp_current_post_id = get_the_ID() ;
|
15 |
+
if ( $redux_builder_amp['amp-frontpage-select-option'] ) {
|
16 |
+
$amp_current_post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
|
17 |
+
}
|
18 |
+
$amp_custom_post_content_input = get_post_meta($amp_current_post_id, 'ampforwp_custom_content_editor', true);
|
19 |
+
$amp_custom_post_content_check = get_post_meta($amp_current_post_id, 'ampforwp_custom_content_editor_checkbox', true);
|
20 |
|
21 |
if ( empty( $amp_custom_post_content_input ) ) {
|
22 |
$data['ampforwp_amp_content'] = false;
|
24 |
}
|
25 |
|
26 |
if ( $amp_custom_post_content_check === 'yes') {
|
|
|
27 |
$amp_custom_content = new AMP_Content( $amp_custom_post_content_input,
|
28 |
apply_filters( 'amp_content_embed_handlers', array(
|
29 |
+
'AMP_Twitter_Embed_Handler' => array(),
|
30 |
+
'AMP_YouTube_Embed_Handler' => array(),
|
31 |
+
'AMP_Instagram_Embed_Handler' => array(),
|
32 |
+
'AMP_Vine_Embed_Handler' => array(),
|
33 |
+
'AMP_Facebook_Embed_Handler' => array(),
|
34 |
+
'AMP_Gallery_Embed_Handler' => array(),
|
35 |
) ),
|
36 |
+
apply_filters( 'amp_content_sanitizers', array(
|
37 |
+
'AMP_Style_Sanitizer' => array(),
|
38 |
+
'AMP_Blacklist_Sanitizer' => array(),
|
39 |
+
'AMP_Img_Sanitizer' => array(),
|
40 |
+
'AMP_Video_Sanitizer' => array(),
|
41 |
+
'AMP_Audio_Sanitizer' => array(),
|
42 |
+
'AMP_Iframe_Sanitizer' => array(
|
43 |
+
'add_placeholder' => true,
|
44 |
+
),
|
45 |
+
) )
|
46 |
);
|
47 |
|
48 |
if ( $amp_custom_content ) {
|
49 |
$data[ 'ampforwp_amp_content' ] = $amp_custom_content->get_amp_content();
|
50 |
$data['amp_component_scripts'] = $amp_custom_content->get_amp_scripts();
|
51 |
+
$data['post_amp_styles'] = $amp_custom_content->get_amp_styles();
|
52 |
}
|
53 |
}
|
54 |
|
67 |
|
68 |
|
69 |
function amp_content_editor_title_callback( $post ) {
|
70 |
+
global $post;
|
71 |
+
global $redux_builder_amp;
|
72 |
+
$amp_current_post_id = $post->ID;
|
73 |
+
if ( $redux_builder_amp['amp-frontpage-select-option'] ) {
|
74 |
+
$amp_current_post_id = $redux_builder_amp['amp-frontpage-select-option-pages'];
|
75 |
+
}
|
76 |
|
77 |
wp_nonce_field( basename( __FILE__) , 'amp_content_editor_nonce' );
|
78 |
+
$amp_content_on_off = get_post_meta($amp_current_post_id, 'ampforwp_custom_content_editor_checkbox', true);
|
79 |
$amp_content_on_off = esc_attr($amp_content_on_off);
|
80 |
?>
|
81 |
<!--HTML content starts here-->
|
88 |
|
89 |
<!--HTML content Ends here-->
|
90 |
<?php
|
91 |
+
$content = get_post_meta ( $amp_current_post_id, 'ampforwp_custom_content_editor', true );
|
92 |
$editor_id = 'ampforwp_custom_content_editor';
|
93 |
wp_editor( $content, $editor_id );
|
94 |
}
|
@@ -10,7 +10,7 @@
|
|
10 |
global $wp;
|
11 |
$current_archive_url = home_url( $wp->request );
|
12 |
$amp_url = trailingslashit($current_archive_url);
|
13 |
-
$remove = '/'.
|
14 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
15 |
} ?>
|
16 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
@@ -22,25 +22,25 @@
|
|
22 |
</style>
|
23 |
</head>
|
24 |
|
25 |
-
<body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?>">
|
26 |
|
27 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
28 |
|
29 |
<article class="amp-wp-article ampforwp-custom-index amp-wp-home">
|
30 |
|
31 |
-
<?php do_action('
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
|
38 |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
|
39 |
<div class="amp-wp-content amp-wp-article-header amp-loop-list">
|
40 |
|
41 |
<h1 class="amp-wp-title">
|
42 |
<?php $ampforwp_post_url = get_permalink(); ?>
|
43 |
-
<a href="<?php echo trailingslashit($ampforwp_post_url) .
|
44 |
</h1>
|
45 |
|
46 |
<div class="amp-wp-content-loop">
|
@@ -60,8 +60,17 @@
|
|
60 |
$thumb_url = $thumb_url_array[0];
|
61 |
?>
|
62 |
<div class="home-post-image">
|
63 |
-
<a href="<?php echo trailingslashit($ampforwp_post_url) .
|
64 |
-
<amp-img
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
</a>
|
66 |
</div>
|
67 |
<?php }
|
@@ -85,7 +94,7 @@
|
|
85 |
</div>
|
86 |
<?php endif; ?>
|
87 |
|
88 |
-
<?php do_action('
|
89 |
|
90 |
</article>
|
91 |
|
10 |
global $wp;
|
11 |
$current_archive_url = home_url( $wp->request );
|
12 |
$amp_url = trailingslashit($current_archive_url);
|
13 |
+
$remove = '/'. AMPFORWP_AMP_QUERY_VAR;
|
14 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
15 |
} ?>
|
16 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
22 |
</style>
|
23 |
</head>
|
24 |
|
25 |
+
<body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?> design_1_wrapper">
|
26 |
|
27 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
28 |
|
29 |
<article class="amp-wp-article ampforwp-custom-index amp-wp-home">
|
30 |
|
31 |
+
<?php do_action('ampforwp_post_before_loop') ?>
|
32 |
|
33 |
+
<?php if ( is_archive() ) {
|
34 |
+
the_archive_title( '<h3 class="page-title">', '</h3>' );
|
35 |
+
the_archive_description( '<div class="taxonomy-description">', '</div>' );
|
36 |
+
} ?>
|
37 |
|
38 |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
|
39 |
<div class="amp-wp-content amp-wp-article-header amp-loop-list">
|
40 |
|
41 |
<h1 class="amp-wp-title">
|
42 |
<?php $ampforwp_post_url = get_permalink(); ?>
|
43 |
+
<a href="<?php echo trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR ;?>"><?php the_title() ?></a>
|
44 |
</h1>
|
45 |
|
46 |
<div class="amp-wp-content-loop">
|
60 |
$thumb_url = $thumb_url_array[0];
|
61 |
?>
|
62 |
<div class="home-post-image">
|
63 |
+
<a href="<?php echo trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR ;?>">
|
64 |
+
<amp-img
|
65 |
+
src=<?php echo $thumb_url ?>
|
66 |
+
<?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
|
67 |
+
width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
|
68 |
+
height=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-height'] ?>
|
69 |
+
<?php } else { ?>
|
70 |
+
width=100
|
71 |
+
height=75
|
72 |
+
<?php } ?>
|
73 |
+
></amp-img>
|
74 |
</a>
|
75 |
</div>
|
76 |
<?php }
|
94 |
</div>
|
95 |
<?php endif; ?>
|
96 |
|
97 |
+
<?php do_action('ampforwp_post_after_loop') ?>
|
98 |
|
99 |
</article>
|
100 |
|
@@ -71,7 +71,7 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
71 |
</ul>
|
72 |
</div>
|
73 |
<div class="comment-button-wrapper">
|
74 |
-
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
75 |
</div>
|
76 |
<?php } else {
|
77 |
global $redux_builder_amp ;
|
@@ -79,7 +79,7 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
79 |
return;
|
80 |
} ?>
|
81 |
<div class="comment-button-wrapper">
|
82 |
-
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
83 |
</div>
|
84 |
<?php } ?>
|
85 |
</div>
|
71 |
</ul>
|
72 |
</div>
|
73 |
<div class="comment-button-wrapper">
|
74 |
+
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
75 |
</div>
|
76 |
<?php } else {
|
77 |
global $redux_builder_amp ;
|
79 |
return;
|
80 |
} ?>
|
81 |
<div class="comment-button-wrapper">
|
82 |
+
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
83 |
</div>
|
84 |
<?php } ?>
|
85 |
</div>
|
@@ -26,7 +26,7 @@
|
|
26 |
if (!empty( $next_post )) {
|
27 |
$next_text = $next_post->post_title;
|
28 |
?>
|
29 |
-
<a href="<?php echo trailingslashit(get_permalink( $next_post->ID )) .
|
30 |
} ?>
|
31 |
</div>
|
32 |
<!--Next Link code-->
|
@@ -37,7 +37,7 @@
|
|
37 |
if (!empty( $prev_post )) {
|
38 |
$prev_text = $prev_post->post_title;
|
39 |
?>
|
40 |
-
<a href="<?php echo trailingslashit(get_permalink( $prev_post->ID )).
|
41 |
} ?>
|
42 |
</div>
|
43 |
<!--Prev Link code-->
|
26 |
if (!empty( $next_post )) {
|
27 |
$next_text = $next_post->post_title;
|
28 |
?>
|
29 |
+
<a href="<?php echo trailingslashit(get_permalink( $next_post->ID )) . AMPFORWP_AMP_QUERY_VAR; ?>"><?php echo apply_filters('ampforwp_next_link',$next_text ); ?> »</a> <?php
|
30 |
} ?>
|
31 |
</div>
|
32 |
<!--Next Link code-->
|
37 |
if (!empty( $prev_post )) {
|
38 |
$prev_text = $prev_post->post_title;
|
39 |
?>
|
40 |
+
<a href="<?php echo trailingslashit(get_permalink( $prev_post->ID )). AMPFORWP_AMP_QUERY_VAR; ?>"> « <?php echo apply_filters('ampforwp_prev_link',$prev_text ); ?></a> <?php
|
41 |
} ?>
|
42 |
</div>
|
43 |
<!--Prev Link code-->
|
@@ -4,7 +4,9 @@
|
|
4 |
<?php
|
5 |
if ( $post_author ) : ?>
|
6 |
<div class="amp-wp-meta amp-wp-byline">
|
7 |
-
<?php
|
|
|
|
|
8 |
<amp-img src="<?php echo esc_url($author_image); ?>" width="24" height="24" layout="fixed"></amp-img>
|
9 |
<?php }?>
|
10 |
|
4 |
<?php
|
5 |
if ( $post_author ) : ?>
|
6 |
<div class="amp-wp-meta amp-wp-byline">
|
7 |
+
<?php
|
8 |
+
$author_image = get_avatar_url( $post_author->user_email, array( 'size' => 24 ) );
|
9 |
+
if ( function_exists( 'get_avatar_url' ) && ( $author_image ) ) { ?>
|
10 |
<amp-img src="<?php echo esc_url($author_image); ?>" width="24" height="24" layout="fixed"></amp-img>
|
11 |
<?php }?>
|
12 |
|
@@ -8,7 +8,7 @@
|
|
8 |
<span><?php global $redux_builder_amp; printf( __($redux_builder_amp['amp-translator-categories-text'] .' ', 'amp' )); ?></span>
|
9 |
<?php foreach ($ampforwp_categories as $cat ) {
|
10 |
if($redux_builder_amp['ampforwp-archive-support']){
|
11 |
-
echo ('<span><a href="'.trailingslashit(get_category_link($cat->term_taxonomy_id)).
|
12 |
} else {
|
13 |
echo '<span>'. $cat->name .'</span>';
|
14 |
}
|
8 |
<span><?php global $redux_builder_amp; printf( __($redux_builder_amp['amp-translator-categories-text'] .' ', 'amp' )); ?></span>
|
9 |
<?php foreach ($ampforwp_categories as $cat ) {
|
10 |
if($redux_builder_amp['ampforwp-archive-support']){
|
11 |
+
echo ('<span><a href="'.trailingslashit(get_category_link($cat->term_taxonomy_id)). AMPFORWP_AMP_QUERY_VAR .'" > '. $cat->name .'</a></span>');
|
12 |
} else {
|
13 |
echo '<span>'. $cat->name .'</span>';
|
14 |
}
|
@@ -48,7 +48,7 @@
|
|
48 |
$my_query->the_post();
|
49 |
$related_post_permalink = get_permalink();
|
50 |
$related_post_permalink = trailingslashit($related_post_permalink);
|
51 |
-
$related_post_permalink = $related_post_permalink .
|
52 |
?>
|
53 |
<li class="<?php if ( has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
54 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
48 |
$my_query->the_post();
|
49 |
$related_post_permalink = get_permalink();
|
50 |
$related_post_permalink = trailingslashit($related_post_permalink);
|
51 |
+
$related_post_permalink = $related_post_permalink . AMPFORWP_AMP_QUERY_VAR
|
52 |
?>
|
53 |
<li class="<?php if ( has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
54 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
@@ -4,5 +4,5 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
4 |
return;
|
5 |
} ?>
|
6 |
<div class="comment-button-wrapper ampforwp-comment-button">
|
7 |
-
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
8 |
</div>
|
4 |
return;
|
5 |
} ?>
|
6 |
<div class="comment-button-wrapper ampforwp-comment-button">
|
7 |
+
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
8 |
</div>
|
@@ -38,7 +38,7 @@ global $redux_builder_amp;
|
|
38 |
if($redux_builder_amp['amp-footer-link-non-amp-page']=='1'){
|
39 |
if ( $ampforwp_backto_nonamp ) { ?>
|
40 |
|
|
41 |
-
<a href="<?php echo $ampforwp_backto_nonamp; ?>"><?php echo esc_html( $redux_builder_amp['amp-translator-non-amp-page-text'] ) ;?>
|
42 |
</a> <?php
|
43 |
}//End of inner condition
|
44 |
}//End of outer condition?>
|
38 |
if($redux_builder_amp['amp-footer-link-non-amp-page']=='1'){
|
39 |
if ( $ampforwp_backto_nonamp ) { ?>
|
40 |
|
|
41 |
+
<a href="<?php echo $ampforwp_backto_nonamp; ?>" rel="nofollow"><?php echo esc_html( $redux_builder_amp['amp-translator-non-amp-page-text'] ) ;?>
|
42 |
</a> <?php
|
43 |
}//End of inner condition
|
44 |
}//End of outer condition?>
|
@@ -10,18 +10,18 @@ $template = new AMP_Post_Template( $post_id );?>
|
|
10 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
11 |
<?php
|
12 |
$amp_custom_content_enable = get_post_meta($template->data['post_id'], 'ampforwp_custom_content_editor_checkbox', true);
|
13 |
-
if ( $amp_custom_content_enable ) {
|
14 |
$amp_component_scripts = $template->data['amp_component_scripts'];
|
15 |
foreach ($amp_component_scripts as $ampforwp_service => $ampforwp_js_file) { ?>
|
16 |
<script custom-element="<?php echo $ampforwp_service; ?>" src="<?php echo $ampforwp_js_file; ?>" async></script> <?php
|
17 |
}
|
18 |
-
}
|
19 |
<style amp-custom>
|
20 |
<?php $this->load_parts( array( 'style' ) ); ?>
|
21 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
22 |
</style>
|
23 |
</head>
|
24 |
-
<body class="single-post amp-wp-frontpage">
|
25 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
26 |
|
27 |
<article class="amp-wp-article">
|
10 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
11 |
<?php
|
12 |
$amp_custom_content_enable = get_post_meta($template->data['post_id'], 'ampforwp_custom_content_editor_checkbox', true);
|
13 |
+
if ( ! $amp_custom_content_enable ) {
|
14 |
$amp_component_scripts = $template->data['amp_component_scripts'];
|
15 |
foreach ($amp_component_scripts as $ampforwp_service => $ampforwp_js_file) { ?>
|
16 |
<script custom-element="<?php echo $ampforwp_service; ?>" src="<?php echo $ampforwp_js_file; ?>" async></script> <?php
|
17 |
}
|
18 |
+
} ?>
|
19 |
<style amp-custom>
|
20 |
<?php $this->load_parts( array( 'style' ) ); ?>
|
21 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
22 |
</style>
|
23 |
</head>
|
24 |
+
<body class="single-post amp-wp-frontpage design_1_wrapper">
|
25 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
26 |
|
27 |
<article class="amp-wp-article">
|
@@ -4,16 +4,16 @@
|
|
4 |
<?php
|
5 |
if($redux_builder_amp['amp-on-off-support-for-non-amp-home-page']){
|
6 |
?>
|
7 |
-
<a href="<?php echo esc_url( untrailingslashit( $this->get( 'home_url' ) ).'?nonamp=1'); ?>">
|
8 |
<?php
|
9 |
}else{
|
10 |
?>
|
11 |
<?php if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
|
12 |
-
<a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ) .
|
13 |
|
14 |
<?php } else { ?>
|
15 |
|
16 |
-
<a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ).'?nonamp=1'); ?>">
|
17 |
|
18 |
<?php }
|
19 |
}?>
|
@@ -41,11 +41,11 @@
|
|
41 |
|
42 |
<?php if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
|
43 |
|
44 |
-
<a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ) .
|
45 |
|
46 |
<?php } else {?>
|
47 |
|
48 |
-
<a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) .'?nonamp=1'); ?>">
|
49 |
|
50 |
<?php }
|
51 |
} ?>
|
@@ -54,17 +54,19 @@
|
|
54 |
<amp-img src="<?php echo esc_url( $site_icon_url ); ?>" width="32" height="32" class="amp-wp-site-icon"></amp-img>
|
55 |
<?php endif; ?>
|
56 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
-
<div on='tap:sidebar.toggle' role="button" tabindex="0" class="nav_container">
|
59 |
-
<a href="#" class="toggle-text">
|
60 |
-
<span></span>
|
61 |
-
<span></span>
|
62 |
-
<span></span>
|
63 |
-
</a>
|
64 |
</div>
|
65 |
-
|
66 |
-
</div>
|
67 |
-
|
68 |
</header>
|
69 |
<amp-sidebar id='sidebar'
|
70 |
layout="nodisplay"
|
4 |
<?php
|
5 |
if($redux_builder_amp['amp-on-off-support-for-non-amp-home-page']){
|
6 |
?>
|
7 |
+
<a href="<?php echo esc_url( untrailingslashit( $this->get( 'home_url' ) ).'?nonamp=1'); ?>" rel="nofollow">
|
8 |
<?php
|
9 |
}else{
|
10 |
?>
|
11 |
<?php if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
|
12 |
+
<a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ) . AMPFORWP_AMP_QUERY_VAR; ?>">
|
13 |
|
14 |
<?php } else { ?>
|
15 |
|
16 |
+
<a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ).'?nonamp=1'); ?>" rel="nofollow">
|
17 |
|
18 |
<?php }
|
19 |
}?>
|
41 |
|
42 |
<?php if($redux_builder_amp['ampforwp-homepage-on-off-support']) { ?>
|
43 |
|
44 |
+
<a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) ) . AMPFORWP_AMP_QUERY_VAR; ?>">
|
45 |
|
46 |
<?php } else {?>
|
47 |
|
48 |
+
<a href="<?php echo esc_url( trailingslashit( $this->get( 'home_url' ) ) .'?nonamp=1'); ?>" rel="nofollow">
|
49 |
|
50 |
<?php }
|
51 |
} ?>
|
54 |
<amp-img src="<?php echo esc_url( $site_icon_url ); ?>" width="32" height="32" class="amp-wp-site-icon"></amp-img>
|
55 |
<?php endif; ?>
|
56 |
</a>
|
57 |
+
|
58 |
+
<div on='tap:sidebar.toggle' role="button" tabindex="0" class="nav_container">
|
59 |
+
<a href="#" class="toggle-text">
|
60 |
+
<span></span>
|
61 |
+
<span></span>
|
62 |
+
<span></span>
|
63 |
+
</a>
|
64 |
+
</div>
|
65 |
+
<?php do_action('ampforwp_header_search'); ?>
|
66 |
+
|
67 |
+
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
</div>
|
|
|
|
|
|
|
70 |
</header>
|
71 |
<amp-sidebar id='sidebar'
|
72 |
layout="nodisplay"
|
@@ -9,7 +9,7 @@
|
|
9 |
global $wp;
|
10 |
$current_archive_url = home_url( $wp->request );
|
11 |
$amp_url = trailingslashit($current_archive_url);
|
12 |
-
$remove = '/'.
|
13 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
14 |
} ?>
|
15 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
@@ -21,13 +21,16 @@
|
|
21 |
</style>
|
22 |
</head>
|
23 |
|
24 |
-
<body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?>">
|
25 |
|
26 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
27 |
|
|
|
|
|
|
|
28 |
<article class="amp-wp-article ampforwp-custom-index amp-wp-home">
|
29 |
|
30 |
-
<?php do_action('
|
31 |
|
32 |
<?php
|
33 |
if ( get_query_var( 'paged' ) ) {
|
@@ -45,8 +48,8 @@
|
|
45 |
'orderby' => 'date',
|
46 |
'paged' => esc_attr($paged),
|
47 |
'post__not_in' => $exclude_ids,
|
48 |
-
|
49 |
-
|
50 |
);
|
51 |
$filtered_args = apply_filters('ampforwp_query_args', $args);
|
52 |
$q = new WP_Query( $filtered_args ); ?>
|
@@ -56,7 +59,7 @@
|
|
56 |
|
57 |
<h1 class="amp-wp-title">
|
58 |
<?php $ampforwp_post_url = get_permalink(); ?>
|
59 |
-
<a href="<?php echo trailingslashit($ampforwp_post_url) .
|
60 |
</h1>
|
61 |
|
62 |
<div class="amp-wp-content-loop">
|
@@ -77,8 +80,17 @@
|
|
77 |
$thumb_url = $thumb_url_array[0];
|
78 |
?>
|
79 |
<div class="home-post-image">
|
80 |
-
<a href="<?php echo trailingslashit($ampforwp_post_url) .
|
81 |
-
<amp-img
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
</a>
|
83 |
</div>
|
84 |
<?php }
|
@@ -104,11 +116,11 @@
|
|
104 |
|
105 |
<?php endif; ?>
|
106 |
|
107 |
-
<?php do_action('
|
108 |
|
109 |
</article>
|
110 |
|
111 |
-
|
112 |
|
113 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
114 |
|
9 |
global $wp;
|
10 |
$current_archive_url = home_url( $wp->request );
|
11 |
$amp_url = trailingslashit($current_archive_url);
|
12 |
+
$remove = '/'. AMPFORWP_AMP_QUERY_VAR;
|
13 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
14 |
} ?>
|
15 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
21 |
</style>
|
22 |
</head>
|
23 |
|
24 |
+
<body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?> design_1_wrapper">
|
25 |
|
26 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
27 |
|
28 |
+
|
29 |
+
<?php do_action('ampforwp_home_above_loop') ?>
|
30 |
+
|
31 |
<article class="amp-wp-article ampforwp-custom-index amp-wp-home">
|
32 |
|
33 |
+
<?php do_action('ampforwp_post_before_loop') ?>
|
34 |
|
35 |
<?php
|
36 |
if ( get_query_var( 'paged' ) ) {
|
48 |
'orderby' => 'date',
|
49 |
'paged' => esc_attr($paged),
|
50 |
'post__not_in' => $exclude_ids,
|
51 |
+
'has_password' => false ,
|
52 |
+
'post_status'=> 'publish'
|
53 |
);
|
54 |
$filtered_args = apply_filters('ampforwp_query_args', $args);
|
55 |
$q = new WP_Query( $filtered_args ); ?>
|
59 |
|
60 |
<h1 class="amp-wp-title">
|
61 |
<?php $ampforwp_post_url = get_permalink(); ?>
|
62 |
+
<a href="<?php echo trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR ;?>"><?php the_title() ?></a>
|
63 |
</h1>
|
64 |
|
65 |
<div class="amp-wp-content-loop">
|
80 |
$thumb_url = $thumb_url_array[0];
|
81 |
?>
|
82 |
<div class="home-post-image">
|
83 |
+
<a href="<?php echo trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR ;?>">
|
84 |
+
<amp-img
|
85 |
+
src=<?php echo $thumb_url ?>
|
86 |
+
<?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
|
87 |
+
width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
|
88 |
+
height=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-height'] ?>
|
89 |
+
<?php } else { ?>
|
90 |
+
width=100
|
91 |
+
height=75
|
92 |
+
<?php } ?>
|
93 |
+
></amp-img>
|
94 |
</a>
|
95 |
</div>
|
96 |
<?php }
|
116 |
|
117 |
<?php endif; ?>
|
118 |
|
119 |
+
<?php do_action('ampforwp_post_after_loop') ?>
|
120 |
|
121 |
</article>
|
122 |
|
123 |
+
<?php do_action('ampforwp_home_below_loop') ?>
|
124 |
|
125 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
126 |
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php global $redux_builder_amp; ?>
|
2 |
+
<!doctype html>
|
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 $paged = get_query_var( 'paged' );
|
8 |
+
$current_search_url =trailingslashit(get_home_url())."?s=".get_search_query();
|
9 |
+
$amp_url = untrailingslashit($current_search_url);
|
10 |
+
if ($paged > 1 ) {
|
11 |
+
global $wp;
|
12 |
+
$current_archive_url = home_url( $wp->request );
|
13 |
+
$amp_url = trailingslashit($current_archive_url);
|
14 |
+
$remove = '/'. AMPFORWP_AMP_QUERY_VAR;
|
15 |
+
$amp_url = str_replace($remove, '', $amp_url) ;
|
16 |
+
$amp_url = $amp_url ."?s=".get_search_query();
|
17 |
+
} ?>
|
18 |
+
<link rel="canonical" href="<?php echo $amp_url ?>">
|
19 |
+
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
|
20 |
+
<?php do_action( 'amp_post_template_head', $this ); ?>
|
21 |
+
<style amp-custom>
|
22 |
+
<?php $this->load_parts( array( 'style' ) ); ?>
|
23 |
+
<?php do_action( 'amp_post_template_css', $this ); ?>
|
24 |
+
</style>
|
25 |
+
</head>
|
26 |
+
|
27 |
+
<body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?> design_1_wrapper">
|
28 |
+
|
29 |
+
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
30 |
+
|
31 |
+
<article class="amp-wp-article ampforwp-custom-index amp-wp-home">
|
32 |
+
|
33 |
+
<?php do_action('ampforwp_post_before_loop') ?>
|
34 |
+
<?php
|
35 |
+
if ( get_query_var( 'paged' ) ) {
|
36 |
+
$paged = get_query_var('paged');
|
37 |
+
} elseif ( get_query_var( 'page' ) ) {
|
38 |
+
$paged = get_query_var('page');
|
39 |
+
} else {
|
40 |
+
$paged = 1;
|
41 |
+
}
|
42 |
+
|
43 |
+
$exclude_ids = get_option('ampforwp_exclude_post');
|
44 |
+
|
45 |
+
$q = new WP_Query( array(
|
46 |
+
's' => get_search_query() ,
|
47 |
+
'ignore_sticky_posts' => 1,
|
48 |
+
'paged' => esc_attr($paged),
|
49 |
+
'post__not_in' => $exclude_ids,
|
50 |
+
'has_password' => false ,
|
51 |
+
'post_status' => 'publish'
|
52 |
+
) ); ?>
|
53 |
+
|
54 |
+
<h3 class="amp-wp-content page-title"><?php echo $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();?> </h3>
|
55 |
+
|
56 |
+
<?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
|
57 |
+
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
|
58 |
+
|
59 |
+
<div class="amp-wp-content amp-wp-article-header amp-loop-list">
|
60 |
+
|
61 |
+
<h1 class="amp-wp-title">
|
62 |
+
<?php $ampforwp_post_url = get_permalink(); ?>
|
63 |
+
<a href="<?php echo trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR ;?>"><?php the_title() ?></a>
|
64 |
+
</h1>
|
65 |
+
|
66 |
+
<div class="amp-wp-content-loop">
|
67 |
+
|
68 |
+
<div class="amp-wp-meta">
|
69 |
+
<time> <?php printf( _x( '%1$s '. $redux_builder_amp['amp-translator-ago-date-text'], '%2$s = human-readable time difference', 'wpdocs_textdomain' ), human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) ) ); ?> </time>
|
70 |
+
</div>
|
71 |
+
|
72 |
+
<?php if ( has_post_thumbnail() ) { ?>
|
73 |
+
<?php
|
74 |
+
$thumb_id = get_post_thumbnail_id();
|
75 |
+
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
|
76 |
+
$thumb_url = $thumb_url_array[0];
|
77 |
+
?>
|
78 |
+
<div class="home-post-image">
|
79 |
+
<a href="<?php echo trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR ;?>">
|
80 |
+
<amp-img src=<?php echo $thumb_url ?> width=100 height=75></amp-img>
|
81 |
+
</a>
|
82 |
+
</div>
|
83 |
+
<?php }
|
84 |
+
if( has_excerpt() ){
|
85 |
+
$content = get_the_excerpt();
|
86 |
+
}else{
|
87 |
+
$content = get_the_content();
|
88 |
+
} ?>
|
89 |
+
<p><?php echo wp_trim_words( $content , '20'); ?></p>
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
<?php endwhile; ?>
|
93 |
+
<div class="amp-wp-content pagination-holder">
|
94 |
+
|
95 |
+
<div id="pagination">
|
96 |
+
<div class="next"><?php next_posts_link( $redux_builder_amp['amp-translator-next-text']. ' »', 0 ) ?></div>
|
97 |
+
<div class="prev"><?php previous_posts_link( '« '. $redux_builder_amp['amp-translator-previous-text'] ); ?></div>
|
98 |
+
<div class="clearfix"></div>
|
99 |
+
</div>
|
100 |
+
|
101 |
+
</div>
|
102 |
+
<?php else: ?>
|
103 |
+
<div class="amp-wp-content amp-wp-article-header amp-loop-list">
|
104 |
+
<?php echo $redux_builder_amp['amp-translator-search-no-found']; ?>
|
105 |
+
<div class="cb"></div>
|
106 |
+
</div>
|
107 |
+
<?php endif; ?> <?php wp_reset_postdata(); ?>
|
108 |
+
|
109 |
+
<?php do_action('ampforwp_post_after_loop') ?>
|
110 |
+
|
111 |
+
</article>
|
112 |
+
|
113 |
+
<?php $this->load_parts( array( 'footer' ) ); ?>
|
114 |
+
|
115 |
+
<?php do_action( 'amp_post_template_footer', $this ); ?>
|
116 |
+
|
117 |
+
</body>
|
118 |
+
</html>
|
@@ -11,7 +11,7 @@
|
|
11 |
</style>
|
12 |
</head>
|
13 |
|
14 |
-
<body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?> single-post <?php if(is_page()){ echo'amp-single-page'; };?>">
|
15 |
|
16 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
17 |
|
11 |
</style>
|
12 |
</head>
|
13 |
|
14 |
+
<body class="<?php echo esc_attr( $this->get( 'body_class' ) ); ?> single-post <?php if(is_page()){ echo'amp-single-page'; };?> design_1_wrapper">
|
15 |
|
16 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
17 |
|
@@ -1,14 +1,8 @@
|
|
1 |
-
<?php
|
2 |
-
add_action('amp_post_template_css', 'ampforwp_additional_style_input');
|
3 |
-
|
4 |
function ampforwp_additional_style_input( $amp_template ) {
|
5 |
global $redux_builder_amp;
|
6 |
$get_customizer = new AMP_Post_Template( $post_id );
|
7 |
-
|
8 |
-
// Get content width
|
9 |
$content_max_width = absint( $get_customizer->get( 'content_max_width' ) );
|
10 |
-
|
11 |
-
// Get template colors
|
12 |
$theme_color = $get_customizer->get_customizer_setting( 'theme_color' );
|
13 |
$text_color = $get_customizer->get_customizer_setting( 'text_color' );
|
14 |
$muted_text_color = $get_customizer->get_customizer_setting( 'muted_text_color' );
|
@@ -17,819 +11,185 @@ function ampforwp_additional_style_input( $amp_template ) {
|
|
17 |
$header_background_color = $get_customizer->get_customizer_setting( 'header_background_color' );
|
18 |
$header_color = $get_customizer->get_customizer_setting( 'header_color' );
|
19 |
?>
|
20 |
-
|
21 |
-
.
|
22 |
-
|
23 |
-
}
|
24 |
-
|
25 |
-
|
26 |
-
}
|
27 |
-
.
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
}
|
32 |
-
.amp-wp-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
}
|
37 |
-
.amp-wp-unknown-size img {
|
38 |
-
/** Worst case scenario when we can't figure out dimensions for an image. **/
|
39 |
-
/** Force the image into a box of fixed dimensions and use object-fit to scale. **/
|
40 |
-
object-fit: contain;
|
41 |
-
}
|
42 |
-
amp-iframe { max-width: 100%; margin-bottom : 20px; }
|
43 |
-
/* Template Styles */
|
44 |
-
.amp-wp-content,
|
45 |
-
.amp-wp-title-bar div {
|
46 |
-
<?php if ( $content_max_width > 0 ) : ?>
|
47 |
-
margin: 0 auto;
|
48 |
-
max-width: <?php echo sprintf( '%dpx', $content_max_width ); ?>;
|
49 |
-
<?php endif; ?>
|
50 |
-
}
|
51 |
-
html {
|
52 |
-
background: <?php echo sanitize_hex_color( $header_background_color ); ?>;
|
53 |
-
}
|
54 |
-
body {
|
55 |
-
background: <?php echo sanitize_hex_color( $theme_color ); ?>;
|
56 |
-
color: <?php echo sanitize_hex_color( $text_color ); ?>;
|
57 |
-
font-family: 'Merriweather', 'Times New Roman', Times, Serif;
|
58 |
-
font-weight: 300;
|
59 |
-
line-height: 1.75em;
|
60 |
-
}
|
61 |
-
p,
|
62 |
-
ol,
|
63 |
-
ul,
|
64 |
-
figure {
|
65 |
-
margin: 0 0 1em;
|
66 |
-
padding: 0;
|
67 |
-
}
|
68 |
-
a,
|
69 |
-
a:visited {
|
70 |
-
color: <?php echo sanitize_hex_color( $link_color ); ?>;
|
71 |
-
}
|
72 |
-
a:hover,
|
73 |
-
a:active,
|
74 |
-
a:focus {
|
75 |
-
color: <?php echo sanitize_hex_color( $text_color ); ?>;
|
76 |
-
}
|
77 |
-
/* Quotes */
|
78 |
-
blockquote {
|
79 |
-
color: <?php echo sanitize_hex_color( $text_color ); ?>;
|
80 |
-
background: rgba(127,127,127,.125);
|
81 |
-
border-left: 2px solid <?php echo sanitize_hex_color( $link_color ); ?>;
|
82 |
-
margin: 8px 0 24px 0;
|
83 |
-
padding: 16px;
|
84 |
-
}
|
85 |
-
blockquote p:last-child {
|
86 |
-
margin-bottom: 0;
|
87 |
-
}
|
88 |
-
/* UI Fonts */
|
89 |
-
.amp-wp-meta,
|
90 |
-
.amp-wp-header div,
|
91 |
-
.amp-wp-title,
|
92 |
-
.wp-caption-text,
|
93 |
-
.amp-wp-tax-category,
|
94 |
-
.amp-wp-tax-tag,
|
95 |
-
.amp-wp-comments-link,
|
96 |
-
.amp-wp-footer p,
|
97 |
-
.back-to-top {
|
98 |
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;
|
99 |
-
}
|
100 |
-
/* Header */
|
101 |
-
.amp-wp-header {
|
102 |
-
background-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;
|
103 |
-
}
|
104 |
-
.amp-wp-header div {
|
105 |
-
color: <?php echo sanitize_hex_color( $header_color ); ?>;
|
106 |
-
font-size: 1em;
|
107 |
-
font-weight: 400;
|
108 |
-
margin: 0 auto;
|
109 |
-
max-width: calc(840px - 32px);
|
110 |
-
padding: .875em 16px;
|
111 |
-
position: relative;
|
112 |
-
}
|
113 |
-
.amp-wp-header a {
|
114 |
-
color: <?php echo sanitize_hex_color( $header_color ); ?>;
|
115 |
-
text-decoration: none;
|
116 |
-
}
|
117 |
-
/* Site Icon */
|
118 |
-
.amp-wp-header .amp-wp-site-icon {
|
119 |
-
/** site icon is 32px **/
|
120 |
-
background-color: <?php echo sanitize_hex_color( $header_color ); ?>;
|
121 |
-
border: 1px solid <?php echo sanitize_hex_color( $header_color ); ?>;
|
122 |
-
border-radius: 50%;
|
123 |
-
position: absolute;
|
124 |
-
right: 18px;
|
125 |
-
top: 10px;
|
126 |
-
}
|
127 |
-
/* Article */
|
128 |
-
.amp-wp-article {
|
129 |
-
color: <?php echo sanitize_hex_color( $text_color ); ?>;
|
130 |
-
font-weight: 400;
|
131 |
-
margin: 1.5em auto;
|
132 |
-
max-width: 840px;
|
133 |
-
overflow-wrap: break-word;
|
134 |
-
word-wrap: break-word;
|
135 |
-
}
|
136 |
-
/* Article Header */
|
137 |
-
.amp-wp-article-header {
|
138 |
-
align-items: center;
|
139 |
-
align-content: stretch;
|
140 |
-
display: flex;
|
141 |
-
flex-wrap: wrap;
|
142 |
-
justify-content: space-between;
|
143 |
-
margin: 1.5em 16px 1.5em;
|
144 |
-
}
|
145 |
-
.amp-wp-title {
|
146 |
-
color: <?php echo sanitize_hex_color( $text_color ); ?>;
|
147 |
-
display: block;
|
148 |
-
flex: 1 0 100%;
|
149 |
-
font-weight: 900;
|
150 |
-
margin: 0;
|
151 |
-
width: 100%;
|
152 |
-
}
|
153 |
-
/* Article Meta */
|
154 |
-
.amp-wp-meta {
|
155 |
-
color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;
|
156 |
-
display: inline-block;
|
157 |
-
flex: 2 1 50%;
|
158 |
-
font-size: .875em;
|
159 |
-
line-height: 1.7em;
|
160 |
-
margin: 0;
|
161 |
-
padding: 0;
|
162 |
-
}
|
163 |
-
.ampforwp-meta-info{
|
164 |
-
margin-top: 0px;
|
165 |
-
}
|
166 |
-
.amp-wp-article-header .amp-wp-meta:last-of-type {
|
167 |
-
text-align: right;
|
168 |
-
}
|
169 |
-
.amp-wp-article-header .amp-wp-meta:first-of-type {
|
170 |
-
text-align: left;
|
171 |
-
}
|
172 |
-
.amp-wp-byline amp-img,
|
173 |
-
.amp-wp-byline .amp-wp-author {
|
174 |
-
display: inline-block;
|
175 |
-
vertical-align: middle;
|
176 |
-
}
|
177 |
-
.amp-wp-byline amp-img {
|
178 |
-
border: 1px solid <?php echo sanitize_hex_color( $link_color ); ?>;
|
179 |
-
border-radius: 50%;
|
180 |
-
position: relative;
|
181 |
-
margin-right: 6px;
|
182 |
-
}
|
183 |
-
.amp-wp-posted-on {
|
184 |
-
text-align: right;
|
185 |
-
}
|
186 |
-
/* Featured image */
|
187 |
-
.amp-wp-article-featured-image {
|
188 |
-
margin: 1.5em 16px 1.5em;
|
189 |
-
}
|
190 |
-
.amp-wp-article-featured-image amp-img {
|
191 |
-
margin: 0 auto;
|
192 |
-
}
|
193 |
-
.amp-wp-article-featured-image.wp-caption .wp-caption-text {
|
194 |
-
margin: 0 18px;
|
195 |
-
}
|
196 |
-
/* Front page */
|
197 |
-
.amp-wp-frontpage .the_content {
|
198 |
-
padding: 10px;
|
199 |
-
}
|
200 |
-
.amp-wp-frontpage .ampforwp-title {
|
201 |
-
margin-left:10px;
|
202 |
-
}
|
203 |
-
/* Article Content */
|
204 |
-
.amp-wp-article a{
|
205 |
-
text-decoration:none
|
206 |
-
}
|
207 |
-
.amp-wp-article-content {
|
208 |
-
margin: 0 16px;
|
209 |
-
}
|
210 |
-
.amp-wp-article-content ul,
|
211 |
-
.amp-wp-article-content ol {
|
212 |
-
margin-left: 1em;
|
213 |
-
}
|
214 |
-
.amp-wp-article-content amp-img {
|
215 |
-
margin: 0 auto;
|
216 |
-
}
|
217 |
-
.amp-wp-article-content amp-img.alignright {
|
218 |
-
margin: 0 0 1em 16px;
|
219 |
-
}
|
220 |
-
.amp-wp-article-content amp-img.alignleft {
|
221 |
-
margin: 0 16px 1em 0;
|
222 |
-
}
|
223 |
-
/* Disqus */
|
224 |
-
.amp-disqus-comments {
|
225 |
-
padding: 15px;
|
226 |
-
}
|
227 |
-
.amp-disqus-comments amp-iframe{
|
228 |
-
background: none;
|
229 |
-
}
|
230 |
-
/* Captions */
|
231 |
-
.wp-caption {
|
232 |
-
padding: 0;
|
233 |
-
}
|
234 |
-
.wp-caption.alignleft {
|
235 |
-
margin-right: 16px;
|
236 |
-
}
|
237 |
-
.wp-caption.alignright {
|
238 |
-
margin-left: 16px;
|
239 |
-
}
|
240 |
-
.wp-caption-text {
|
241 |
-
border-bottom: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;
|
242 |
-
color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;
|
243 |
-
font-size: .875em;
|
244 |
-
line-height: 1.5em;
|
245 |
-
margin: 0;
|
246 |
-
padding: .66em 10px .75em;
|
247 |
-
text-align: center;
|
248 |
-
}
|
249 |
-
/* AMP Media */
|
250 |
-
amp-carousel {
|
251 |
-
background: <?php echo sanitize_hex_color( $border_color ); ?>;
|
252 |
-
margin: 0 -16px 1.5em;
|
253 |
-
}
|
254 |
-
amp-iframe,
|
255 |
-
amp-youtube,
|
256 |
-
amp-instagram,
|
257 |
-
amp-vine {
|
258 |
-
background: <?php echo sanitize_hex_color( $border_color ); ?>;
|
259 |
-
margin: 0 -16px 1.5em;
|
260 |
-
}
|
261 |
-
.amp-wp-article-content amp-carousel amp-img {
|
262 |
-
border: none;
|
263 |
-
}
|
264 |
-
amp-carousel > amp-img > img {
|
265 |
-
object-fit: contain;
|
266 |
-
}
|
267 |
-
.amp-wp-iframe-placeholder {
|
268 |
-
background: <?php echo sanitize_hex_color( $border_color ); ?> url( <?php echo esc_url( $get_customizer->get( 'placeholder_image_url' ) ); ?> ) no-repeat center 40%;
|
269 |
-
background-size: 48px 48px;
|
270 |
-
min-height: 48px;
|
271 |
-
}
|
272 |
-
/* Article Footer Meta */
|
273 |
-
.amp-wp-article-footer .amp-wp-meta {
|
274 |
-
display: block;
|
275 |
-
}
|
276 |
-
.amp-wp-tax-category span{
|
277 |
-
margin-right:5px;
|
278 |
-
}
|
279 |
-
.amp-wp-tax-category,
|
280 |
-
.amp-wp-tax-tag {
|
281 |
-
color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;
|
282 |
-
font-size: .875em;
|
283 |
-
line-height: 1.5em;
|
284 |
-
margin: 1.5em 16px;
|
285 |
-
}
|
286 |
-
.ampforwp-comment-button {
|
287 |
-
margin-bottom:20px;
|
288 |
-
}
|
289 |
-
.amp-wp-comments-link {
|
290 |
-
color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;
|
291 |
-
font-size: .875em;
|
292 |
-
line-height: 1.5em;
|
293 |
-
text-align: center;
|
294 |
-
margin: 2.25em 0 1.5em;
|
295 |
-
}
|
296 |
-
.amp-wp-comments-link a {
|
297 |
-
border-style: solid;
|
298 |
-
border-color: <?php echo sanitize_hex_color( $border_color ); ?>;
|
299 |
-
border-width: 1px 1px 2px;
|
300 |
-
border-radius: 4px;
|
301 |
-
background-color: transparent;
|
302 |
-
color: <?php echo sanitize_hex_color( $link_color ); ?>;
|
303 |
-
cursor: pointer;
|
304 |
-
display: block;
|
305 |
-
font-size: 14px;
|
306 |
-
font-weight: 600;
|
307 |
-
line-height: 18px;
|
308 |
-
margin: 0 auto;
|
309 |
-
max-width: 200px;
|
310 |
-
padding: 11px 16px;
|
311 |
-
text-decoration: none;
|
312 |
-
width: 50%;
|
313 |
-
-webkit-transition: background-color 0.2s ease;
|
314 |
-
transition: background-color 0.2s ease;
|
315 |
-
}
|
316 |
-
.page-title {
|
317 |
-
margin: 0 15px;
|
318 |
-
}
|
319 |
-
/* AMP Footer */
|
320 |
-
.amp-wp-footer {
|
321 |
-
border-top: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;
|
322 |
-
margin: calc(1.5em - 1px) 0 0;
|
323 |
-
padding-bottom:25px;
|
324 |
-
}
|
325 |
-
.amp-wp-footer div {
|
326 |
-
margin: 0 auto;
|
327 |
-
max-width: calc(840px - 32px);
|
328 |
-
padding: 1.25em 16px 1.25em;
|
329 |
-
position: relative;
|
330 |
-
}
|
331 |
-
.amp-wp-footer h2 {
|
332 |
-
font-size: 1em;
|
333 |
-
line-height: 1.375em;
|
334 |
-
margin: 0 0 .5em;
|
335 |
-
}
|
336 |
-
.amp-wp-footer p {
|
337 |
-
color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;
|
338 |
-
font-size: .8em;
|
339 |
-
line-height: 1.5em;
|
340 |
-
margin: 0 15px 0 0;
|
341 |
-
}
|
342 |
-
.amp-wp-footer a {
|
343 |
-
text-decoration: none;
|
344 |
-
}
|
345 |
-
.copyright_txt{ float:left }
|
346 |
-
.back-to-top { float:right }
|
347 |
-
/* Header */
|
348 |
-
.amp-wp-header {
|
349 |
-
}
|
350 |
-
.amp-wp-header .nav_container {
|
351 |
-
float: right;
|
352 |
-
top: -11px;
|
353 |
-
line-height: 1;
|
354 |
-
right: 60px;
|
355 |
-
}
|
356 |
-
.toggle-text {
|
357 |
-
position: absolute;
|
358 |
-
right: 0;
|
359 |
-
height: 22px;
|
360 |
-
width: 28px;
|
361 |
-
}
|
362 |
-
.toggle-text span {
|
363 |
-
display: block;
|
364 |
-
position: absolute;
|
365 |
-
height: 2px;
|
366 |
-
width: 25px;
|
367 |
-
background: #ffffff;
|
368 |
-
border-radius: 19px;
|
369 |
-
opacity: 1;
|
370 |
-
left: 0;
|
371 |
-
}
|
372 |
-
.toggle-text span:nth-child(2) {
|
373 |
-
top: 9px;
|
374 |
-
}
|
375 |
-
.toggle-text span:nth-child(3) {
|
376 |
-
top: 18px;
|
377 |
-
}
|
378 |
-
/* Homepage */
|
379 |
-
.amp-wp-home .amp-wp-meta{
|
380 |
-
margin:5px 0px
|
381 |
-
}
|
382 |
-
.amp-wp-home .amp-wp-content p {
|
383 |
-
display: inline-block;
|
384 |
-
width: 100%;
|
385 |
-
}
|
386 |
-
.ampforwp-custom-index .amp-wp-title a {
|
387 |
-
text-decoration: none;
|
388 |
-
color: <?php echo sanitize_hex_color( $text_color ); ?>;
|
389 |
-
}
|
390 |
-
.amp-wp-meta {
|
391 |
-
display: flex;
|
392 |
-
}
|
393 |
-
.amp-wp-posted-on {
|
394 |
-
display: initial
|
395 |
-
}
|
396 |
-
.ampforwp-custom-index .amp-wp-content {
|
397 |
-
margin-bottom: 30px;
|
398 |
-
}
|
399 |
-
/* Home Pagination */
|
400 |
-
.pagination-holder{
|
401 |
-
margin: 1.5em 16px 1.5em
|
402 |
-
}
|
403 |
-
#pagination .next {
|
404 |
-
display: inline-block;
|
405 |
-
float: right
|
406 |
-
}
|
407 |
-
#pagination .prev {
|
408 |
-
display: inline-block;
|
409 |
-
}
|
410 |
-
.amp-wp-home .amp-wp-content p {
|
411 |
-
display: inline;
|
412 |
-
}
|
413 |
-
.home-post-image {
|
414 |
-
float: right ;
|
415 |
-
margin: 0 0 10px 20px;
|
416 |
-
}
|
417 |
-
/* Single */
|
418 |
-
.amp-wp-article-content amp-img {
|
419 |
-
max-width : 100%;
|
420 |
-
}
|
421 |
-
.amp-wp-meta.amp-wp-tax-category,
|
422 |
-
.amp-wp-meta.amp-wp-tax-tag {
|
423 |
-
margin : 0
|
424 |
-
}
|
425 |
-
.amp-wp-meta.amp-wp-tax-tag {
|
426 |
-
display : initial
|
427 |
-
}
|
428 |
-
/* Social Icons */
|
429 |
-
.ampforwp-social-icons{
|
430 |
-
margin: 1.5em 16px 1.5em;
|
431 |
-
}
|
432 |
-
.whatsapp-share-icon {
|
433 |
-
width: 50px;
|
434 |
-
height: 20px;
|
435 |
-
display: inline-block;
|
436 |
-
background: #5cbe4a;
|
437 |
-
padding: 4px 0px;
|
438 |
-
position: relative;
|
439 |
-
top: -4px;
|
440 |
-
text-align: center
|
441 |
-
}
|
442 |
-
.comment-button-wrapper a{
|
443 |
-
font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;
|
444 |
-
border-style: solid;
|
445 |
-
border-color: #c2c2c2;
|
446 |
-
border-width: 1px 1px 2px;
|
447 |
-
border-radius: 4px;
|
448 |
-
background-color: transparent;
|
449 |
-
color: #0a89c0;
|
450 |
-
cursor: pointer;
|
451 |
-
display: block;
|
452 |
-
font-size: 14px;
|
453 |
-
font-weight: 600;
|
454 |
-
text-align:center;
|
455 |
-
line-height: 18px;
|
456 |
-
margin: 0 auto;
|
457 |
-
max-width: 200px;
|
458 |
-
padding: 11px 16px;
|
459 |
-
text-decoration: none;
|
460 |
-
width: 50%;
|
461 |
-
-webkit-transition: background-color 0.2s ease;
|
462 |
-
transition: background-color 0.2s ease;
|
463 |
-
}
|
464 |
-
/* Related Posts */
|
465 |
-
.relatedpost{
|
466 |
-
margin: 2em 16px 2em;
|
467 |
-
}
|
468 |
-
main .amp-wp-content.relatedpost {
|
469 |
-
background: none;
|
470 |
-
box-shadow: none;
|
471 |
-
max-width: 1030px;
|
472 |
-
}
|
473 |
-
.related_posts h3, .comments_list h3{
|
474 |
-
font-size: 14px;
|
475 |
-
font-weight: bold;
|
476 |
-
letter-spacing: 0.4px;
|
477 |
-
margin: 25px 0 10px 0;
|
478 |
-
color: #333;
|
479 |
-
}
|
480 |
-
.related_posts ol{
|
481 |
-
list-style-type:none;
|
482 |
-
margin:0;
|
483 |
-
padding:0;
|
484 |
-
font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif
|
485 |
-
}
|
486 |
-
.related_posts ol li{
|
487 |
-
display:inline-block;
|
488 |
-
width:100%;
|
489 |
-
margin-bottom: 12px;
|
490 |
-
padding: 0px;
|
491 |
-
}
|
492 |
-
.related_posts .related_link a{
|
493 |
-
color: #000;
|
494 |
-
font-size: 18px;
|
495 |
-
}
|
496 |
-
.related_posts ol li amp-img{
|
497 |
-
width:100px;
|
498 |
-
float:left;
|
499 |
-
margin-right:15px
|
500 |
-
}
|
501 |
-
.related_posts ol li p{
|
502 |
-
font-size: 12px;
|
503 |
-
color: #999;
|
504 |
-
line-height: 1.2;
|
505 |
-
margin: 12px 0 0 0;
|
506 |
-
}
|
507 |
-
.no_related_thumbnail{
|
508 |
-
padding: 15px 18px;
|
509 |
-
}
|
510 |
-
/* Comments */
|
511 |
-
.comments_list{
|
512 |
-
margin: 2.5em 16px 2.5em
|
513 |
-
}
|
514 |
-
main .amp-wp-content.comments_list {
|
515 |
-
background: none;
|
516 |
-
box-shadow: none;
|
517 |
-
max-width: 1030px;
|
518 |
-
}
|
519 |
-
.comments_list div{
|
520 |
-
display:inline-block;
|
521 |
-
}
|
522 |
-
.comments_list ul{
|
523 |
-
margin:0;
|
524 |
-
padding:0
|
525 |
-
}
|
526 |
-
.comments_list ul.children{
|
527 |
-
padding-bottom:10px;
|
528 |
-
margin-left: 4%;
|
529 |
-
width: 96%;
|
530 |
-
}
|
531 |
-
.comments_list ul li p{
|
532 |
-
margin: 0;
|
533 |
-
font-size: 14px;
|
534 |
-
clear: both;
|
535 |
-
padding-top: 5px;
|
536 |
-
}
|
537 |
-
.comments_list ul li{
|
538 |
-
font-family:sans-serif;
|
539 |
-
font-size:11px;
|
540 |
-
list-style-type:none;
|
541 |
-
margin-bottom: 12px;
|
542 |
-
background: #fefefe;
|
543 |
-
-moz-border-radius: 2px;
|
544 |
-
-webkit-border-radius: 2px;
|
545 |
-
border-radius: 2px;
|
546 |
-
-moz-box-shadow: 0 2px 3px rgba(0,0,0,.05);
|
547 |
-
-webkit-box-shadow: 0 2px 3px rgba(0,0,0,.05);
|
548 |
-
box-shadow: 0 2px 3px rgba(0,0,0,.05);
|
549 |
-
padding: 0px;
|
550 |
-
max-width: 1000px;
|
551 |
-
width:96%;
|
552 |
-
}
|
553 |
-
.comments_list ul li .says{
|
554 |
-
margin-right: 4px;
|
555 |
-
}
|
556 |
-
.comments_list ul li p{
|
557 |
-
font-family:'Merriweather', 'Times New Roman', Times, Serif
|
558 |
-
}
|
559 |
-
.comments_list ul li .comment-body{
|
560 |
-
padding: 10px 0px 15px 0px;
|
561 |
-
}
|
562 |
-
.comment-author{ float:left }
|
563 |
-
.single-post footer.comment-meta{
|
564 |
-
/* float:right */
|
565 |
-
padding-bottom: 0;
|
566 |
-
}
|
567 |
-
.comments_list li li{
|
568 |
-
margin: 20px 20px 10px 20px;
|
569 |
-
background: #f7f7f7;
|
570 |
-
box-shadow: none;
|
571 |
-
border: 1px solid #eee;
|
572 |
-
}
|
573 |
-
.comments_list li li li{
|
574 |
-
margin:20px 20px 10px 20px
|
575 |
-
}
|
576 |
-
/* Slide Navigation code */
|
577 |
-
amp-sidebar {
|
578 |
-
width: 250px;
|
579 |
-
}
|
580 |
-
.amp-sidebar-image {
|
581 |
-
line-height: 100px;
|
582 |
-
vertical-align:middle;
|
583 |
-
}
|
584 |
-
.amp-close-image {
|
585 |
-
top: 15px;
|
586 |
-
left: 225px;
|
587 |
-
cursor: pointer;
|
588 |
-
}
|
589 |
-
.toggle-navigationv2 ul {
|
590 |
-
list-style-type: none;
|
591 |
-
margin: 0;
|
592 |
-
font-family:sans-serif;
|
593 |
-
padding: 0;
|
594 |
-
}
|
595 |
-
.toggle-navigationv2 ul ul li a {
|
596 |
-
padding-left: 35px;
|
597 |
-
background: #fff;
|
598 |
-
display: inline-block
|
599 |
-
}
|
600 |
-
.toggle-navigationv2 ul li a{
|
601 |
-
padding: 10px 15px 10px 25px;
|
602 |
-
width: 88%;
|
603 |
-
display: inline-block;
|
604 |
-
text-decoration: none;
|
605 |
-
background: #fafafa;
|
606 |
-
font-size: 13px;
|
607 |
-
border-bottom: 1px solid #efefef;
|
608 |
-
}
|
609 |
-
.close-nav{
|
610 |
-
font-size: 12px;
|
611 |
-
font-family: sans-serif;
|
612 |
-
background: rgba(0, 0, 0, 0.25);
|
613 |
-
letter-spacing: 1px;
|
614 |
-
display: inline-block;
|
615 |
-
padding: 10px;
|
616 |
-
border-radius: 100px;
|
617 |
-
line-height: 8px;
|
618 |
-
margin: 14px;
|
619 |
-
left: 191px;
|
620 |
-
color: #fff;
|
621 |
-
}
|
622 |
-
.close-nav:hover{
|
623 |
-
background: rgba(0, 0, 0, 0.45);
|
624 |
-
}
|
625 |
-
.toggle-navigation ul{
|
626 |
-
list-style-type: none;
|
627 |
-
margin: 0;
|
628 |
-
padding: 0;
|
629 |
-
display: inline-block;
|
630 |
-
width: 100%
|
631 |
-
}
|
632 |
-
.menu-all-pages-container:after{
|
633 |
-
content: "";
|
634 |
-
clear: both
|
635 |
-
}
|
636 |
-
.toggle-navigation ul li{
|
637 |
-
font-size: 13px;
|
638 |
-
border-bottom: 1px solid rgba(0, 0, 0, 0.11);
|
639 |
-
padding: 11px 0px;
|
640 |
-
width: 25%;
|
641 |
-
float: left;
|
642 |
-
text-align: center;
|
643 |
-
margin-top: 6px
|
644 |
-
}
|
645 |
-
.toggle-navigation ul ul{
|
646 |
-
display: none
|
647 |
-
}
|
648 |
-
.toggle-navigation ul li a{
|
649 |
-
color: #eee;
|
650 |
-
padding: 15px;
|
651 |
-
}
|
652 |
-
.toggle-navigation{
|
653 |
-
display: none;
|
654 |
-
background: #444;
|
655 |
-
}
|
656 |
-
.nav_container:hover + .toggle-navigation,
|
657 |
-
.toggle-navigation:hover,
|
658 |
-
.toggle-navigation:active,
|
659 |
-
.toggle-navigation:focus{
|
660 |
-
display: inline-block;
|
661 |
-
width: 100%;
|
662 |
-
}
|
663 |
-
/* Notifications */
|
664 |
-
#amp-user-notification1 p {
|
665 |
-
display: inline-block;
|
666 |
-
}
|
667 |
-
amp-user-notification {
|
668 |
-
padding: 5px;
|
669 |
-
text-align: center;
|
670 |
-
background: #fff;
|
671 |
-
border-top: 1px solid;
|
672 |
-
}
|
673 |
-
amp-user-notification button {
|
674 |
-
padding: 8px 10px;
|
675 |
-
background: <?php echo sanitize_hex_color( $header_background_color ); ?>;
|
676 |
-
color: <?php echo sanitize_hex_color( $header_color ); ?>;
|
677 |
-
margin-left: 5px;
|
678 |
-
border: 0;
|
679 |
-
}
|
680 |
-
amp-user-notification button:hover {
|
681 |
-
cursor: pointer
|
682 |
-
}
|
683 |
-
/* Advertisement */
|
684 |
-
.amp-ad-wrapper {
|
685 |
-
text-align: center
|
686 |
-
}
|
687 |
-
/* Sticky Social bar in Single */
|
688 |
-
<?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_single() ) { ?>
|
689 |
-
body {
|
690 |
-
padding-bottom: 43px;
|
691 |
-
}
|
692 |
-
<?php } ?>
|
693 |
-
.sticky_social{
|
694 |
-
width: 100%;
|
695 |
-
bottom: 0;
|
696 |
-
display: block;
|
697 |
-
left: 0;
|
698 |
-
box-shadow: 0px 4px 7px #000;
|
699 |
-
background: #fff;
|
700 |
-
padding: 7px 0px 0px 0px;
|
701 |
-
position: fixed;
|
702 |
-
margin: 0;
|
703 |
-
z-index: 10;
|
704 |
-
text-align: center;
|
705 |
-
}
|
706 |
-
.whatsapp-share-icon {
|
707 |
-
width: 50px;
|
708 |
-
height: 20px;
|
709 |
-
display: inline-block;
|
710 |
-
background: #5cbe4a;
|
711 |
-
padding: 4px 0px;
|
712 |
-
position: relative;
|
713 |
-
top: -4px;
|
714 |
-
}
|
715 |
-
.amp-wp-author:before{
|
716 |
-
}
|
717 |
-
.amp-wp-tax-category span:first-child:after {
|
718 |
-
content: ' ';
|
719 |
-
}
|
720 |
-
.amp-wp-tax-category span:after,
|
721 |
-
.amp-wp-tax-tag span:after {
|
722 |
-
content: ', ';
|
723 |
-
}
|
724 |
-
.amp-wp-tax-category span:last-child:after,
|
725 |
-
.amp-wp-tax-tag span:last-child:after {
|
726 |
-
content: ' ';
|
727 |
-
}
|
728 |
-
pre {
|
729 |
-
white-space: pre-wrap;
|
730 |
-
}
|
731 |
-
<?php if($redux_builder_amp['enable-single-social-icons']){ ?>
|
732 |
-
.amp-wp-footer {
|
733 |
-
padding-bottom: 60px;
|
734 |
-
}
|
735 |
-
<?php } ?>
|
736 |
-
.amp-ad-wrapper.amp_ad_1 {
|
737 |
-
padding-top : 20px;
|
738 |
-
}
|
739 |
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
747 |
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
753 |
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
760 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
761 |
<?php
|
762 |
-
// Table press support
|
763 |
if ( class_exists('TablePress') ) { ?>
|
764 |
-
|
765 |
-
/* Table description */
|
766 |
-
.tablepress-table-description {
|
767 |
-
clear: both;
|
768 |
-
display: block;
|
769 |
-
}
|
770 |
-
|
771 |
-
.tablepress {
|
772 |
-
border-collapse: collapse;
|
773 |
-
border-spacing: 0;
|
774 |
-
width: 100%;
|
775 |
-
margin-bottom: 1em;
|
776 |
-
border: none;
|
777 |
-
}
|
778 |
-
|
779 |
-
.tablepress th,
|
780 |
-
.tablepress td {
|
781 |
-
padding: 8px;
|
782 |
-
border: none;
|
783 |
-
background: none;
|
784 |
-
text-align: left;
|
785 |
-
}
|
786 |
-
.tablepress tbody td {
|
787 |
-
vertical-align: top;
|
788 |
-
}
|
789 |
-
|
790 |
-
/* Horizontal borders */
|
791 |
-
.tablepress tbody td,
|
792 |
-
.tablepress tfoot th {
|
793 |
-
border-top: 1px solid #dddddd;
|
794 |
-
}
|
795 |
-
.tablepress tbody tr:first-child td {
|
796 |
-
border-top: 0;
|
797 |
-
}
|
798 |
-
.tablepress thead th {
|
799 |
-
border-bottom: 1px solid #dddddd;
|
800 |
-
}
|
801 |
-
|
802 |
-
/* Row background colors */
|
803 |
-
.tablepress thead th,
|
804 |
-
.tablepress tfoot th {
|
805 |
-
background-color: #d9edf7;
|
806 |
-
font-weight: bold;
|
807 |
-
vertical-align: middle;
|
808 |
-
}
|
809 |
-
.tablepress .odd td {
|
810 |
-
background-color: #f9f9f9;
|
811 |
-
}
|
812 |
-
.tablepress .even td {
|
813 |
-
background-color: #ffffff;
|
814 |
-
}
|
815 |
-
.tablepress .row-hover tr:hover td {
|
816 |
-
background-color: #f3f3f3;
|
817 |
-
}
|
818 |
-
|
819 |
-
@media (min-width: 768px) and (max-width: 1600px) {
|
820 |
-
.tablepress{
|
821 |
-
overflow-x: none;
|
822 |
-
}
|
823 |
-
}
|
824 |
-
@media (min-width: 320px) and (max-width: 767px) {
|
825 |
-
.tablepress{
|
826 |
-
display: inline-block;
|
827 |
-
overflow-x: scroll;
|
828 |
-
}
|
829 |
-
}
|
830 |
-
|
831 |
<?php } ?>
|
832 |
-
|
833 |
-
/* Custom Style Code */
|
834 |
-
<?php echo $redux_builder_amp['css_editor'];
|
835 |
-
} ?>
|
1 |
+
<?php add_action('amp_post_template_css', 'ampforwp_additional_style_input');
|
|
|
|
|
2 |
function ampforwp_additional_style_input( $amp_template ) {
|
3 |
global $redux_builder_amp;
|
4 |
$get_customizer = new AMP_Post_Template( $post_id );
|
|
|
|
|
5 |
$content_max_width = absint( $get_customizer->get( 'content_max_width' ) );
|
|
|
|
|
6 |
$theme_color = $get_customizer->get_customizer_setting( 'theme_color' );
|
7 |
$text_color = $get_customizer->get_customizer_setting( 'text_color' );
|
8 |
$muted_text_color = $get_customizer->get_customizer_setting( 'muted_text_color' );
|
11 |
$header_background_color = $get_customizer->get_customizer_setting( 'header_background_color' );
|
12 |
$header_color = $get_customizer->get_customizer_setting( 'header_color' );
|
13 |
?>
|
14 |
+
.alignright {float: right;} .alignleft {float: left;} .aligncenter {display: block;margin-left: auto;margin-right: auto;}
|
15 |
+
.amp-wp-enforced-sizes {max-width: 100%;margin: 0 auto;}
|
16 |
+
.amp-wp-unknown-size img {object-fit: contain;} amp-iframe { max-width: 100%; margin-bottom : 20px; }
|
17 |
+
.amp-wp-content,.amp-wp-title-bar div {<?php if ( $content_max_width > 0 ) : ?> margin: 0 auto;max-width: <?php echo sprintf( '%dpx', $content_max_width ); ?>; <?php endif; ?> }
|
18 |
+
html{background: <?php echo sanitize_hex_color( $header_background_color ); ?>;} body{background: <?php echo sanitize_hex_color( $theme_color ); ?>;color: <?php echo sanitize_hex_color( $text_color ); ?>;font-family: 'Merriweather', 'Times New Roman', Times, Serif;font-weight: 300;line-height: 1.75em;}
|
19 |
+
p,ol,ul,figure {margin: 0 0 1em;padding: 0;} a,a:visited {color: <?php echo sanitize_hex_color( $link_color ); ?>;}a:hover,a:active,a:focus {color: <?php echo sanitize_hex_color( $text_color ); ?>;} .wp-caption amp-img{max-width: 100%}
|
20 |
+
blockquote {color: <?php echo sanitize_hex_color( $text_color ); ?>;background: rgba(127,127,127,.125);border-left: 2px solid <?php echo sanitize_hex_color( $link_color ); ?>;margin: 8px 0 24px 0;padding: 16px;} blockquote p:last-child {margin-bottom: 0;}
|
21 |
+
.amp-wp-meta,.amp-wp-header .ampforwp-logo-area,.amp-wp-title,.wp-caption-text,.amp-wp-tax-category,.amp-wp-tax-tag,.amp-wp-comments-link,.amp-wp-footer p,.back-to-top {font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;}
|
22 |
+
.amp-wp-header {background-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;}
|
23 |
+
.amp-wp-header .ampforwp-logo-area {color: <?php echo sanitize_hex_color( $header_color ); ?>;font-size: 1em;font-weight: 400;margin: 0 auto;max-width: calc(840px - 32px);padding: .875em 16px;position: relative;} .amp-wp-header .amp-wp-site-icon {background-color: <?php echo sanitize_hex_color( $header_color ); ?>;border: 1px solid <?php echo sanitize_hex_color( $header_color ); ?>;border-radius: 50%;position: absolute;right: 18px;top: 10px;}
|
24 |
+
.amp-wp-article {color: <?php echo sanitize_hex_color( $text_color ); ?>;font-weight: 400;margin: 1.5em auto;max-width: 840px;overflow-wrap: break-word;word-wrap: break-word;} .amp-wp-article-header {align-items: center;align-content: stretch;display: flex;flex-wrap: wrap;justify-content: space-between;margin: 1.5em 16px 1.5em;}
|
25 |
+
.amp-wp-title {color: <?php echo sanitize_hex_color( $text_color ); ?>;display: block;flex: 1 0 100%;font-weight: 900;margin: 0;width: 100%;}.amp-wp-meta {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;display: inline-block;flex: 2 1 50%;font-size: .875em;line-height: 1.7em;margin: 0;padding: 0;}.ampforwp-meta-info{margin-top: 0px;}.amp-wp-article-header .amp-wp-meta:last-of-type {text-align: right;}.amp-wp-article-header .amp-wp-meta:first-of-type {text-align: left;}.amp-wp-byline amp-img,.amp-wp-byline .amp-wp-author {display: inline-block;vertical-align: middle;}.amp-wp-byline amp-img {border: 1px solid <?php echo sanitize_hex_color( $link_color ); ?>;border-radius: 50%;position: relative;margin-right: 6px;}.amp-wp-posted-on {text-align: right;}
|
26 |
+
.amp-wp-article-featured-image {margin: 1.5em 16px 1.5em;}.amp-wp-article-featured-image amp-img {margin: 0 auto;}.amp-wp-article-featured-image.wp-caption .wp-caption-text {margin: 0 18px;}.amp-wp-frontpage .the_content {padding: 10px;}.amp-wp-frontpage .ampforwp-title {margin-left:10px;}.amp-wp-article a{text-decoration:none}.amp-wp-article-content {margin: 0 16px;}.amp-wp-article-content ul,.amp-wp-article-content ol {margin-left: 1em;}.amp-wp-article-content amp-img {margin: 0 auto;}.amp-wp-article-content amp-img.alignright {margin: 0 0 1em 16px;}.amp-wp-article-content amp-img.alignleft {margin: 0 16px 1em 0;} .amp-disqus-comments {padding: 15px;}.amp-disqus-comments amp-iframe{background: none;}.wp-caption {padding: 0;}.wp-caption.alignleft {margin-right: 16px;}.wp-caption.alignright { margin-left: 16px;}.wp-caption-text {border-bottom: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;margin: 0;padding: .66em 10px .75em;text-align: center;} amp-carousel {background: <?php echo sanitize_hex_color( $border_color ); ?>;margin: 0 -16px 1.5em;} amp-iframe,amp-youtube,amp-instagram,amp-vine {background: <?php echo sanitize_hex_color( $border_color ); ?>;margin: 0 -16px 1.5em; } .amp-wp-article-content amp-carousel amp-img {border: none;} amp-carousel > amp-img > img {object-fit: contain; } .amp-wp-iframe-placeholder { background: <?php echo sanitize_hex_color( $border_color ); ?> url( <?php echo esc_url( $get_customizer->get( 'placeholder_image_url' ) ); ?> ) no-repeat center 40%;background-size: 48px 48px;min-height: 48px;} .amp-wp-article-footer .amp-wp-meta {display: block;} .amp-wp-tax-category span{margin-right:5px;} .amp-wp-tax-category, .amp-wp-tax-tag { color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;margin: 1.5em 16px;}.ampforwp-comment-button {margin-bottom:20px;} .amp-wp-comments-link {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .875em;line-height: 1.5em;text-align: center;margin: 2.25em 0 1.5em;} .amp-wp-comments-link a { border-style: solid;border-color: <?php echo sanitize_hex_color( $border_color ); ?>;border-width: 1px 1px 2px;border-radius: 4px;background-color: transparent;color: <?php echo sanitize_hex_color( $link_color ); ?>;cursor: pointer; display: block;font-size: 14px;font-weight: 600;line-height: 18px;margin: 0 auto;max-width: 200px;padding: 11px 16px;text-decoration: none;width: 50%;-webkit-transition: background-color 0.2s ease;transition: background-color 0.2s ease;} .page-title {margin: 0 15px;} .amp-wp-footer {border-top: 1px solid <?php echo sanitize_hex_color( $border_color ); ?>;margin: calc(1.5em - 1px) 0 0;padding-bottom:25px;}
|
27 |
+
.amp-wp-footer div{margin:0 auto;max-width:calc(840px - 32px);padding:1.25em 16px;position:relative}.amp-wp-footer h2{font-size:1em;line-height:1.375em;margin:0 0 .5em}
|
28 |
+
.amp-wp-footer p {color: <?php echo sanitize_hex_color( $muted_text_color ); ?>;font-size: .8em;line-height: 1.5em;margin: 0 15px 0 0;}
|
29 |
+
.amp-wp-footer a{text-decoration:none}.copyright_txt{float:left}.back-to-top{float:right}.amp-wp-header .nav_container{float: right;top: 16px;line-height: 1; right: 65px; position: absolute}.toggle-text{position:absolute;right:0;height:22px;width:28px}.toggle-text span{display:block;position:absolute;height:2px;width:25px;background:#fff;border-radius:19px;opacity:1;left:0}.toggle-text span:nth-child(2){top:9px}.toggle-text span:nth-child(3){top:18px}.amp-wp-home .amp-wp-meta{margin:5px 0}.amp-wp-home .amp-wp-content p{display:inline-block;width:100%}.ampforwp-custom-index .amp-wp-title a {text-decoration: none;color: <?php echo sanitize_hex_color( $text_color ); ?>;}.comment-button-wrapper a,.related_posts ol{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.amp-wp-meta{display:flex}.amp-wp-posted-on{display:initial}#pagination .next,#pagination .prev{display:inline-block}.ampforwp-custom-index .amp-wp-content{margin-bottom:30px}.pagination-holder{margin:1.5em 16px}#pagination .next{float:right}.amp-wp-home .amp-wp-content p{display:inline}.home-post-image{float:right;margin:0 0 10px 20px}.amp-wp-article-content amp-img{max-width:100%}.amp-wp-meta.amp-wp-tax-category,.amp-wp-meta.amp-wp-tax-tag{margin:0}.amp-wp-meta.amp-wp-tax-tag{display:initial}.ampforwp-social-icons{margin:1.5em 16px}.whatsapp-share-icon{width:50px;height:20px;display:inline-block;background:#5cbe4a;padding:4px 0;position:relative;top:-4px;text-align:center}.comment-button-wrapper a{border-style:solid;border-color:#c2c2c2;border-width:1px 1px 2px;border-radius:4px;background-color:transparent;color:#0a89c0;cursor:pointer;display:block;font-size:14px;font-weight:600;text-align:center;line-height:18px;margin:0 auto;max-width:200px;padding:11px 16px;text-decoration:none;width:50%;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.close-nav,.comments_list div,.related_posts ol li,.toggle-navigation ul,.toggle-navigationv2 ul li a{display:inline-block}main .amp-wp-content.comments_list,main .amp-wp-content.relatedpost{background:0 0;box-shadow:none;max-width:1030px}.relatedpost{margin:2em 16px}.comments_list h3,.related_posts h3{font-size:14px;font-weight:700;letter-spacing:.4px;margin:25px 0 10px;color:#333}.related_posts ol{list-style-type:none;margin:0;padding:0}.related_posts ol li{width:100%;margin-bottom:12px;padding:0}.related_posts .related_link a{color:#000;font-size:18px}.related_posts ol li amp-img{width:100px;float:left;margin-right:15px}.related_posts ol li p{font-size:12px;color:#999;line-height:1.2;margin:12px 0 0}.no_related_thumbnail{padding:15px 18px}.comments_list{margin:2.5em 16px}.comments_list ul{margin:0;padding:0}.comments_list ul.children{padding-bottom:10px;margin-left:4%;width:96%}.comments_list ul li p{margin:0;font-size:14px;clear:both;padding-top:5px}.comments_list ul li{font-family:sans-serif;font-size:11px;list-style-type:none;margin-bottom:12px;background:#fefefe;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-moz-box-shadow:0 2px 3px rgba(0,0,0,.05);-webkit-box-shadow:0 2px 3px rgba(0,0,0,.05);box-shadow:0 2px 3px rgba(0,0,0,.05);padding:0;max-width:1000px;width:96%}.comments_list ul li .says{margin-right:4px}.comments_list li li,.comments_list li li li{margin:20px 20px 10px}.comments_list ul li p{font-family:Merriweather,'Times New Roman',Times,Serif}.comments_list ul li .comment-body{padding:10px 0 15px}.comment-author{float:left}.single-post footer.comment-meta{padding-bottom:0}.comments_list li li{background:#f7f7f7;box-shadow:none;border:1px solid #eee}amp-sidebar{width:250px}.amp-sidebar-image{line-height:100px;vertical-align:middle}.amp-close-image{top:15px;left:225px;cursor:pointer}.toggle-navigationv2 ul{list-style-type:none;margin:0;font-family:sans-serif;padding:0}.toggle-navigationv2 ul ul li a{padding-left:35px;background:#fff;display:inline-block}.toggle-navigationv2 ul li a{padding:10px 15px 10px 25px;width:88%;text-decoration:none;background:#fafafa;font-size:13px;border-bottom:1px solid #efefef}.close-nav{font-size:12px;font-family:sans-serif;background:rgba(0,0,0,.25);letter-spacing:1px;padding:10px;border-radius:100px;line-height:8px;margin:14px;left:191px;color:#fff}.close-nav:hover{background:rgba(0,0,0,.45)}.toggle-navigation ul{list-style-type:none;margin:0;padding:0;width:100%}.menu-all-pages-container:after{content:"";clear:both}.toggle-navigation ul li{font-size:13px;border-bottom:1px solid rgba(0,0,0,.11);padding:11px 0;width:25%;float:left;text-align:center;margin-top:6px}.toggle-navigation ul ul{display:none}.toggle-navigation ul li a{color:#eee;padding:15px}.toggle-navigation{display:none;background:#444}.nav_container:hover+.toggle-navigation,.toggle-navigation:active,.toggle-navigation:focus,.toggle-navigation:hover{display:inline-block;width:100%}#amp-user-notification1 p{display:inline-block}amp-user-notification{padding:5px;text-align:center;background:#fff;border-top:1px solid} amp-user-notification button {padding: 8px 10px;background: <?php echo sanitize_hex_color( $header_background_color ); ?>;color: <?php echo sanitize_hex_color( $header_color ); ?>;margin-left: 5px;border: 0;}amp-user-notification button:hover {cursor: pointer} .amp-ad-wrapper {text-align: center} <?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_single() ) { ?>body {padding-bottom: 43px;}<?php } ?> .sticky_social{width:100%;bottom:0;display:block;left:0;box-shadow:0 4px 7px #000;background:#fff;padding:7px 0 0;position:fixed;margin:0;z-index:10;text-align:center}.whatsapp-share-icon{width:50px;height:20px;display:inline-block;background:#5cbe4a;padding:4px 0;position:relative;top:-4px}.amp-wp-tax-category span:first-child:after{content:' '}.amp-wp-tax-category span:after,.amp-wp-tax-tag span:after{content:', '}.amp-wp-tax-category span:last-child:after,.amp-wp-tax-tag span:last-child:after{content:' '}pre{white-space:pre-wrap}.amp-ad-wrapper.amp_ad_1{padding-top:20px}
|
30 |
+
.amp-wp-content-loop{width:100%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
+
/* Category 1 */
|
33 |
+
.amp-category-block ul{ list-style-type:none }
|
34 |
+
.amp-category-block-btn{ display: block; text-align: center; font-size: 13px; margin-top: 15px; border-bottom: 1px solid #f1f1f1; text-decoration: none; }
|
35 |
+
.design_1_wrapper .amp-category-block, .category-widget-wrapper{ max-width: 840px; margin: 1.5em auto; }
|
36 |
+
.category-widget-gutter{ margin:1.5em 26px 3.5em }
|
37 |
+
.category-widget-gutter h4{ margin-bottom: 0px;}
|
38 |
+
.category-widget-gutter ul{ margin-top: 10px; list-style-type:none; padding:0 }
|
39 |
+
.amp-category-block-title{ border-bottom: double #ddd; margin-bottom: 12px; padding-bottom: 1px; text-align: center; font-size: 12px; text-transform: uppercase; color: #666; }
|
40 |
+
.amp-category-block ul{ margin: 1.5em 26px 3.5em; }
|
41 |
+
.amp-category-post{ width: 32%; display:inline-table; }
|
42 |
+
.amp-category-post a{ color:#555; text-decoration:none}
|
43 |
+
.amp-category-post amp-img{ margin-bottom:5px; }
|
44 |
+
.amp-category-block li:nth-child(3){ margin: 0 1%; }
|
45 |
+
@media screen and (max-width: 530px) {
|
46 |
+
.amp-category-post {line-height: 1.45;font-size: 14px; }
|
47 |
+
.amp-category-block li:nth-child(3) {margin:0 0.6%}
|
48 |
+
}
|
49 |
+
@media screen and (max-width: 375px) {
|
50 |
+
.amp-category-post {line-height: 1.45;font-size: 12px; }
|
51 |
+
.amp-category-block li:nth-child(3) {margin:0%}
|
52 |
+
}
|
53 |
+
.searchmenu{
|
54 |
+
margin-right: 15px;
|
55 |
+
margin-top: 10px;
|
56 |
+
position: absolute;
|
57 |
+
top: 0;
|
58 |
+
right: 91px;
|
59 |
+
}
|
60 |
+
.searchmenu button{
|
61 |
+
background:transparent;
|
62 |
+
border:none
|
63 |
+
}
|
64 |
|
65 |
+
.closebutton{
|
66 |
+
background: transparent;
|
67 |
+
border: 0;
|
68 |
+
color: rgba(255, 255, 255, 0.7);
|
69 |
+
border: 1px solid rgba(255, 255, 255, 0.7);
|
70 |
+
border-radius: 30px;
|
71 |
+
width: 32px;
|
72 |
+
height: 32px;
|
73 |
+
font-size: 12px;
|
74 |
+
text-align: center;
|
75 |
+
position: absolute;
|
76 |
+
top: 12px;
|
77 |
+
right: 20px;
|
78 |
+
outline:none
|
79 |
+
}
|
80 |
+
amp-lightbox{
|
81 |
+
background: rgba(0, 0, 0,0.85);
|
82 |
+
}
|
83 |
+
/* Tables */
|
84 |
+
table a:link { color: #666; font-weight: bold; text-decoration: none; }
|
85 |
+
table a:visited { color: #999999; font-weight: bold; text-decoration: none; }
|
86 |
+
table a:active,
|
87 |
+
table a:hover { color: #bd5a35; text-decoration: underline; }
|
88 |
+
table { font-family: Arial, Helvetica, sans-serif; color: #666; font-size: 12px; text-shadow: 1px 1px 0px #fff; background: #eee; margin: 20px; width: 95%; }
|
89 |
+
table th { padding: 21px 25px 22px 25px; border-top: 1px solid #fafafa; border-bottom: 1px solid #e0e0e0; background: #ededed; background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#ebebeb)); background: -moz-linear-gradient(top, #ededed, #ebebeb); }
|
90 |
+
table th:first-child { text-align: left; padding-left: 20px; }
|
91 |
+
table tr:first-child th:first-child { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; }
|
92 |
+
table tr:first-child th:last-child { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
|
93 |
+
table tr { text-align: center; padding-left: 20px; }
|
94 |
+
table td:first-child { text-align: left; padding-left: 20px; border-left: 0; }
|
95 |
+
table td { padding: 18px; border-top: 1px solid #ffffff; border-bottom: 1px solid #e0e0e0; border-left: 1px solid #e0e0e0; background: #fafafa; background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa)); background: -moz-linear-gradient(top, #fbfbfb, #fafafa); }
|
96 |
+
table tr.even td { background: #f6f6f6; background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f6f6f6)); background: -moz-linear-gradient(top, #f8f8f8, #f6f6f6); }
|
97 |
+
table tr:last-child td {border-bottom: 0;}
|
98 |
+
table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
|
99 |
+
table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
|
100 |
+
table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
|
101 |
|
102 |
+
/* CSS3 icon */
|
103 |
+
[class*=icono-]:after, [class*=icono-]:before {
|
104 |
+
content: '';
|
105 |
+
pointer-events: none;
|
106 |
+
}
|
107 |
+
.icono-search:before{
|
108 |
+
position: absolute;
|
109 |
+
left: 50%;
|
110 |
+
-webkit-transform: rotate(270deg);
|
111 |
+
-ms-transform: rotate(270deg);
|
112 |
+
transform: rotate(270deg);
|
113 |
+
width: 2px;
|
114 |
+
height: 9px;
|
115 |
+
box-shadow: inset 0 0 0 32px;
|
116 |
+
top: 0px;
|
117 |
+
border-radius: 0 0 1px 1px;
|
118 |
+
left: 14px;
|
119 |
+
}
|
120 |
+
[class*=icono-] {
|
121 |
+
display: inline-block;
|
122 |
+
vertical-align: middle;
|
123 |
+
position: relative;
|
124 |
+
font-style: normal;
|
125 |
+
color: #f42;
|
126 |
+
text-align: left;
|
127 |
+
text-indent: -9999px;
|
128 |
+
direction: ltr
|
129 |
+
}
|
130 |
+
.icono-search {
|
131 |
+
-webkit-transform: translateX(-50%);
|
132 |
+
-ms-transform: translateX(-50%);
|
133 |
+
transform: translateX(-50%)
|
134 |
+
}
|
135 |
+
.icono-search {
|
136 |
+
border: 1px solid;
|
137 |
+
width: 10px;
|
138 |
+
height: 10px;
|
139 |
+
border-radius: 50%;
|
140 |
+
-webkit-transform: rotate(45deg);
|
141 |
+
-ms-transform: rotate(45deg);
|
142 |
+
transform: rotate(45deg);
|
143 |
+
margin: 4px 4px 8px 8px;
|
144 |
+
}
|
145 |
+
.searchform label{
|
146 |
+
color: #f7f7f7;
|
147 |
+
display: block;
|
148 |
+
font-size: 10px;
|
149 |
+
line-height: 0;
|
150 |
+
opacity:0.6
|
151 |
+
}
|
152 |
+
.searchform{
|
153 |
+
background: transparent;
|
154 |
+
left: 20%;
|
155 |
+
position: absolute;
|
156 |
+
top: 35%;
|
157 |
+
width: 60%;
|
158 |
+
max-width: 100%;
|
159 |
+
transition-delay: 0.5s;
|
160 |
+
}
|
161 |
+
.searchform input{
|
162 |
+
background: transparent;
|
163 |
+
border: 1px solid #666;
|
164 |
+
color: #f7f7f7;
|
165 |
+
font-size: 14px;
|
166 |
+
font-weight: 400;
|
167 |
+
line-height: 1;
|
168 |
+
letter-spacing: 0.3px;
|
169 |
+
text-transform: capitalize;
|
170 |
+
padding: 20px 0px 20px 30px;
|
171 |
+
margin-top: 15px;
|
172 |
+
width: 100%;
|
173 |
+
}
|
174 |
+
#searchsubmit{opacity:0}
|
175 |
+
.hide{display:none}
|
176 |
+
.amp-wp-header .ampforwp-search-nav-wrapper {
|
177 |
+
padding: 0;
|
178 |
+
}
|
179 |
|
180 |
+
.ampforwp-search-nav-wrapper .searchmenu {
|
181 |
+
margin-top: 20px;
|
182 |
+
}
|
183 |
+
.headerlogo a, [class*=icono-]{
|
184 |
+
top:0;
|
185 |
+
}
|
186 |
+
.amp-wp-header a, .headerlogo a, [class*=icono-] {color: <?php echo sanitize_hex_color( $header_color ); ?>;text-decoration: none;}
|
187 |
+
<?php if($redux_builder_amp['enable-single-social-icons'] && is_socialshare_or_socialsticky_enabled_in_ampforwp() ){ ?> .amp-wp-footer{padding-bottom: 60px;}<?php } ?>
|
188 |
+
<?php if( is_rtl() ) { ?>
|
189 |
+
.amp-wp-header .amp-wp-site-icon,.amp-wp-header .nav_container{float:left;right:initial;left:-11px}.amp-wp-header .amp-wp-site-icon{position:relative;top:-3px}
|
190 |
+
<?php } ?>
|
191 |
<?php
|
|
|
192 |
if ( class_exists('TablePress') ) { ?>
|
193 |
+
.tablepress-table-description{clear:both;display:block}.tablepress{border-collapse:collapse;border-spacing:0;width:100%;margin-bottom:1em;border:none}.tablepress td,.tablepress th{padding:8px;border:none;background:0 0;text-align:left}.tablepress tbody td{vertical-align:top}.tablepress tbody td,.tablepress tfoot th{border-top:1px solid #ddd}.tablepress tbody tr:first-child td{border-top:0}.tablepress thead th{border-bottom:1px solid #ddd}.tablepress tfoot th,.tablepress thead th{background-color:#d9edf7;font-weight:700;vertical-align:middle}.tablepress .odd td{background-color:#f9f9f9}.tablepress .even td{background-color:#fff}.tablepress .row-hover tr:hover td{background-color:#f3f3f3}@media (min-width:768px) and (max-width:1600px){.tablepress{overflow-x:none}}@media (min-width:320px) and (max-width:767px){.tablepress{display:inline-block;overflow-x:scroll}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
<?php } ?>
|
195 |
+
<?php echo $redux_builder_amp['css_editor']; } ?>
|
|
|
|
|
|
@@ -10,7 +10,7 @@
|
|
10 |
global $wp;
|
11 |
$current_archive_url = home_url( $wp->request );
|
12 |
$amp_url = trailingslashit($current_archive_url);
|
13 |
-
$remove = '/'.
|
14 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
15 |
} ?>
|
16 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
@@ -22,12 +22,13 @@
|
|
22 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
23 |
</style>
|
24 |
</head>
|
25 |
-
<body class="amp_home_body">
|
26 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
27 |
|
28 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
29 |
|
30 |
<main>
|
|
|
31 |
|
32 |
<?php if ( is_archive() ) { ?>
|
33 |
<div class="amp-wp-content amp-archive-heading">
|
@@ -39,7 +40,7 @@
|
|
39 |
} ?>
|
40 |
|
41 |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
|
42 |
-
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) .
|
43 |
|
44 |
<div class="amp-wp-content amp-loop-list">
|
45 |
<?php if ( has_post_thumbnail() ) { ?>
|
@@ -48,7 +49,20 @@
|
|
48 |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
|
49 |
$thumb_url = $thumb_url_array[0];
|
50 |
?>
|
51 |
-
<div class="home-post_image"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
<?php } ?>
|
53 |
|
54 |
<div class="amp-wp-post-content">
|
@@ -81,6 +95,7 @@
|
|
81 |
</div>
|
82 |
|
83 |
<?php endif; ?>
|
|
|
84 |
</main>
|
85 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
86 |
<?php do_action( 'amp_post_template_footer', $this ); ?>
|
10 |
global $wp;
|
11 |
$current_archive_url = home_url( $wp->request );
|
12 |
$amp_url = trailingslashit($current_archive_url);
|
13 |
+
$remove = '/'. AMPFORWP_AMP_QUERY_VAR;
|
14 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
15 |
} ?>
|
16 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
22 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
23 |
</style>
|
24 |
</head>
|
25 |
+
<body class="amp_home_body design_2_wrapper">
|
26 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
27 |
|
28 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
29 |
|
30 |
<main>
|
31 |
+
<?php do_action('ampforwp_post_before_loop') ?>
|
32 |
|
33 |
<?php if ( is_archive() ) { ?>
|
34 |
<div class="amp-wp-content amp-archive-heading">
|
40 |
} ?>
|
41 |
|
42 |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
|
43 |
+
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
|
44 |
|
45 |
<div class="amp-wp-content amp-loop-list">
|
46 |
<?php if ( has_post_thumbnail() ) { ?>
|
49 |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
|
50 |
$thumb_url = $thumb_url_array[0];
|
51 |
?>
|
52 |
+
<div class="home-post_image">
|
53 |
+
<a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
|
54 |
+
<amp-img
|
55 |
+
src=<?php echo $thumb_url ?>
|
56 |
+
<?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
|
57 |
+
width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
|
58 |
+
height=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-height'] ?>
|
59 |
+
<?php } else { ?>
|
60 |
+
width=100
|
61 |
+
height=75
|
62 |
+
<?php } ?>
|
63 |
+
></amp-img>
|
64 |
+
</a>
|
65 |
+
</div>
|
66 |
<?php } ?>
|
67 |
|
68 |
<div class="amp-wp-post-content">
|
95 |
</div>
|
96 |
|
97 |
<?php endif; ?>
|
98 |
+
<?php do_action('ampforwp_post_after_loop') ?>
|
99 |
</main>
|
100 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
101 |
<?php do_action( 'amp_post_template_footer', $this ); ?>
|
@@ -71,7 +71,7 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
71 |
</ul>
|
72 |
</div>
|
73 |
<div class="comment-button-wrapper">
|
74 |
-
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
75 |
</div><?php
|
76 |
} else {
|
77 |
global $redux_builder_amp ;
|
@@ -79,7 +79,7 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
79 |
return;
|
80 |
} ?>
|
81 |
<div class="comment-button-wrapper">
|
82 |
-
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
83 |
</div>
|
84 |
<?php } ?>
|
85 |
</div>
|
71 |
</ul>
|
72 |
</div>
|
73 |
<div class="comment-button-wrapper">
|
74 |
+
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
75 |
</div><?php
|
76 |
} else {
|
77 |
global $redux_builder_amp ;
|
79 |
return;
|
80 |
} ?>
|
81 |
<div class="comment-button-wrapper">
|
82 |
+
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
83 |
</div>
|
84 |
<?php } ?>
|
85 |
</div>
|
@@ -37,7 +37,7 @@
|
|
37 |
if (!empty( $next_post )) {
|
38 |
$next_text = $next_post->post_title;
|
39 |
?>
|
40 |
-
<a href="<?php echo trailingslashit(get_permalink( $next_post->ID )) .
|
41 |
} ?>
|
42 |
</div>
|
43 |
<!--Next Link code-->
|
@@ -48,7 +48,7 @@
|
|
48 |
if (!empty( $prev_post )) {
|
49 |
$prev_text = $prev_post->post_title;
|
50 |
?>
|
51 |
-
<a href="<?php echo trailingslashit(get_permalink( $prev_post->ID )).
|
52 |
} ?>
|
53 |
</div>
|
54 |
<!--Prev Link code-->
|
37 |
if (!empty( $next_post )) {
|
38 |
$next_text = $next_post->post_title;
|
39 |
?>
|
40 |
+
<a href="<?php echo trailingslashit(get_permalink( $next_post->ID )) . AMPFORWP_AMP_QUERY_VAR; ?>"><?php echo apply_filters('ampforwp_next_link',$next_text ); ?> »</a> <?php
|
41 |
} ?>
|
42 |
</div>
|
43 |
<!--Next Link code-->
|
48 |
if (!empty( $prev_post )) {
|
49 |
$prev_text = $prev_post->post_title;
|
50 |
?>
|
51 |
+
<a href="<?php echo trailingslashit(get_permalink( $prev_post->ID )). AMPFORWP_AMP_QUERY_VAR; ?>"> « <?php echo apply_filters('ampforwp_prev_link',$prev_text ); ?></a> <?php
|
52 |
} ?>
|
53 |
</div>
|
54 |
<!--Prev Link code-->
|
@@ -47,7 +47,7 @@
|
|
47 |
$my_query->the_post();
|
48 |
$related_post_permalink = get_permalink();
|
49 |
$related_post_permalink = trailingslashit($related_post_permalink);
|
50 |
-
$related_post_permalink = $related_post_permalink .
|
51 |
?>
|
52 |
<li class="<?php if ( has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
53 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
47 |
$my_query->the_post();
|
48 |
$related_post_permalink = get_permalink();
|
49 |
$related_post_permalink = trailingslashit($related_post_permalink);
|
50 |
+
$related_post_permalink = $related_post_permalink . AMPFORWP_AMP_QUERY_VAR ;;
|
51 |
?>
|
52 |
<li class="<?php if ( has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
53 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
@@ -4,5 +4,5 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
4 |
return;
|
5 |
} ?>
|
6 |
<div class="comment-button-wrapper ampforwp-comment-button">
|
7 |
-
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
8 |
</div>
|
4 |
return;
|
5 |
} ?>
|
6 |
<div class="comment-button-wrapper ampforwp-comment-button">
|
7 |
+
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
8 |
</div>
|
@@ -24,7 +24,7 @@
|
|
24 |
<p><a href="#header"> <?php echo esc_html( $redux_builder_amp['amp-translator-top-text'] ); ?></a> <?php
|
25 |
//24. Added an options button for switching on/off link to non amp page
|
26 |
if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') {
|
27 |
-
if ( $ampforwp_backto_nonamp ) { ?> | <a href="<?php echo $ampforwp_backto_nonamp; ?>"><?php echo esc_html( $redux_builder_amp['amp-translator-non-amp-page-text'] ) ;?> </a> <?php }
|
28 |
} ?>
|
29 |
</p>
|
30 |
<p>
|
24 |
<p><a href="#header"> <?php echo esc_html( $redux_builder_amp['amp-translator-top-text'] ); ?></a> <?php
|
25 |
//24. Added an options button for switching on/off link to non amp page
|
26 |
if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') {
|
27 |
+
if ( $ampforwp_backto_nonamp ) { ?> | <a href="<?php echo $ampforwp_backto_nonamp; ?>" rel="nofollow"><?php echo esc_html( $redux_builder_amp['amp-translator-non-amp-page-text'] ) ;?> </a> <?php }
|
28 |
} ?>
|
29 |
</p>
|
30 |
<p>
|
@@ -10,7 +10,7 @@ $template = new AMP_Post_Template( $post_id );?>
|
|
10 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
11 |
<?php
|
12 |
$amp_custom_content_enable = get_post_meta($template->data['post_id'], 'ampforwp_custom_content_editor_checkbox', true);
|
13 |
-
if ( $amp_custom_content_enable ) {
|
14 |
$amp_component_scripts = $template->data['amp_component_scripts'];
|
15 |
foreach ($amp_component_scripts as $ampforwp_service => $ampforwp_js_file) { ?>
|
16 |
<script custom-element="<?php echo $ampforwp_service; ?>" src="<?php echo $ampforwp_js_file; ?>" async></script> <?php
|
@@ -21,7 +21,7 @@ $template = new AMP_Post_Template( $post_id );?>
|
|
21 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
22 |
</style>
|
23 |
</head>
|
24 |
-
<body class="single-post">
|
25 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
26 |
|
27 |
<?php global $redux_builder_amp; if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { ?>
|
10 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
11 |
<?php
|
12 |
$amp_custom_content_enable = get_post_meta($template->data['post_id'], 'ampforwp_custom_content_editor_checkbox', true);
|
13 |
+
if ( ! $amp_custom_content_enable ) {
|
14 |
$amp_component_scripts = $template->data['amp_component_scripts'];
|
15 |
foreach ($amp_component_scripts as $ampforwp_service => $ampforwp_js_file) { ?>
|
16 |
<script custom-element="<?php echo $ampforwp_service; ?>" src="<?php echo $ampforwp_js_file; ?>" async></script> <?php
|
21 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
22 |
</style>
|
23 |
</head>
|
24 |
+
<body class="single-post design_2_wrapper">
|
25 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
26 |
|
27 |
<?php global $redux_builder_amp; if( $redux_builder_amp['ampforwp-title-on-front-page'] ) { ?>
|
@@ -3,19 +3,22 @@
|
|
3 |
<div id="header">
|
4 |
|
5 |
<?php global $redux_builder_amp;
|
6 |
-
|
7 |
if ($redux_builder_amp['amp-on-off-support-for-non-amp-home-page']) {
|
8 |
$ampforwp_home_url = untrailingslashit( get_bloginfo('url') ).'?nonamp=1';
|
|
|
9 |
}else{ global $redux_builder_amp; if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
|
10 |
-
$ampforwp_home_url = trailingslashit( get_bloginfo('url') ) .
|
11 |
} else {
|
12 |
$ampforwp_home_url = trailingslashit( get_bloginfo('url') ) .'?nonamp=1';
|
|
|
13 |
}
|
14 |
}
|
15 |
?>
|
16 |
|
17 |
-
<?php
|
18 |
-
|
|
|
19 |
|
20 |
<?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
|
21 |
|
@@ -29,8 +32,9 @@
|
|
29 |
|
30 |
</a>
|
31 |
<?php } else { ?>
|
32 |
-
<h3><a href="<?php echo esc_url( $ampforwp_home_url ); ?>"><?php bloginfo('name'); ?></a></h3>
|
33 |
<?php } ?>
|
|
|
34 |
|
35 |
</div>
|
36 |
</div>
|
@@ -41,12 +45,12 @@
|
|
41 |
<a href="#" class="toggle-text"><?php echo esc_html( $redux_builder_amp['amp-translator-navigate-text'] ); ?></a>
|
42 |
</div>
|
43 |
|
44 |
-
|
45 |
<amp-sidebar id='sidebar'
|
46 |
layout="nodisplay"
|
47 |
side="right">
|
48 |
<div class="toggle-navigationv2">
|
49 |
<div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div>
|
50 |
<?php wp_nav_menu( array( 'theme_location' => 'amp-menu' ) ); ?>
|
|
|
51 |
</div>
|
52 |
</amp-sidebar>
|
3 |
<div id="header">
|
4 |
|
5 |
<?php global $redux_builder_amp;
|
6 |
+
$set_rel_to_noamp=false;
|
7 |
if ($redux_builder_amp['amp-on-off-support-for-non-amp-home-page']) {
|
8 |
$ampforwp_home_url = untrailingslashit( get_bloginfo('url') ).'?nonamp=1';
|
9 |
+
$set_rel_to_noamp = true;
|
10 |
}else{ global $redux_builder_amp; if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
|
11 |
+
$ampforwp_home_url = trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR;
|
12 |
} else {
|
13 |
$ampforwp_home_url = trailingslashit( get_bloginfo('url') ) .'?nonamp=1';
|
14 |
+
$set_rel_to_noamp = true;
|
15 |
}
|
16 |
}
|
17 |
?>
|
18 |
|
19 |
+
<?php
|
20 |
+
if (! empty( $redux_builder_amp['opt-media']['url'] ) ) { ?>
|
21 |
+
<a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){echo ' rel="nofollow"'; } ?> >
|
22 |
|
23 |
<?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
|
24 |
|
32 |
|
33 |
</a>
|
34 |
<?php } else { ?>
|
35 |
+
<h3><a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){echo ' rel="nofollow"';} ?> ><?php bloginfo('name'); ?></a></h3>
|
36 |
<?php } ?>
|
37 |
+
<?php do_action('ampforwp_header_search'); ?>
|
38 |
|
39 |
</div>
|
40 |
</div>
|
45 |
<a href="#" class="toggle-text"><?php echo esc_html( $redux_builder_amp['amp-translator-navigate-text'] ); ?></a>
|
46 |
</div>
|
47 |
|
|
|
48 |
<amp-sidebar id='sidebar'
|
49 |
layout="nodisplay"
|
50 |
side="right">
|
51 |
<div class="toggle-navigationv2">
|
52 |
<div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div>
|
53 |
<?php wp_nav_menu( array( 'theme_location' => 'amp-menu' ) ); ?>
|
54 |
+
|
55 |
</div>
|
56 |
</amp-sidebar>
|
@@ -10,7 +10,7 @@
|
|
10 |
global $wp;
|
11 |
$current_archive_url = home_url( $wp->request );
|
12 |
$amp_url = trailingslashit($current_archive_url);
|
13 |
-
$remove = '/'.
|
14 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
15 |
} ?>
|
16 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
@@ -22,12 +22,12 @@
|
|
22 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
23 |
</style>
|
24 |
</head>
|
25 |
-
<body class="amp_home_body">
|
26 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
27 |
-
|
28 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
29 |
-
|
30 |
<main>
|
|
|
31 |
|
32 |
<?php
|
33 |
if ( get_query_var( 'paged' ) ) {
|
@@ -57,7 +57,7 @@
|
|
57 |
} ?>
|
58 |
|
59 |
<?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
|
60 |
-
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) .
|
61 |
|
62 |
<div class="amp-wp-content amp-loop-list">
|
63 |
<?php if ( has_post_thumbnail() ) { ?>
|
@@ -66,7 +66,19 @@
|
|
66 |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
|
67 |
$thumb_url = $thumb_url_array[0];
|
68 |
?>
|
69 |
-
<div class="home-post_image"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
<?php } ?>
|
71 |
|
72 |
<div class="amp-wp-post-content">
|
@@ -100,9 +112,13 @@
|
|
100 |
|
101 |
<?php endif; ?>
|
102 |
<?php wp_reset_postdata(); ?>
|
|
|
|
|
|
|
103 |
</main>
|
|
|
104 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
105 |
<?php do_action( 'amp_post_template_footer', $this ); ?>
|
106 |
</body>
|
107 |
|
108 |
-
</html>
|
10 |
global $wp;
|
11 |
$current_archive_url = home_url( $wp->request );
|
12 |
$amp_url = trailingslashit($current_archive_url);
|
13 |
+
$remove = '/'. AMPFORWP_AMP_QUERY_VAR;
|
14 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
15 |
} ?>
|
16 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
22 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
23 |
</style>
|
24 |
</head>
|
25 |
+
<body class="amp_home_body design_2_wrapper">
|
26 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
|
|
27 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
28 |
+
<?php do_action('ampforwp_home_above_loop') ?>
|
29 |
<main>
|
30 |
+
<?php do_action('ampforwp_post_before_loop') ?>
|
31 |
|
32 |
<?php
|
33 |
if ( get_query_var( 'paged' ) ) {
|
57 |
} ?>
|
58 |
|
59 |
<?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
|
60 |
+
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
|
61 |
|
62 |
<div class="amp-wp-content amp-loop-list">
|
63 |
<?php if ( has_post_thumbnail() ) { ?>
|
66 |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
|
67 |
$thumb_url = $thumb_url_array[0];
|
68 |
?>
|
69 |
+
<div class="home-post_image">
|
70 |
+
<a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
|
71 |
+
<amp-img src=<?php echo $thumb_url ?>
|
72 |
+
<?php if( $redux_builder_amp['ampforwp-homepage-posts-image-modify-size'] ) { ?>
|
73 |
+
width=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-width'] ?>
|
74 |
+
height=<?php global $redux_builder_amp; echo $redux_builder_amp['ampforwp-homepage-posts-design-1-2-height'] ?>
|
75 |
+
<?php } else { ?>
|
76 |
+
width=100
|
77 |
+
height=75
|
78 |
+
<?php } ?>
|
79 |
+
></amp-img>
|
80 |
+
</a>
|
81 |
+
</div>
|
82 |
<?php } ?>
|
83 |
|
84 |
<div class="amp-wp-post-content">
|
112 |
|
113 |
<?php endif; ?>
|
114 |
<?php wp_reset_postdata(); ?>
|
115 |
+
|
116 |
+
<?php do_action('ampforwp_post_after_loop') ?>
|
117 |
+
|
118 |
</main>
|
119 |
+
<?php do_action('ampforwp_home_below_loop') ?>
|
120 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
121 |
<?php do_action( 'amp_post_template_footer', $this ); ?>
|
122 |
</body>
|
123 |
|
124 |
+
</html>
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php global $redux_builder_amp; ?>
|
2 |
+
<!doctype html>
|
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 $paged = get_query_var( 'paged' );
|
8 |
+
$current_search_url =trailingslashit(get_home_url())."?s=".get_search_query();
|
9 |
+
$amp_url = untrailingslashit($current_search_url);
|
10 |
+
if ($paged > 1 ) {
|
11 |
+
global $wp;
|
12 |
+
$current_archive_url = home_url( $wp->request );
|
13 |
+
$amp_url = trailingslashit($current_archive_url);
|
14 |
+
$remove = '/'. AMPFORWP_AMP_QUERY_VAR;
|
15 |
+
$amp_url = str_replace($remove, '', $amp_url) ;
|
16 |
+
$amp_url = $amp_url ."?s=".get_search_query();
|
17 |
+
} ?>
|
18 |
+
<link rel="canonical" href="<?php echo $amp_url ?>">
|
19 |
+
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
|
20 |
+
<?php do_action( 'amp_post_template_head', $this ); ?>
|
21 |
+
<style amp-custom>
|
22 |
+
<?php $this->load_parts( array( 'style' ) ); ?>
|
23 |
+
<?php do_action( 'amp_post_template_css', $this ); ?>
|
24 |
+
</style>
|
25 |
+
</head>
|
26 |
+
<body class="amp_home_body design_2_wrapper">
|
27 |
+
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
28 |
+
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
29 |
+
<main>
|
30 |
+
<?php do_action('ampforwp_post_before_loop') ?>
|
31 |
+
<?php
|
32 |
+
if ( get_query_var( 'paged' ) ) {
|
33 |
+
$paged = get_query_var('paged');
|
34 |
+
} elseif ( get_query_var( 'page' ) ) {
|
35 |
+
$paged = get_query_var('page');
|
36 |
+
} else {
|
37 |
+
$paged = 1;
|
38 |
+
}
|
39 |
+
|
40 |
+
$exclude_ids = get_option('ampforwp_exclude_post');
|
41 |
+
|
42 |
+
$q = new WP_Query( array(
|
43 |
+
's' => get_search_query() ,
|
44 |
+
'ignore_sticky_posts' => 1,
|
45 |
+
'paged' => esc_attr($paged),
|
46 |
+
'post__not_in' => $exclude_ids,
|
47 |
+
'has_password' => false,
|
48 |
+
'post_status' => 'publish'
|
49 |
+
) ); ?>
|
50 |
+
<div class="amp-wp-content amp-archive-heading">
|
51 |
+
<h3 class="page-title"><?php echo $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();?> </h3>
|
52 |
+
</div>
|
53 |
+
<?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
|
54 |
+
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
|
55 |
+
<div class="amp-wp-content amp-loop-list">
|
56 |
+
<?php if ( has_post_thumbnail() ) { ?>
|
57 |
+
<?php
|
58 |
+
$thumb_id = get_post_thumbnail_id();
|
59 |
+
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
|
60 |
+
$thumb_url = $thumb_url_array[0];
|
61 |
+
?>
|
62 |
+
<div class="home-post_image"><a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"><amp-img src=<?php echo $thumb_url ?> width=100 height=75></amp-img></a></div>
|
63 |
+
<?php } ?>
|
64 |
+
<div class="amp-wp-post-content">
|
65 |
+
<h2 class="amp-wp-title"> <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"> <?php the_title(); ?></a></h2>
|
66 |
+
|
67 |
+
<?php if(has_excerpt()){
|
68 |
+
$content = get_the_excerpt();
|
69 |
+
}else{
|
70 |
+
$content = get_the_content();
|
71 |
+
} ?>
|
72 |
+
<p><?php echo wp_trim_words( $content , '15' ); ?></p>
|
73 |
+
|
74 |
+
</div>
|
75 |
+
<div class="cb"></div>
|
76 |
+
</div>
|
77 |
+
<?php endwhile; ?>
|
78 |
+
<div class="amp-wp-content pagination-holder">
|
79 |
+
|
80 |
+
<div id="pagination">
|
81 |
+
<div class="next"><?php next_posts_link( $redux_builder_amp['amp-translator-next-text'] . ' »', 0 ) ?></div>
|
82 |
+
<div class="prev"><?php previous_posts_link( '« '. $redux_builder_amp['amp-translator-previous-text'] ); ?></div>
|
83 |
+
|
84 |
+
<div class="clearfix"></div>
|
85 |
+
</div>
|
86 |
+
</div>
|
87 |
+
<?php else: ?>
|
88 |
+
<div class="amp-wp-content amp-loop-list">
|
89 |
+
<div class="amp-wp-post-content">
|
90 |
+
<?php echo $redux_builder_amp['amp-translator-search-no-found']; ?>
|
91 |
+
</div>
|
92 |
+
<div class="cb"></div>
|
93 |
+
</div>
|
94 |
+
<?php endif; ?>
|
95 |
+
<?php wp_reset_postdata(); ?>
|
96 |
+
<?php do_action('ampforwp_post_after_loop') ?>
|
97 |
+
</main>
|
98 |
+
<?php $this->load_parts( array( 'footer' ) ); ?>
|
99 |
+
<?php do_action( 'amp_post_template_footer', $this ); ?>
|
100 |
+
</body>
|
101 |
+
</html>
|
@@ -11,7 +11,7 @@
|
|
11 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
12 |
</style>
|
13 |
</head>
|
14 |
-
<body class="single-post <?php if(is_page()){ echo'amp-single-page'; };?>">
|
15 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
16 |
|
17 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
11 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
12 |
</style>
|
13 |
</head>
|
14 |
+
<body class="single-post <?php if(is_page()){ echo'amp-single-page'; };?> design_2_wrapper">
|
15 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
16 |
|
17 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
@@ -153,8 +153,127 @@ amp-sidebar {
|
|
153 |
display: inline-block;
|
154 |
width: 100%;
|
155 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
/* Pagination */
|
159 |
.amp-wp-content.pagination-holder {
|
160 |
background: none;
|
@@ -586,6 +705,25 @@ amp-user-notification button:hover {
|
|
586 |
pre {
|
587 |
white-space: pre-wrap;
|
588 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
589 |
/* Responsive */
|
590 |
@media screen and (max-width: 800px) {
|
591 |
.single-post main{
|
@@ -593,27 +731,16 @@ pre {
|
|
593 |
}
|
594 |
}
|
595 |
@media screen and (max-width: 630px) {
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
.
|
600 |
-
margin: 16px 18px 20px 19px;
|
601 |
-
}
|
602 |
}
|
603 |
@media screen and (max-width: 510px) {
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
line-height: 1.6;
|
609 |
-
margin: 7px 0 0 0;
|
610 |
-
}
|
611 |
-
.related_posts .related_link {
|
612 |
-
margin: 17px 18px 17px 19px;
|
613 |
-
}
|
614 |
-
.comments_list ul li .comment-body{
|
615 |
-
width:auto
|
616 |
-
}
|
617 |
}
|
618 |
@media screen and (max-width: 425px) {
|
619 |
.related_posts .related_link p{
|
@@ -667,16 +794,11 @@ pre {
|
|
667 |
}
|
668 |
}
|
669 |
@media screen and (max-width: 340px) {
|
670 |
-
.related_posts .related_link a {
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
}
|
676 |
-
.the_content .amp-ad-wrapper{
|
677 |
-
text-align: center;
|
678 |
-
margin-left: -13px;
|
679 |
-
}
|
680 |
}
|
681 |
@media screen and (max-width: 320px) {
|
682 |
.related_posts .related_link a {
|
@@ -694,25 +816,13 @@ pre {
|
|
694 |
}
|
695 |
}
|
696 |
@media screen and (max-width: 767px) {
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
main{
|
705 |
-
padding: 25px 18px 25px 18px;
|
706 |
-
}
|
707 |
-
.toggle-navigation ul li{
|
708 |
-
width: 50%
|
709 |
-
}
|
710 |
-
}
|
711 |
-
@media screen and (max-width: 495px) {
|
712 |
-
h2.amp-wp-title a{
|
713 |
-
font-size: 17px;
|
714 |
-
line-height: 26px;
|
715 |
-
}
|
716 |
}
|
717 |
<?php if($redux_builder_amp['amp-rtl-select-option'] == true) { ?>
|
718 |
/* RTL Start */
|
@@ -748,7 +858,7 @@ main .amp-loop-list {
|
|
748 |
<?php $color = $redux_builder_amp['opt-color-rgba']['color']; ?>
|
749 |
.amp-wp-tax-tag a,
|
750 |
a,
|
751 |
-
.amp-wp-author {
|
752 |
color: <?php echo sanitize_hex_color( $header_background_color ); ?>;;
|
753 |
}
|
754 |
.amp-wp-content blockquote{
|
@@ -766,9 +876,9 @@ amp-user-notification {
|
|
766 |
amp-user-notification button {
|
767 |
background-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;;
|
768 |
}
|
769 |
-
<?php if( $redux_builder_amp['enable-single-social-icons'] == true ) { ?>
|
770 |
.single-post footer {
|
771 |
-
padding-bottom:
|
772 |
}
|
773 |
.amp-ad-2{ margin-bottom: 50px; }
|
774 |
<?php } ?>
|
153 |
display: inline-block;
|
154 |
width: 100%;
|
155 |
}
|
156 |
+
/* Category 2 */
|
157 |
+
.amp-category-block, .category-widget-wrapper{ padding:30px 15% 10px 15% }
|
158 |
+
.amp-category-block ul{ list-style-type:none;padding:0 }
|
159 |
+
.amp-category-block-btn{ display: block; text-align: center; font-size: 13px; margin-top: 15px; border-bottom: 1px solid #f1f1f1; text-decoration: none; padding-bottom: 8px;}
|
160 |
+
.category-widget-gutter h4{ margin-bottom: 0px;}
|
161 |
+
.category-widget-gutter ul{ margin-top: 10px; list-style-type:none; padding:0 }
|
162 |
+
.amp-category-block-title{ border-bottom: double #ddd; margin-bottom: 12px; padding-bottom: 1px; text-align: center; font-size: 12px; text-transform: uppercase; color: #666; }
|
163 |
+
.amp-category-post{ width: 32%; display:inline-table; }
|
164 |
+
.amp-category-post amp-img{ margin-bottom:5px; }
|
165 |
+
.amp-category-block li:nth-child(3){
|
166 |
+
margin: 0 1%;
|
167 |
+
}
|
168 |
+
.searchmenu{
|
169 |
+
margin-right: 15px;
|
170 |
+
margin-top: 11px;
|
171 |
+
position: absolute;
|
172 |
+
top: 0;
|
173 |
+
right: 0;
|
174 |
+
}
|
175 |
+
.searchmenu button{
|
176 |
+
background:transparent;
|
177 |
+
border:none
|
178 |
+
}
|
179 |
+
|
180 |
+
.closebutton{
|
181 |
+
background: transparent;
|
182 |
+
border: 0;
|
183 |
+
color: rgba(255, 255, 255, 0.7);
|
184 |
+
border: 1px solid rgba(255, 255, 255, 0.7);
|
185 |
+
border-radius: 30px;
|
186 |
+
width: 32px;
|
187 |
+
height: 32px;
|
188 |
+
font-size: 12px;
|
189 |
+
text-align: center;
|
190 |
+
position: absolute;
|
191 |
+
top: 12px;
|
192 |
+
right: 20px;
|
193 |
+
outline:none
|
194 |
+
}
|
195 |
+
amp-lightbox{
|
196 |
+
background: rgba(0, 0, 0,0.85);
|
197 |
+
}
|
198 |
+
/* CSS3 icon */
|
199 |
|
200 |
+
[class*=icono-]:after, [class*=icono-]:before {
|
201 |
+
content: '';
|
202 |
+
pointer-events: none;
|
203 |
+
}
|
204 |
+
.icono-search:before{
|
205 |
+
position: absolute;
|
206 |
+
left: 50%;
|
207 |
+
-webkit-transform: rotate(270deg);
|
208 |
+
-ms-transform: rotate(270deg);
|
209 |
+
transform: rotate(270deg);
|
210 |
+
width: 2px;
|
211 |
+
height: 9px;
|
212 |
+
box-shadow: inset 0 0 0 32px;
|
213 |
+
top: 0px;
|
214 |
+
border-radius: 0 0 1px 1px;
|
215 |
+
left: 14px;
|
216 |
+
}
|
217 |
+
[class*=icono-] {
|
218 |
+
display: inline-block;
|
219 |
+
vertical-align: middle;
|
220 |
+
position: relative;
|
221 |
+
font-style: normal;
|
222 |
+
color: #f42;
|
223 |
+
text-align: left;
|
224 |
+
text-indent: -9999px;
|
225 |
+
direction: ltr
|
226 |
+
}
|
227 |
|
228 |
+
.icono-search {
|
229 |
+
-webkit-transform: translateX(-50%);
|
230 |
+
-ms-transform: translateX(-50%);
|
231 |
+
transform: translateX(-50%)
|
232 |
+
}
|
233 |
+
|
234 |
+
.icono-search {
|
235 |
+
border: 1px solid;
|
236 |
+
width: 10px;
|
237 |
+
height: 10px;
|
238 |
+
border-radius: 50%;
|
239 |
+
-webkit-transform: rotate(45deg);
|
240 |
+
-ms-transform: rotate(45deg);
|
241 |
+
transform: rotate(45deg);
|
242 |
+
margin: 4px 4px 8px 8px;
|
243 |
+
}
|
244 |
+
.searchform label{
|
245 |
+
color: #f7f7f7;
|
246 |
+
display: block;
|
247 |
+
font-size: 10px;
|
248 |
+
letter-spacing: 0.3px;
|
249 |
+
line-height: 0;
|
250 |
+
opacity:0.6
|
251 |
+
}
|
252 |
+
.searchform{
|
253 |
+
background: transparent;
|
254 |
+
left: 20%;
|
255 |
+
position: absolute;
|
256 |
+
top: 35%;
|
257 |
+
width: 60%;
|
258 |
+
max-width: 100%;
|
259 |
+
transition-delay: 0.5s;
|
260 |
+
}
|
261 |
+
.searchform input{
|
262 |
+
background: transparent;
|
263 |
+
border: 1px solid #666;
|
264 |
+
color: #f7f7f7;
|
265 |
+
font-size: 14px;
|
266 |
+
font-weight: 400;
|
267 |
+
line-height: 1;
|
268 |
+
letter-spacing: 0.3px;
|
269 |
+
text-transform: capitalize;
|
270 |
+
padding: 20px 0px 20px 30px;
|
271 |
+
margin-top: 15px;
|
272 |
+
width: 100%;
|
273 |
+
}
|
274 |
+
#searchsubmit{opacity:0}
|
275 |
+
.hide{display:none}
|
276 |
+
.headerlogo a, [class*=icono-]{ color: #F42F42 }
|
277 |
/* Pagination */
|
278 |
.amp-wp-content.pagination-holder {
|
279 |
background: none;
|
705 |
pre {
|
706 |
white-space: pre-wrap;
|
707 |
}
|
708 |
+
/* Tables */
|
709 |
+
table a:link { color: #666; font-weight: bold; text-decoration: none; }
|
710 |
+
table a:visited { color: #999999; font-weight: bold; text-decoration: none; }
|
711 |
+
table a:active,
|
712 |
+
table a:hover { color: #bd5a35; text-decoration: underline; }
|
713 |
+
table { font-family: Arial, Helvetica, sans-serif; color: #666; font-size: 12px; text-shadow: 1px 1px 0px #fff; background: #eee; margin: 20px; width: 95%; }
|
714 |
+
table th { padding: 21px 25px 22px 25px; border-top: 1px solid #fafafa; border-bottom: 1px solid #e0e0e0; background: #ededed; background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#ebebeb)); background: -moz-linear-gradient(top, #ededed, #ebebeb); }
|
715 |
+
table th:first-child { text-align: left; padding-left: 20px; }
|
716 |
+
table tr:first-child th:first-child { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; }
|
717 |
+
table tr:first-child th:last-child { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
|
718 |
+
table tr { text-align: center; padding-left: 20px; }
|
719 |
+
table td:first-child { text-align: left; padding-left: 20px; border-left: 0; }
|
720 |
+
table td { padding: 18px; border-top: 1px solid #ffffff; border-bottom: 1px solid #e0e0e0; border-left: 1px solid #e0e0e0; background: #fafafa; background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa)); background: -moz-linear-gradient(top, #fbfbfb, #fafafa); }
|
721 |
+
table tr.even td { background: #f6f6f6; background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f6f6f6)); background: -moz-linear-gradient(top, #f8f8f8, #f6f6f6); }
|
722 |
+
table tr:last-child td {border-bottom: 0;}
|
723 |
+
table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
|
724 |
+
table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
|
725 |
+
table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
|
726 |
+
|
727 |
/* Responsive */
|
728 |
@media screen and (max-width: 800px) {
|
729 |
.single-post main{
|
731 |
}
|
732 |
}
|
733 |
@media screen and (max-width: 630px) {
|
734 |
+
.related_posts ol li p{ display:none }
|
735 |
+
.related_link { margin: 16px 18px 20px 19px; }
|
736 |
+
.amp-category-post {line-height: 1.45;font-size: 14px; }
|
737 |
+
.amp-category-block li:nth-child(3) {margin:0 0.6%}
|
|
|
|
|
738 |
}
|
739 |
@media screen and (max-width: 510px) {
|
740 |
+
.ampforwp-tax-category span{ display:none }
|
741 |
+
.related_posts ol li p{ line-height: 1.6; margin: 7px 0 0 0; }
|
742 |
+
.related_posts .related_link { margin: 17px 18px 17px 19px; }
|
743 |
+
.comments_list ul li .comment-body{ width:auto }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
744 |
}
|
745 |
@media screen and (max-width: 425px) {
|
746 |
.related_posts .related_link p{
|
794 |
}
|
795 |
}
|
796 |
@media screen and (max-width: 340px) {
|
797 |
+
.related_posts .related_link a { font-size: 15px; }
|
798 |
+
.single-post main{ padding: 10px 5px 10px 5px }
|
799 |
+
.the_content .amp-ad-wrapper{ text-align: center; margin-left: -13px; }
|
800 |
+
.amp-category-post {line-height: 1.45;font-size: 12px; }
|
801 |
+
.amp-category-block li:nth-child(3) {margin:0%}
|
|
|
|
|
|
|
|
|
|
|
802 |
}
|
803 |
@media screen and (max-width: 320px) {
|
804 |
.related_posts .related_link a {
|
816 |
}
|
817 |
}
|
818 |
@media screen and (max-width: 767px) {
|
819 |
+
.amp-wp-post-content p{ display: block }
|
820 |
+
.amp-wp-post-content p{ display: none }
|
821 |
+
main, .amp-category-block, .category-widget-wrapper{ padding: 15px 18px 0px 18px; }
|
822 |
+
.toggle-navigation ul li{ width: 50% }
|
823 |
+
}
|
824 |
+
@media screen and (max-width: 495px) {
|
825 |
+
h2.amp-wp-title a{ font-size: 17px; line-height: 26px;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
826 |
}
|
827 |
<?php if($redux_builder_amp['amp-rtl-select-option'] == true) { ?>
|
828 |
/* RTL Start */
|
858 |
<?php $color = $redux_builder_amp['opt-color-rgba']['color']; ?>
|
859 |
.amp-wp-tax-tag a,
|
860 |
a,
|
861 |
+
.amp-wp-author, .headerlogo a, [class*=icono-] {
|
862 |
color: <?php echo sanitize_hex_color( $header_background_color ); ?>;;
|
863 |
}
|
864 |
.amp-wp-content blockquote{
|
876 |
amp-user-notification button {
|
877 |
background-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;;
|
878 |
}
|
879 |
+
<?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
|
880 |
.single-post footer {
|
881 |
+
padding-bottom: 40px;
|
882 |
}
|
883 |
.amp-ad-2{ margin-bottom: 50px; }
|
884 |
<?php } ?>
|
@@ -10,7 +10,7 @@
|
|
10 |
global $wp;
|
11 |
$current_archive_url = home_url( $wp->request );
|
12 |
$amp_url = trailingslashit($current_archive_url);
|
13 |
-
$remove = '/'.
|
14 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
15 |
} ?>
|
16 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
@@ -22,7 +22,7 @@
|
|
22 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
23 |
</style>
|
24 |
</head>
|
25 |
-
<body class="amp_home_body archives_body">
|
26 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
27 |
|
28 |
<?php do_action( 'ampforwp_after_header', $this );
|
@@ -38,6 +38,7 @@ if ( get_query_var( 'paged' ) ) {
|
|
38 |
?>
|
39 |
|
40 |
<main>
|
|
|
41 |
<?php
|
42 |
|
43 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
@@ -58,7 +59,7 @@ if ( get_query_var( 'paged' ) ) {
|
|
58 |
} ?>
|
59 |
|
60 |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
|
61 |
-
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) .
|
62 |
|
63 |
<div class="amp-wp-content amp-loop-list">
|
64 |
<?php if ( has_post_thumbnail() ) { ?>
|
@@ -67,14 +68,23 @@ if ( get_query_var( 'paged' ) ) {
|
|
67 |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
|
68 |
$thumb_url = $thumb_url_array[0];
|
69 |
?>
|
70 |
-
<div class="home-post_image"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
<?php } ?>
|
72 |
|
73 |
<div class="amp-wp-post-content">
|
74 |
<ul class="amp-wp-tags">
|
75 |
-
<?php foreach((get_the_category()) as $category) { ?>
|
76 |
-
|
77 |
-
<?php } ?>
|
78 |
</ul>
|
79 |
<h2 class="amp-wp-title"> <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"> <?php the_title(); ?></a></h2>
|
80 |
|
@@ -106,15 +116,16 @@ if ( get_query_var( 'paged' ) ) {
|
|
106 |
|
107 |
<div id="pagination">
|
108 |
<div class="next"><?php next_posts_link( $redux_builder_amp['amp-translator-show-more-posts-text'] , 0 ) ?></div>
|
109 |
-
<?php if ( $paged > 1 ) { ?>
|
110 |
-
|
111 |
-
<?php } ?>
|
112 |
<div class="clearfix"></div>
|
113 |
</div>
|
114 |
</div>
|
115 |
|
116 |
<?php endif; ?>
|
117 |
<?php wp_reset_postdata(); ?>
|
|
|
118 |
</main>
|
119 |
<?php do_action( 'amp_post_template_above_footer', $this ); ?>
|
120 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
10 |
global $wp;
|
11 |
$current_archive_url = home_url( $wp->request );
|
12 |
$amp_url = trailingslashit($current_archive_url);
|
13 |
+
$remove = '/'. AMPFORWP_AMP_QUERY_VAR;
|
14 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
15 |
} ?>
|
16 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
22 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
23 |
</style>
|
24 |
</head>
|
25 |
+
<body class="amp_home_body archives_body design_3_wrapper">
|
26 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
27 |
|
28 |
<?php do_action( 'ampforwp_after_header', $this );
|
38 |
?>
|
39 |
|
40 |
<main>
|
41 |
+
<?php do_action('ampforwp_post_before_loop') ?>
|
42 |
<?php
|
43 |
|
44 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
59 |
} ?>
|
60 |
|
61 |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
|
62 |
+
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
|
63 |
|
64 |
<div class="amp-wp-content amp-loop-list">
|
65 |
<?php if ( has_post_thumbnail() ) { ?>
|
68 |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
|
69 |
$thumb_url = $thumb_url_array[0];
|
70 |
?>
|
71 |
+
<div class="home-post_image">
|
72 |
+
<a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
|
73 |
+
<amp-img
|
74 |
+
layout="responsive"
|
75 |
+
src=<?php echo $thumb_url ?>
|
76 |
+
width=450
|
77 |
+
height=270
|
78 |
+
></amp-img>
|
79 |
+
</a>
|
80 |
+
</div>
|
81 |
<?php } ?>
|
82 |
|
83 |
<div class="amp-wp-post-content">
|
84 |
<ul class="amp-wp-tags">
|
85 |
+
<?php foreach((get_the_category()) as $category) { ?>
|
86 |
+
<li><?php echo $category->cat_name ?></li>
|
87 |
+
<?php } ?>
|
88 |
</ul>
|
89 |
<h2 class="amp-wp-title"> <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"> <?php the_title(); ?></a></h2>
|
90 |
|
116 |
|
117 |
<div id="pagination">
|
118 |
<div class="next"><?php next_posts_link( $redux_builder_amp['amp-translator-show-more-posts-text'] , 0 ) ?></div>
|
119 |
+
<?php if ( $paged > 1 ) { ?>
|
120 |
+
<div class="prev"><?php previous_posts_link( $redux_builder_amp['amp-translator-show-previous-posts-text'] ); ?></div>
|
121 |
+
<?php } ?>
|
122 |
<div class="clearfix"></div>
|
123 |
</div>
|
124 |
</div>
|
125 |
|
126 |
<?php endif; ?>
|
127 |
<?php wp_reset_postdata(); ?>
|
128 |
+
<?php do_action('ampforwp_post_after_loop') ?>
|
129 |
</main>
|
130 |
<?php do_action( 'amp_post_template_above_footer', $this ); ?>
|
131 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
@@ -71,7 +71,7 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
71 |
</ul>
|
72 |
</div>
|
73 |
<div class="comment-button-wrapper">
|
74 |
-
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
75 |
</div><?php
|
76 |
} else {
|
77 |
global $redux_builder_amp ;
|
@@ -79,7 +79,7 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
79 |
return;
|
80 |
} ?>
|
81 |
<div class="comment-button-wrapper">
|
82 |
-
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
83 |
</div>
|
84 |
<?php } ?>
|
85 |
</div>
|
71 |
</ul>
|
72 |
</div>
|
73 |
<div class="comment-button-wrapper">
|
74 |
+
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
75 |
</div><?php
|
76 |
} else {
|
77 |
global $redux_builder_amp ;
|
79 |
return;
|
80 |
} ?>
|
81 |
<div class="comment-button-wrapper">
|
82 |
+
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
83 |
</div>
|
84 |
<?php } ?>
|
85 |
</div>
|
@@ -31,7 +31,7 @@
|
|
31 |
<div id="pagination">
|
32 |
<?php $next_post = get_next_post();
|
33 |
if (!empty( $next_post )) { ?>
|
34 |
-
<span><?php global $redux_builder_amp; echo $redux_builder_amp['amp-translator-next-read-text']; ?></span> <a href="<?php echo trailingslashit(get_permalink( $next_post->ID )) .
|
35 |
} ?>
|
36 |
</div>
|
37 |
</div>
|
31 |
<div id="pagination">
|
32 |
<?php $next_post = get_next_post();
|
33 |
if (!empty( $next_post )) { ?>
|
34 |
+
<span><?php global $redux_builder_amp; echo $redux_builder_amp['amp-translator-next-read-text']; ?></span> <a href="<?php echo trailingslashit(get_permalink( $next_post->ID )) . AMPFORWP_AMP_QUERY_VAR; ?>"><?php echo $next_post->post_title; ?> »</a> <?php
|
35 |
} ?>
|
36 |
</div>
|
37 |
</div>
|
@@ -47,7 +47,7 @@
|
|
47 |
$my_query->the_post();
|
48 |
$related_post_permalink = get_permalink();
|
49 |
$related_post_permalink = trailingslashit($related_post_permalink);
|
50 |
-
$related_post_permalink = $related_post_permalink .
|
51 |
?>
|
52 |
<li class="<?php if ( has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
53 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
47 |
$my_query->the_post();
|
48 |
$related_post_permalink = get_permalink();
|
49 |
$related_post_permalink = trailingslashit($related_post_permalink);
|
50 |
+
$related_post_permalink = $related_post_permalink . AMPFORWP_AMP_QUERY_VAR ;;
|
51 |
?>
|
52 |
<li class="<?php if ( has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
53 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
@@ -4,5 +4,5 @@ if (!comments_open() || $redux_builder_amp['ampforwp-disqus-comments-support'])
|
|
4 |
return;
|
5 |
} ?>
|
6 |
<div class="comment-button-wrapper ampforwp-comment-button">
|
7 |
-
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
8 |
</div>
|
4 |
return;
|
5 |
} ?>
|
6 |
<div class="comment-button-wrapper ampforwp-comment-button">
|
7 |
+
<a href="<?php echo get_permalink().'?nonamp=1'.'#commentform' ?>" rel="nofollow"><?php esc_html_e( $redux_builder_amp['amp-translator-leave-a-comment-text'] ); ?></a>
|
8 |
</div>
|
@@ -1,4 +1,5 @@
|
|
1 |
<?php global $redux_builder_amp; ?>
|
|
|
2 |
<div class="amp-wp-content ampforwp-social-icons-wrapper ampforwp-social-icons">
|
3 |
<i class="icono-share"></i>
|
4 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
@@ -10,7 +11,7 @@
|
|
10 |
<?php } ?>
|
11 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
12 |
<amp-social-share type="gplus" width="40" height="40"></amp-social-share>
|
13 |
-
<?php } ?>
|
14 |
<?php if($redux_builder_amp['enable-single-email-share'] == true) { ?>
|
15 |
<amp-social-share type="email" width="40" height="40"></amp-social-share>
|
16 |
<?php } ?>
|
@@ -28,3 +29,4 @@
|
|
28 |
</a>
|
29 |
<?php } ?>
|
30 |
</div>
|
|
1 |
<?php global $redux_builder_amp; ?>
|
2 |
+
<?php if( is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
|
3 |
<div class="amp-wp-content ampforwp-social-icons-wrapper ampforwp-social-icons">
|
4 |
<i class="icono-share"></i>
|
5 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
11 |
<?php } ?>
|
12 |
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
13 |
<amp-social-share type="gplus" width="40" height="40"></amp-social-share>
|
14 |
+
<?php } ?>
|
15 |
<?php if($redux_builder_amp['enable-single-email-share'] == true) { ?>
|
16 |
<amp-social-share type="email" width="40" height="40"></amp-social-share>
|
17 |
<?php } ?>
|
29 |
</a>
|
30 |
<?php } ?>
|
31 |
</div>
|
32 |
+
<?php } ?>
|
@@ -3,30 +3,39 @@
|
|
3 |
|
4 |
$ampforwp_backto_nonamp = " ";
|
5 |
if ( is_home() ) {
|
6 |
-
$ampforwp_backto_nonamp = home_url();
|
7 |
}
|
8 |
if ( is_single() ){
|
9 |
global $post;
|
10 |
-
$ampforwp_backto_nonamp = get_permalink( $post->ID );
|
11 |
}
|
12 |
if ( is_page() ){
|
13 |
global $post;
|
14 |
-
$ampforwp_backto_nonamp = get_permalink( $post->ID );
|
15 |
}
|
16 |
if( is_archive() ) {
|
17 |
global $wp;
|
18 |
-
$ampforwp_backto_nonamp = esc_url( home_url( $wp->request ) );
|
|
|
19 |
}
|
20 |
?>
|
|
|
21 |
<footer class="footer_wrapper container">
|
22 |
<div id="footer">
|
|
|
23 |
<div class="footer_menu">
|
24 |
-
<?php
|
|
|
|
|
|
|
|
|
25 |
</div>
|
|
|
|
|
|
|
26 |
<div class="social_icons">
|
27 |
<ul>
|
28 |
|
29 |
-
|
30 |
<?php global $redux_builder_amp;
|
31 |
if( $redux_builder_amp['enable-single-twittter-profile'] && $redux_builder_amp['enable-single-twittter-profile-url'] !== '') { ?>
|
32 |
<a href="<?php echo $redux_builder_amp['enable-single-twittter-profile-url']; ?>" target ="_blank"><li class="icon-twitter"></li></a>
|
@@ -84,6 +93,7 @@
|
|
84 |
|
85 |
</ul>
|
86 |
</div>
|
|
|
87 |
<p class="rightslink">
|
88 |
<?php
|
89 |
global $allowed_html;
|
@@ -92,7 +102,7 @@
|
|
92 |
<?php
|
93 |
//24. Added an options button for switching on/off link to non amp page
|
94 |
if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') {
|
95 |
-
if ( $ampforwp_backto_nonamp ) { ?> | <a href="<?php echo $ampforwp_backto_nonamp; ?>"><?php echo esc_html( $redux_builder_amp['amp-translator-non-amp-page-text'] ) ;?> </a> <?php }
|
96 |
} ?>
|
97 |
</p>
|
98 |
<?php global $redux_builder_amp; if( $redux_builder_amp['amp-design-3-credit-link'] ) { ?>
|
@@ -104,11 +114,7 @@
|
|
104 |
</footer>
|
105 |
</div><!--Design3 Ends-->
|
106 |
|
107 |
-
<?php
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
<i class="icono-cross"></i>
|
112 |
-
</amp-lightbox>
|
113 |
-
<?php } ?>
|
114 |
-
<?php do_action('ampforwp_global_after_footer'); ?>
|
3 |
|
4 |
$ampforwp_backto_nonamp = " ";
|
5 |
if ( is_home() ) {
|
6 |
+
$ampforwp_backto_nonamp = untrailingslashit(home_url()).'?nonamp=1';
|
7 |
}
|
8 |
if ( is_single() ){
|
9 |
global $post;
|
10 |
+
$ampforwp_backto_nonamp = untrailingslashit(get_permalink( $post->ID )).'?nonamp=1';
|
11 |
}
|
12 |
if ( is_page() ){
|
13 |
global $post;
|
14 |
+
$ampforwp_backto_nonamp = untrailingslashit(get_permalink( $post->ID )).'?nonamp=1';
|
15 |
}
|
16 |
if( is_archive() ) {
|
17 |
global $wp;
|
18 |
+
$ampforwp_backto_nonamp = esc_url( untrailingslashit(home_url( $wp->request )).'?nonamp=1' );
|
19 |
+
$ampforwp_backto_nonamp = preg_replace('/\/amp\?nonamp=1/','?nonamp=1',$ampforwp_backto_nonamp);
|
20 |
}
|
21 |
?>
|
22 |
+
|
23 |
<footer class="footer_wrapper container">
|
24 |
<div id="footer">
|
25 |
+
<?php if ( has_nav_menu( 'amp-footer-menu' ) ) { ?>
|
26 |
<div class="footer_menu">
|
27 |
+
<?php
|
28 |
+
wp_nav_menu( array(
|
29 |
+
'theme_location' => 'amp-footer-menu',
|
30 |
+
) );
|
31 |
+
?>
|
32 |
</div>
|
33 |
+
<?php } ?>
|
34 |
+
|
35 |
+
<?php if( ampforwp_checking_any_social_profiles() ) { ?>
|
36 |
<div class="social_icons">
|
37 |
<ul>
|
38 |
|
|
|
39 |
<?php global $redux_builder_amp;
|
40 |
if( $redux_builder_amp['enable-single-twittter-profile'] && $redux_builder_amp['enable-single-twittter-profile-url'] !== '') { ?>
|
41 |
<a href="<?php echo $redux_builder_amp['enable-single-twittter-profile-url']; ?>" target ="_blank"><li class="icon-twitter"></li></a>
|
93 |
|
94 |
</ul>
|
95 |
</div>
|
96 |
+
<?php } ?>
|
97 |
<p class="rightslink">
|
98 |
<?php
|
99 |
global $allowed_html;
|
102 |
<?php
|
103 |
//24. Added an options button for switching on/off link to non amp page
|
104 |
if($redux_builder_amp['amp-footer-link-non-amp-page']=='1') {
|
105 |
+
if ( $ampforwp_backto_nonamp ) { ?> | <a href="<?php echo $ampforwp_backto_nonamp; ?>" rel="nofollow"><?php echo esc_html( $redux_builder_amp['amp-translator-non-amp-page-text'] ) ;?> </a> <?php }
|
106 |
} ?>
|
107 |
</p>
|
108 |
<?php global $redux_builder_amp; if( $redux_builder_amp['amp-design-3-credit-link'] ) { ?>
|
114 |
</footer>
|
115 |
</div><!--Design3 Ends-->
|
116 |
|
117 |
+
<?php
|
118 |
+
do_action('ampforwp_global_after_footer');
|
119 |
+
|
120 |
+
?>
|
|
|
|
|
|
|
|
@@ -12,7 +12,7 @@ $template = new AMP_Post_Template( $post_id );?>
|
|
12 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
13 |
<?php
|
14 |
$amp_custom_content_enable = get_post_meta($template->data['post_id'], 'ampforwp_custom_content_editor_checkbox', true);
|
15 |
-
if ( $amp_custom_content_enable ) {
|
16 |
$amp_component_scripts = $template->data['amp_component_scripts'];
|
17 |
foreach ($amp_component_scripts as $ampforwp_service => $ampforwp_js_file) { ?>
|
18 |
<script custom-element="<?php echo $ampforwp_service; ?>" src="<?php echo $ampforwp_js_file; ?>" async></script> <?php
|
@@ -23,10 +23,10 @@ $template = new AMP_Post_Template( $post_id );?>
|
|
23 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
24 |
</style>
|
25 |
</head>
|
26 |
-
<body class="single-post">
|
27 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
28 |
|
29 |
-
<header class="amp-wp-article-header ampforwp-title">
|
30 |
<h1 class="amp-wp-title">
|
31 |
<?php global $redux_builder_amp;
|
32 |
$ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
|
12 |
<?php do_action( 'amp_post_template_head', $this ); ?>
|
13 |
<?php
|
14 |
$amp_custom_content_enable = get_post_meta($template->data['post_id'], 'ampforwp_custom_content_editor_checkbox', true);
|
15 |
+
if ( ! $amp_custom_content_enable ) {
|
16 |
$amp_component_scripts = $template->data['amp_component_scripts'];
|
17 |
foreach ($amp_component_scripts as $ampforwp_service => $ampforwp_js_file) { ?>
|
18 |
<script custom-element="<?php echo $ampforwp_service; ?>" src="<?php echo $ampforwp_js_file; ?>" async></script> <?php
|
23 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
24 |
</style>
|
25 |
</head>
|
26 |
+
<body class="single-post design_3_wrapper">
|
27 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
28 |
|
29 |
+
<header class="amp-wp-article-header ampforwp-title amp-wp-content">
|
30 |
<h1 class="amp-wp-title">
|
31 |
<?php global $redux_builder_amp;
|
32 |
$ID = $redux_builder_amp['amp-frontpage-select-option-pages'];
|
@@ -28,7 +28,7 @@ class AMPforWP_Menu_Walker extends Walker_Nav_Menu {
|
|
28 |
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
|
29 |
|
30 |
if ( $this->has_children ) {
|
31 |
-
|
32 |
|
33 |
$this->start_accordion( $output, $depth );
|
34 |
|
@@ -130,50 +130,27 @@ function ampforwp_add_design3_required_fonts( $data ) {
|
|
130 |
}
|
131 |
|
132 |
// Add required Javascripts for Design 3
|
133 |
-
add_filter( 'amp_post_template_data', 'ampforwp_add_design3_required_scripts' );
|
134 |
function ampforwp_add_design3_required_scripts( $data ) {
|
135 |
global $redux_builder_amp;
|
|
|
136 |
|
137 |
-
// Add Scripts only when
|
138 |
-
if(
|
139 |
-
if ( empty( $data['amp_component_scripts']['amp-lightbox'] ) ) {
|
140 |
-
$data['amp_component_scripts']['amp-lightbox'] = 'https://cdn.ampproject.org/v0/amp-lightbox-0.1.js';
|
141 |
-
}
|
142 |
-
if ( empty( $data['amp_component_scripts']['amp-form'] ) ) {
|
143 |
-
$data['amp_component_scripts']['amp-form'] = 'https://cdn.ampproject.org/v0/amp-form-0.1.js';
|
144 |
-
}
|
145 |
-
}
|
146 |
-
// Add Scripts only when AMP Menu is Enabled
|
147 |
-
if( has_nav_menu( 'amp-menu' ) ) {
|
148 |
if ( empty( $data['amp_component_scripts']['amp-accordion'] ) ) {
|
149 |
$data['amp_component_scripts']['amp-accordion'] = 'https://cdn.ampproject.org/v0/amp-accordion-0.1.js';
|
150 |
-
}
|
151 |
}
|
152 |
// Add Scripts only when Homepage AMP Featured Slider is Enabled
|
153 |
-
if( is_home() ) {
|
|
|
|
|
154 |
|
155 |
-
if ( $redux_builder_amp['amp-design-3-featured-slider'] == 1 ) {
|
156 |
-
|
157 |
if ( empty( $data['amp_component_scripts']['amp-carousel'] ) ) {
|
158 |
$data['amp_component_scripts']['amp-carousel'] = 'https://cdn.ampproject.org/v0/amp-carousel-0.1.js';
|
159 |
}
|
160 |
-
}
|
161 |
}
|
162 |
return $data;
|
163 |
}
|
164 |
|
165 |
-
// Search Form
|
166 |
-
function ampforwp_get_search_form() {
|
167 |
-
$form = '<form role="search" method="get" id="searchform" class="searchform" target="_top" action="' . get_bloginfo('url') .'">
|
168 |
-
<div>
|
169 |
-
<label class="screen-reader-text" for="s">' . _x( 'Type your search query and hit enter:', 'label' ) . '</label>
|
170 |
-
<input type="text" placeholder="AMP" value="1" name="amp" class="hide" id="ampsomething" />
|
171 |
-
<input type="text" placeholder="Type here" value="' . get_search_query() . '" name="s" id="s" />
|
172 |
-
<input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
|
173 |
-
</div>
|
174 |
-
</form>';
|
175 |
-
return $form;
|
176 |
-
}
|
177 |
-
function ampforwp_the_search_form() {
|
178 |
-
echo ampforwp_get_search_form();
|
179 |
-
}
|
28 |
$class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
|
29 |
|
30 |
if ( $this->has_children ) {
|
31 |
+
set_transient( 'ampforwp_has_nav_child', true, 3 );
|
32 |
|
33 |
$this->start_accordion( $output, $depth );
|
34 |
|
130 |
}
|
131 |
|
132 |
// Add required Javascripts for Design 3
|
133 |
+
add_filter( 'amp_post_template_data', 'ampforwp_add_design3_required_scripts', 100 );
|
134 |
function ampforwp_add_design3_required_scripts( $data ) {
|
135 |
global $redux_builder_amp;
|
136 |
+
$amp_menu_has_child = get_transient( 'ampforwp_has_nav_child' );
|
137 |
|
138 |
+
// Add Scripts only when AMP Menu is Enabled
|
139 |
+
if( has_nav_menu( 'amp-menu' ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
if ( empty( $data['amp_component_scripts']['amp-accordion'] ) ) {
|
141 |
$data['amp_component_scripts']['amp-accordion'] = 'https://cdn.ampproject.org/v0/amp-accordion-0.1.js';
|
142 |
+
}
|
143 |
}
|
144 |
// Add Scripts only when Homepage AMP Featured Slider is Enabled
|
145 |
+
if( is_home() ) {
|
146 |
+
|
147 |
+
if ( $redux_builder_amp['amp-design-3-featured-slider'] == 1 && $redux_builder_amp['amp-design-selector'] == 3 && $redux_builder_amp['amp-frontpage-select-option'] == 0 ) {
|
148 |
|
|
|
|
|
149 |
if ( empty( $data['amp_component_scripts']['amp-carousel'] ) ) {
|
150 |
$data['amp_component_scripts']['amp-carousel'] = 'https://cdn.ampproject.org/v0/amp-carousel-0.1.js';
|
151 |
}
|
152 |
+
}
|
153 |
}
|
154 |
return $data;
|
155 |
}
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -87,17 +87,20 @@
|
|
87 |
</div>
|
88 |
<div class="headerlogo">
|
89 |
<?php global $redux_builder_amp;
|
|
|
90 |
if ($redux_builder_amp['amp-on-off-support-for-non-amp-home-page']) {
|
91 |
$ampforwp_home_url = untrailingslashit( get_bloginfo('url') ).'?nonamp=1';
|
|
|
92 |
}else{ global $redux_builder_amp; if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
|
93 |
-
$ampforwp_home_url = trailingslashit( get_bloginfo('url') ) .
|
94 |
} else {
|
95 |
$ampforwp_home_url = trailingslashit( get_bloginfo('url') ) .'?nonamp=1';
|
|
|
96 |
}
|
97 |
}
|
98 |
?>
|
99 |
<?php if ( true == ($redux_builder_amp['opt-media']['url']) ) { ?>
|
100 |
-
<a href="<?php echo esc_url( $ampforwp_home_url ); ?>">
|
101 |
|
102 |
<?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
|
103 |
|
@@ -111,12 +114,10 @@
|
|
111 |
|
112 |
</a>
|
113 |
<?php } else { ?>
|
114 |
-
<h1><a href="<?php echo esc_url( $ampforwp_home_url ); ?>"><?php bloginfo('name'); ?></a></h1>
|
115 |
<?php } ?>
|
116 |
</div>
|
117 |
-
<?php
|
118 |
-
<div class="searchmenu"><button on="tap:search-icon"><i class="icono-search"></i></button> </div>
|
119 |
-
<?php } ?>
|
120 |
</div>
|
121 |
</div>
|
122 |
</header>
|
87 |
</div>
|
88 |
<div class="headerlogo">
|
89 |
<?php global $redux_builder_amp;
|
90 |
+
$set_rel_to_noamp=false;
|
91 |
if ($redux_builder_amp['amp-on-off-support-for-non-amp-home-page']) {
|
92 |
$ampforwp_home_url = untrailingslashit( get_bloginfo('url') ).'?nonamp=1';
|
93 |
+
$set_rel_to_noamp=true;
|
94 |
}else{ global $redux_builder_amp; if($redux_builder_amp['ampforwp-homepage-on-off-support']) {
|
95 |
+
$ampforwp_home_url = trailingslashit( get_bloginfo('url') ) . AMPFORWP_AMP_QUERY_VAR;
|
96 |
} else {
|
97 |
$ampforwp_home_url = trailingslashit( get_bloginfo('url') ) .'?nonamp=1';
|
98 |
+
$set_rel_to_noamp=true;
|
99 |
}
|
100 |
}
|
101 |
?>
|
102 |
<?php if ( true == ($redux_builder_amp['opt-media']['url']) ) { ?>
|
103 |
+
<a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> >
|
104 |
|
105 |
<?php if($redux_builder_amp['ampforwp-custom-logo-dimensions'] == true) { ?>
|
106 |
|
114 |
|
115 |
</a>
|
116 |
<?php } else { ?>
|
117 |
+
<h1><a href="<?php echo esc_url( $ampforwp_home_url ); ?>" <?php if($set_rel_to_noamp){ echo ' rel="nofollow"'; } ?> ><?php bloginfo('name'); ?></a></h1>
|
118 |
<?php } ?>
|
119 |
</div>
|
120 |
+
<?php do_action('ampforwp_header_search'); ?>
|
|
|
|
|
121 |
</div>
|
122 |
</div>
|
123 |
</header>
|
@@ -9,7 +9,7 @@
|
|
9 |
global $wp;
|
10 |
$current_archive_url = home_url( $wp->request );
|
11 |
$amp_url = trailingslashit($current_archive_url);
|
12 |
-
$remove = '/'.
|
13 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
14 |
} ?>
|
15 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
@@ -21,9 +21,13 @@
|
|
21 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
22 |
</style>
|
23 |
</head>
|
24 |
-
<body class="amp_home_body">
|
25 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
26 |
|
|
|
|
|
|
|
|
|
27 |
<?php do_action( 'ampforwp_after_header', $this );
|
28 |
|
29 |
if ( get_query_var( 'paged' ) ) {
|
@@ -87,8 +91,9 @@ if ( get_query_var( 'paged' ) ) {
|
|
87 |
</div>
|
88 |
</div>
|
89 |
<?php } ?>
|
90 |
-
|
91 |
<main>
|
|
|
92 |
<?php
|
93 |
|
94 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
@@ -102,13 +107,8 @@ if ( get_query_var( 'paged' ) ) {
|
|
102 |
'post_status'=> 'publish'
|
103 |
) ); ?>
|
104 |
|
105 |
-
<?php if ( is_archive() ) {
|
106 |
-
the_archive_title( '<h3 class="page-title">', '</h3>' );
|
107 |
-
the_archive_description( '<div class="taxonomy-description">', '</div>' );
|
108 |
-
} ?>
|
109 |
-
|
110 |
<?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
|
111 |
-
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) .
|
112 |
|
113 |
<div class="amp-wp-content amp-loop-list <?php if ( has_post_thumbnail() ) { } else{?>amp-loop-list-noimg<?php } ?>">
|
114 |
<?php if ( has_post_thumbnail() ) { ?>
|
@@ -117,14 +117,23 @@ if ( get_query_var( 'paged' ) ) {
|
|
117 |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
|
118 |
$thumb_url = $thumb_url_array[0];
|
119 |
?>
|
120 |
-
<div class="home-post_image"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
<?php } ?>
|
122 |
|
123 |
<div class="amp-wp-post-content">
|
124 |
<ul class="amp-wp-tags">
|
125 |
-
<?php foreach((get_the_category()) as $category) { ?>
|
126 |
-
|
127 |
-
<?php } ?>
|
128 |
</ul>
|
129 |
<h2 class="amp-wp-title"> <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"> <?php the_title(); ?></a></h2>
|
130 |
|
@@ -147,19 +156,22 @@ if ( get_query_var( 'paged' ) ) {
|
|
147 |
|
148 |
<div class="amp-wp-content pagination-holder">
|
149 |
|
150 |
-
|
151 |
<div id="pagination">
|
152 |
<div class="next"><?php next_posts_link( $redux_builder_amp['amp-translator-show-more-posts-text'] , 0 ) ?></div>
|
153 |
-
<?php if ( $paged > 1 ) { ?>
|
154 |
-
|
155 |
-
<?php } ?>
|
156 |
<div class="clearfix"></div>
|
157 |
</div>
|
158 |
</div>
|
159 |
|
160 |
<?php endif; ?>
|
161 |
<?php wp_reset_postdata(); ?>
|
|
|
|
|
|
|
162 |
</main>
|
|
|
163 |
<?php do_action( 'amp_post_template_above_footer', $this ); ?>
|
164 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
165 |
<?php do_action( 'amp_post_template_footer', $this ); ?>
|
9 |
global $wp;
|
10 |
$current_archive_url = home_url( $wp->request );
|
11 |
$amp_url = trailingslashit($current_archive_url);
|
12 |
+
$remove = '/'. AMPFORWP_AMP_QUERY_VAR;
|
13 |
$amp_url = str_replace($remove, '', $amp_url) ;
|
14 |
} ?>
|
15 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
21 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
22 |
</style>
|
23 |
</head>
|
24 |
+
<body class="amp_home_body design_3_wrapper">
|
25 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
26 |
|
27 |
+
<div class="amp-wp-content">
|
28 |
+
<?php do_action('ampforwp_area_above_loop'); ?>
|
29 |
+
</div>
|
30 |
+
|
31 |
<?php do_action( 'ampforwp_after_header', $this );
|
32 |
|
33 |
if ( get_query_var( 'paged' ) ) {
|
91 |
</div>
|
92 |
</div>
|
93 |
<?php } ?>
|
94 |
+
<?php do_action('ampforwp_home_above_loop') ?>
|
95 |
<main>
|
96 |
+
<?php do_action('ampforwp_post_before_loop') ?>
|
97 |
<?php
|
98 |
|
99 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
107 |
'post_status'=> 'publish'
|
108 |
) ); ?>
|
109 |
|
|
|
|
|
|
|
|
|
|
|
110 |
<?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
|
111 |
+
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
|
112 |
|
113 |
<div class="amp-wp-content amp-loop-list <?php if ( has_post_thumbnail() ) { } else{?>amp-loop-list-noimg<?php } ?>">
|
114 |
<?php if ( has_post_thumbnail() ) { ?>
|
117 |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
|
118 |
$thumb_url = $thumb_url_array[0];
|
119 |
?>
|
120 |
+
<div class="home-post_image">
|
121 |
+
<a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>">
|
122 |
+
<amp-img
|
123 |
+
layout="responsive"
|
124 |
+
src=<?php echo $thumb_url ?>
|
125 |
+
width=450
|
126 |
+
height=270
|
127 |
+
></amp-img>
|
128 |
+
</a>
|
129 |
+
</div>
|
130 |
<?php } ?>
|
131 |
|
132 |
<div class="amp-wp-post-content">
|
133 |
<ul class="amp-wp-tags">
|
134 |
+
<?php foreach((get_the_category()) as $category) { ?>
|
135 |
+
<li><?php echo $category->cat_name ?></li>
|
136 |
+
<?php } ?>
|
137 |
</ul>
|
138 |
<h2 class="amp-wp-title"> <a href="<?php echo esc_url( $ampforwp_amp_post_url ); ?>"> <?php the_title(); ?></a></h2>
|
139 |
|
156 |
|
157 |
<div class="amp-wp-content pagination-holder">
|
158 |
|
|
|
159 |
<div id="pagination">
|
160 |
<div class="next"><?php next_posts_link( $redux_builder_amp['amp-translator-show-more-posts-text'] , 0 ) ?></div>
|
161 |
+
<?php if ( $paged > 1 ) { ?>
|
162 |
+
<div class="prev"><?php previous_posts_link( $redux_builder_amp['amp-translator-show-previous-posts-text'] ); ?></div>
|
163 |
+
<?php } ?>
|
164 |
<div class="clearfix"></div>
|
165 |
</div>
|
166 |
</div>
|
167 |
|
168 |
<?php endif; ?>
|
169 |
<?php wp_reset_postdata(); ?>
|
170 |
+
|
171 |
+
<?php do_action('ampforwp_post_after_loop') ?>
|
172 |
+
|
173 |
</main>
|
174 |
+
<?php do_action('ampforwp_home_below_loop') ?>
|
175 |
<?php do_action( 'amp_post_template_above_footer', $this ); ?>
|
176 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
177 |
<?php do_action( 'amp_post_template_footer', $this ); ?>
|
@@ -4,11 +4,16 @@
|
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
7 |
-
<?php
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
12 |
} ?>
|
13 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
14 |
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
|
@@ -19,7 +24,7 @@
|
|
19 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
20 |
</style>
|
21 |
</head>
|
22 |
-
<body class="amp_home_body archives_body">
|
23 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
24 |
|
25 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
@@ -27,6 +32,7 @@
|
|
27 |
|
28 |
|
29 |
<main>
|
|
|
30 |
<?php
|
31 |
if ( get_query_var( 'paged' ) ) {
|
32 |
$paged = get_query_var('paged');
|
@@ -39,14 +45,12 @@
|
|
39 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
40 |
|
41 |
$q = new WP_Query( array(
|
42 |
-
'post_type' => 'post',
|
43 |
-
'orderby' => 'date',
|
44 |
's' => get_search_query() ,
|
45 |
'ignore_sticky_posts' => 1,
|
46 |
'paged' => esc_attr($paged),
|
47 |
'post__not_in' => $exclude_ids,
|
48 |
-
'has_password'
|
49 |
-
'post_status'=> 'publish'
|
50 |
) ); ?>
|
51 |
|
52 |
|
@@ -55,7 +59,7 @@
|
|
55 |
<h3 class="amp-wp-content page-title"><?php echo $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();?> </h3>
|
56 |
|
57 |
<?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
|
58 |
-
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) .
|
59 |
|
60 |
<div class="amp-wp-content amp-loop-list">
|
61 |
<?php if ( has_post_thumbnail() ) { ?>
|
@@ -97,19 +101,20 @@
|
|
97 |
|
98 |
<div id="pagination">
|
99 |
<div class="next"><?php next_posts_link( $redux_builder_amp['amp-translator-show-more-posts-text'] , 0 ) ?></div>
|
100 |
-
<?php if ( $paged > 1 ) { ?>
|
101 |
-
|
102 |
-
<?php } ?>
|
103 |
<div class="clearfix"></div>
|
104 |
</div>
|
105 |
</div>
|
106 |
<?php else : ?>
|
107 |
<div class="amp-wp-content">
|
108 |
-
|
109 |
</div>
|
110 |
|
111 |
<?php endif; ?>
|
112 |
<?php wp_reset_postdata(); ?>
|
|
|
113 |
</main>
|
114 |
<?php do_action( 'amp_post_template_above_footer', $this ); ?>
|
115 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
4 |
<head>
|
5 |
<meta charset="utf-8">
|
6 |
<link rel="dns-prefetch" href="https://cdn.ampproject.org">
|
7 |
+
<?php $paged = get_query_var( 'paged' );
|
8 |
+
$current_search_url =trailingslashit(get_home_url())."?s=".get_search_query();
|
9 |
+
$amp_url = untrailingslashit($current_search_url);
|
10 |
+
if ($paged > 1 ) {
|
11 |
+
global $wp;
|
12 |
+
$current_archive_url = home_url( $wp->request );
|
13 |
+
$amp_url = trailingslashit($current_archive_url);
|
14 |
+
$remove = '/'. AMPFORWP_AMP_QUERY_VAR;
|
15 |
+
$amp_url = str_replace($remove, '', $amp_url) ;
|
16 |
+
$amp_url = $amp_url ."?s=".get_search_query();
|
17 |
} ?>
|
18 |
<link rel="canonical" href="<?php echo $amp_url ?>">
|
19 |
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
|
24 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
25 |
</style>
|
26 |
</head>
|
27 |
+
<body class="amp_home_body archives_body design_3_wrapper">
|
28 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
29 |
|
30 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
32 |
|
33 |
|
34 |
<main>
|
35 |
+
<?php do_action('ampforwp_post_before_loop') ?>
|
36 |
<?php
|
37 |
if ( get_query_var( 'paged' ) ) {
|
38 |
$paged = get_query_var('paged');
|
45 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
46 |
|
47 |
$q = new WP_Query( array(
|
|
|
|
|
48 |
's' => get_search_query() ,
|
49 |
'ignore_sticky_posts' => 1,
|
50 |
'paged' => esc_attr($paged),
|
51 |
'post__not_in' => $exclude_ids,
|
52 |
+
'has_password' => false ,
|
53 |
+
'post_status' => 'publish'
|
54 |
) ); ?>
|
55 |
|
56 |
|
59 |
<h3 class="amp-wp-content page-title"><?php echo $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();?> </h3>
|
60 |
|
61 |
<?php if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
|
62 |
+
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ; ?>
|
63 |
|
64 |
<div class="amp-wp-content amp-loop-list">
|
65 |
<?php if ( has_post_thumbnail() ) { ?>
|
101 |
|
102 |
<div id="pagination">
|
103 |
<div class="next"><?php next_posts_link( $redux_builder_amp['amp-translator-show-more-posts-text'] , 0 ) ?></div>
|
104 |
+
<?php if ( $paged > 1 ) { ?>
|
105 |
+
<div class="prev"><?php previous_posts_link( $redux_builder_amp['amp-translator-show-previous-posts-text'] ); ?></div>
|
106 |
+
<?php } ?>
|
107 |
<div class="clearfix"></div>
|
108 |
</div>
|
109 |
</div>
|
110 |
<?php else : ?>
|
111 |
<div class="amp-wp-content">
|
112 |
+
<?php echo $redux_builder_amp['amp-translator-search-no-found']; ?>
|
113 |
</div>
|
114 |
|
115 |
<?php endif; ?>
|
116 |
<?php wp_reset_postdata(); ?>
|
117 |
+
<?php do_action('ampforwp_post_after_loop') ?>
|
118 |
</main>
|
119 |
<?php do_action( 'amp_post_template_above_footer', $this ); ?>
|
120 |
<?php $this->load_parts( array( 'footer' ) ); ?>
|
@@ -11,7 +11,7 @@
|
|
11 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
12 |
</style>
|
13 |
</head>
|
14 |
-
<body class="single-post <?php if(is_page()){ echo'amp-single-page'; };?>">
|
15 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
16 |
|
17 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
11 |
<?php do_action( 'amp_post_template_css', $this ); ?>
|
12 |
</style>
|
13 |
</head>
|
14 |
+
<body class="design_3_wrapper single-post <?php if(is_page()){ echo'amp-single-page'; };?>">
|
15 |
<?php $this->load_parts( array( 'header-bar' ) ); ?>
|
16 |
|
17 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
@@ -264,18 +264,9 @@ header{
|
|
264 |
position: fixed;
|
265 |
z-index:1000;
|
266 |
width: 100%;
|
|
|
267 |
}
|
268 |
-
#header h1{
|
269 |
-
text-align: center;
|
270 |
-
font-size: 16px;
|
271 |
-
left: -20px;
|
272 |
-
position: relative;
|
273 |
-
font-weight: bold;
|
274 |
-
line-height: 53px;
|
275 |
-
padding: 0;
|
276 |
-
margin: 0;
|
277 |
-
text-transform: uppercase;
|
278 |
-
}
|
279 |
|
280 |
main .amp-wp-content{
|
281 |
font-size: 18px;
|
@@ -410,7 +401,8 @@ color:#666
|
|
410 |
}
|
411 |
.ampforwp-title{
|
412 |
padding: 0px 0px 0px 0px;
|
413 |
-
margin-top:
|
|
|
414 |
}
|
415 |
.comment-button-wrapper{
|
416 |
margin-bottom: 50px;
|
@@ -500,6 +492,9 @@ h1.amp-wp-title {
|
|
500 |
figure{
|
501 |
margin: 0 0 20px 0;
|
502 |
}
|
|
|
|
|
|
|
503 |
figcaption{
|
504 |
font-size: 11px;
|
505 |
margin-bottom: 11px;
|
@@ -521,7 +516,7 @@ figcaption{
|
|
521 |
.amp-wp-meta, .amp-wp-meta a {
|
522 |
font-size: 13px;
|
523 |
color: #acacac;
|
524 |
-
margin: 20px 0px
|
525 |
padding: 0;
|
526 |
}
|
527 |
.amp-ad-wrapper {
|
@@ -754,6 +749,38 @@ pre {
|
|
754 |
position:relative;
|
755 |
z-index: 9999;
|
756 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
757 |
.searchmenu{
|
758 |
margin-right: 15px;
|
759 |
margin-top: 11px;
|
@@ -766,7 +793,9 @@ pre {
|
|
766 |
border:none
|
767 |
}
|
768 |
.headerlogo{
|
769 |
-
|
|
|
|
|
770 |
}
|
771 |
.headerlogo amp-img{
|
772 |
margin-top:6px
|
@@ -962,7 +991,7 @@ amp-lightbox{
|
|
962 |
margin-top: 15px;
|
963 |
width: 100%;
|
964 |
}
|
965 |
-
#searchsubmit{
|
966 |
|
967 |
/* AMP carousel */
|
968 |
.amp-carousel-button-prev,
|
@@ -1023,16 +1052,32 @@ amp-lightbox{
|
|
1023 |
float:right
|
1024 |
}
|
1025 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1026 |
|
1027 |
/* Responsive */
|
1028 |
-
|
1029 |
@media screen and (min-width:1034px){
|
1030 |
.single-post figcaption{
|
1031 |
margin: -17px 17px 0 -17px;
|
1032 |
}
|
1033 |
}
|
1034 |
@media screen and (max-width: 768px) {
|
1035 |
-
.ampforwp-title{ margin-top: 30px; }
|
1036 |
.amp-wp-meta{ margin:10px 0px 15px 0px }
|
1037 |
.home-post_image{ width: 40%; }
|
1038 |
.amp-loop-list .amp-wp-post-content{ width: 58%; }
|
@@ -1046,14 +1091,10 @@ amp-lightbox{
|
|
1046 |
@media screen and (max-width: 530px) {
|
1047 |
.home-post_image{ width: 35%; }
|
1048 |
.amp-loop-list .amp-wp-post-content{ width: 63%; }
|
1049 |
-
.amp-wp-post-content p{ font-size: 12px; }
|
1050 |
-
.related_posts ol li p{
|
1051 |
-
|
1052 |
-
|
1053 |
-
}
|
1054 |
-
.comments_list ul li .comment-body{
|
1055 |
-
width:auto
|
1056 |
-
}
|
1057 |
}
|
1058 |
@media screen and (max-width: 425px) {
|
1059 |
.home-post_image{
|
@@ -1091,12 +1132,12 @@ amp-lightbox{
|
|
1091 |
font-size: 17px;
|
1092 |
line-height: 1.5;
|
1093 |
}
|
1094 |
-
.ampforwp-title{ margin-top: 24px; }
|
1095 |
.single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 26px;}
|
1096 |
.icono-share{display:none}
|
1097 |
.ampforwp-social-icons amp-social-share{ margin-right: 3px;}
|
1098 |
main .amp-wp-content{ font-size: 16px; line-height: 26px;}
|
1099 |
.single-post .amp_author_area .amp_author_area_wrapper{font-size:13px;}
|
|
|
1100 |
}
|
1101 |
@media screen and (max-width: 400px) {
|
1102 |
.amp-wp-title{
|
@@ -1177,7 +1218,7 @@ amp-user-notification {
|
|
1177 |
amp-user-notification button {
|
1178 |
background-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;;
|
1179 |
}
|
1180 |
-
<?php if( $redux_builder_amp['enable-single-social-icons'] == true ) { ?>
|
1181 |
.single-post footer {
|
1182 |
padding-bottom: 41px;
|
1183 |
}
|
@@ -1305,11 +1346,14 @@ amp-user-notification button {
|
|
1305 |
text-align: center;
|
1306 |
}
|
1307 |
#ampsomething { display: none; }
|
1308 |
-
#header{ background:<?php echo $redux_builder_amp['amp-opt-color-rgba-headercolor']['color']; ?> }
|
1309 |
-
.nav_container, .comment-button-wrapper a , #pagination .next a, #pagination .prev a
|
1310 |
background: <?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']; ?> ;
|
1311 |
}
|
1312 |
-
|
|
|
|
|
|
|
1313 |
#pagination .next a, #pagination .prev a , #pagination .next a, #pagination .prev a , .comment-button-wrapper a {
|
1314 |
color: <?php echo $redux_builder_amp['amp-opt-color-rgba-font']['color']; ?> ;
|
1315 |
}
|
264 |
position: fixed;
|
265 |
z-index:1000;
|
266 |
width: 100%;
|
267 |
+
top:0;
|
268 |
}
|
269 |
+
#header h1{ text-align: center; font-size: 16px; position: relative; font-weight: bold; line-height: 53px; padding: 0; margin: 0; text-transform: uppercase }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
main .amp-wp-content{
|
272 |
font-size: 18px;
|
401 |
}
|
402 |
.ampforwp-title{
|
403 |
padding: 0px 0px 0px 0px;
|
404 |
+
margin-top: 12px;
|
405 |
+
margin-bottom: 12px;
|
406 |
}
|
407 |
.comment-button-wrapper{
|
408 |
margin-bottom: 50px;
|
492 |
figure{
|
493 |
margin: 0 0 20px 0;
|
494 |
}
|
495 |
+
figure amp-img{
|
496 |
+
max-width:100%;
|
497 |
+
}
|
498 |
figcaption{
|
499 |
font-size: 11px;
|
500 |
margin-bottom: 11px;
|
516 |
.amp-wp-meta, .amp-wp-meta a {
|
517 |
font-size: 13px;
|
518 |
color: #acacac;
|
519 |
+
margin: 20px 0px 20px 0px;
|
520 |
padding: 0;
|
521 |
}
|
522 |
.amp-ad-wrapper {
|
749 |
position:relative;
|
750 |
z-index: 9999;
|
751 |
}
|
752 |
+
/* Category 3 */
|
753 |
+
.amp-category-block{ margin: 30px 0px 10px 0px }
|
754 |
+
.amp-category-block a{ color:#666}
|
755 |
+
.amp-category-block ul{ list-style-type:none}
|
756 |
+
.category-widget-gutter h4{ margin-bottom: 0px;}
|
757 |
+
.category-widget-gutter ul{ margin-top: 10px; list-style-type:none; padding:0 }
|
758 |
+
.amp-category-block-btn{ display: block; text-align: center; font-size: 13px; margin-top: 15px; border-bottom: 1px solid #f1f1f1; text-decoration: none; padding-bottom: 8px;}
|
759 |
+
.design_2_wrapper .amp-category-block{ max-width: 840px; margin: 1.5em auto; }
|
760 |
+
.amp-category-block-title{
|
761 |
+
border-bottom: double #ddd;
|
762 |
+
margin-bottom: 12px;
|
763 |
+
padding-bottom: 1px;
|
764 |
+
text-align: center;
|
765 |
+
font-size: 12px;
|
766 |
+
text-transform: uppercase;
|
767 |
+
color: #666;
|
768 |
+
}
|
769 |
+
.amp-category-block ul, .category-widget-wrapper{
|
770 |
+
max-width: 1000px;
|
771 |
+
margin: 0 auto;
|
772 |
+
padding:0px 15px 5px 15px
|
773 |
+
}
|
774 |
+
.amp-category-post{
|
775 |
+
width: 32%;
|
776 |
+
display:inline-table;
|
777 |
+
}
|
778 |
+
.amp-category-post amp-img{
|
779 |
+
margin-bottom:5px;
|
780 |
+
}
|
781 |
+
.amp-category-block li:nth-child(3){
|
782 |
+
margin: 0 1%;
|
783 |
+
}
|
784 |
.searchmenu{
|
785 |
margin-right: 15px;
|
786 |
margin-top: 11px;
|
793 |
border:none
|
794 |
}
|
795 |
.headerlogo{
|
796 |
+
margin: 0 auto;
|
797 |
+
width: 80%;
|
798 |
+
text-align: center;
|
799 |
}
|
800 |
.headerlogo amp-img{
|
801 |
margin-top:6px
|
991 |
margin-top: 15px;
|
992 |
width: 100%;
|
993 |
}
|
994 |
+
#searchsubmit{opacity:0}
|
995 |
|
996 |
/* AMP carousel */
|
997 |
.amp-carousel-button-prev,
|
1052 |
float:right
|
1053 |
}
|
1054 |
|
1055 |
+
/* Tables */
|
1056 |
+
table a:link { color: #666; font-weight: bold; text-decoration: none; }
|
1057 |
+
table a:visited { color: #999999; font-weight: bold; text-decoration: none; }
|
1058 |
+
table a:active,
|
1059 |
+
table a:hover { color: #bd5a35; text-decoration: underline; }
|
1060 |
+
table { font-family: Arial, Helvetica, sans-serif; color: #666; font-size: 12px; text-shadow: 1px 1px 0px #fff; background: #eee; margin: 20px; width: 95%; }
|
1061 |
+
table th { padding: 21px 25px 22px 25px; border-top: 1px solid #fafafa; border-bottom: 1px solid #e0e0e0; background: #ededed; background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#ebebeb)); background: -moz-linear-gradient(top, #ededed, #ebebeb); }
|
1062 |
+
table th:first-child { text-align: left; padding-left: 20px; }
|
1063 |
+
table tr:first-child th:first-child { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; }
|
1064 |
+
table tr:first-child th:last-child { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
|
1065 |
+
table tr { text-align: center; padding-left: 20px; }
|
1066 |
+
table td:first-child { text-align: left; padding-left: 20px; border-left: 0; }
|
1067 |
+
table td { padding: 18px; border-top: 1px solid #ffffff; border-bottom: 1px solid #e0e0e0; border-left: 1px solid #e0e0e0; background: #fafafa; background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa)); background: -moz-linear-gradient(top, #fbfbfb, #fafafa); }
|
1068 |
+
table tr.even td { background: #f6f6f6; background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f6f6f6)); background: -moz-linear-gradient(top, #f8f8f8, #f6f6f6); }
|
1069 |
+
table tr:last-child td {border-bottom: 0;}
|
1070 |
+
table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
|
1071 |
+
table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
|
1072 |
+
table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
|
1073 |
|
1074 |
/* Responsive */
|
|
|
1075 |
@media screen and (min-width:1034px){
|
1076 |
.single-post figcaption{
|
1077 |
margin: -17px 17px 0 -17px;
|
1078 |
}
|
1079 |
}
|
1080 |
@media screen and (max-width: 768px) {
|
|
|
1081 |
.amp-wp-meta{ margin:10px 0px 15px 0px }
|
1082 |
.home-post_image{ width: 40%; }
|
1083 |
.amp-loop-list .amp-wp-post-content{ width: 58%; }
|
1091 |
@media screen and (max-width: 530px) {
|
1092 |
.home-post_image{ width: 35%; }
|
1093 |
.amp-loop-list .amp-wp-post-content{ width: 63%; }
|
1094 |
+
.amp-wp-post-content p { font-size: 12px; }
|
1095 |
+
.related_posts ol li p { line-height: 1.6; margin: 7px 0 0 0;}
|
1096 |
+
.comments_list ul li .comment-body {width:auto}
|
1097 |
+
.amp-category-block li:nth-child(3) {margin:0}
|
|
|
|
|
|
|
|
|
1098 |
}
|
1099 |
@media screen and (max-width: 425px) {
|
1100 |
.home-post_image{
|
1132 |
font-size: 17px;
|
1133 |
line-height: 1.5;
|
1134 |
}
|
|
|
1135 |
.single-post main .amp-wp-content h1{ line-height: 1.3; font-size: 26px;}
|
1136 |
.icono-share{display:none}
|
1137 |
.ampforwp-social-icons amp-social-share{ margin-right: 3px;}
|
1138 |
main .amp-wp-content{ font-size: 16px; line-height: 26px;}
|
1139 |
.single-post .amp_author_area .amp_author_area_wrapper{font-size:13px;}
|
1140 |
+
.amp-category-post{ font-size:12px; color:#666 }
|
1141 |
}
|
1142 |
@media screen and (max-width: 400px) {
|
1143 |
.amp-wp-title{
|
1218 |
amp-user-notification button {
|
1219 |
background-color: <?php echo sanitize_hex_color( $header_background_color ); ?>;;
|
1220 |
}
|
1221 |
+
<?php if( $redux_builder_amp['enable-single-social-icons'] == true && is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
|
1222 |
.single-post footer {
|
1223 |
padding-bottom: 41px;
|
1224 |
}
|
1346 |
text-align: center;
|
1347 |
}
|
1348 |
#ampsomething { display: none; }
|
1349 |
+
#header, .headerlogo a{ background:<?php echo $redux_builder_amp['amp-opt-color-rgba-headercolor']['color']; ?> }
|
1350 |
+
.nav_container, .comment-button-wrapper a , #pagination .next a, #pagination .prev a{
|
1351 |
background: <?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']; ?> ;
|
1352 |
}
|
1353 |
+
.toast:after, .toast:before, .toast span{
|
1354 |
+
background: <?php echo $redux_builder_amp['amp-opt-color-rgba-headerelements']['color']; ?> ;
|
1355 |
+
}
|
1356 |
+
[class*=icono-], .headerlogo a{ color: <?php echo $redux_builder_amp['amp-opt-color-rgba-headerelements']['color']; ?> }
|
1357 |
#pagination .next a, #pagination .prev a , #pagination .next a, #pagination .prev a , .comment-button-wrapper a {
|
1358 |
color: <?php echo $redux_builder_amp['amp-opt-color-rgba-font']['color']; ?> ;
|
1359 |
}
|
@@ -45,9 +45,18 @@
|
|
45 |
35. Disqus Comments Support
|
46 |
36. remove photon support in AMP
|
47 |
37. compatibility with wp-html-compression
|
48 |
-
38.
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
*/
|
52 |
// Adding AMP-related things to the main theme
|
53 |
global $redux_builder_amp;
|
@@ -86,6 +95,7 @@
|
|
86 |
|
87 |
function ampforwp_home_archive_rel_canonical() {
|
88 |
global $redux_builder_amp;
|
|
|
89 |
if( is_attachment() ) {
|
90 |
return;
|
91 |
}
|
@@ -117,9 +127,13 @@
|
|
117 |
//dont Echo anything
|
118 |
} else {
|
119 |
$supported_types = array('post','page');
|
120 |
-
|
121 |
-
|
122 |
-
|
|
|
|
|
|
|
|
|
123 |
}
|
124 |
}
|
125 |
|
@@ -135,24 +149,27 @@
|
|
135 |
|
136 |
if ( is_home() && $wp->query_vars['paged'] >= '2' ) {
|
137 |
$new_url = home_url('/');
|
138 |
-
$new_url = $new_url .
|
139 |
$amp_url = $new_url ;
|
140 |
}
|
141 |
if ( is_archive() && $wp->query_vars['paged'] >= '2' ) {
|
142 |
$new_url = home_url('/');
|
143 |
$category_path = $wp->request;
|
144 |
$explode_path = explode("/",$category_path);
|
145 |
-
$inserted = array(
|
146 |
array_splice( $explode_path, -2, 0, $inserted );
|
147 |
$impode_url = implode('/', $explode_path);
|
148 |
|
149 |
$amp_url = $new_url . $impode_url ;
|
150 |
}
|
151 |
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
|
|
|
|
|
|
156 |
|
157 |
if( $supported_amp_post_types) {
|
158 |
printf( '<link rel="amphtml" href="%s" />', esc_url( $amp_url ) );
|
@@ -200,13 +217,17 @@
|
|
200 |
$file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/archive.php';
|
201 |
}
|
202 |
|
203 |
-
if ( $redux_builder_amp['amp-design-selector'] == 3) {
|
204 |
-
if ( is_search() && $redux_builder_amp['amp-design-3-search-feature'] ) {
|
205 |
|
206 |
-
|
207 |
-
|
|
|
|
|
|
|
|
|
|
|
208 |
}
|
209 |
|
|
|
210 |
// Custom Single file
|
211 |
if ( is_single() || is_page() ) {
|
212 |
|
@@ -276,39 +297,57 @@
|
|
276 |
function ampforwp_register_additional_scripts() {
|
277 |
global $redux_builder_amp;
|
278 |
if( is_page() ) { ?>
|
279 |
-
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
|
280 |
<?php } ?>
|
281 |
-
|
282 |
<?php if($redux_builder_amp['amp-enable-notifications'] == true) { ?>
|
283 |
-
<script async custom-element="amp-user-notification" src="https://cdn.ampproject.org/v0/amp-user-notification-0.1.js"></script>
|
284 |
<?php } ?>
|
285 |
<?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) { ?>
|
286 |
-
<?php if( is_singular() ) {
|
287 |
-
|
288 |
-
|
|
|
|
|
289 |
} ?>
|
290 |
<?php if($redux_builder_amp['amp-frontpage-select-option'] == 1) { ?>
|
291 |
-
<?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) {
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
|
|
|
|
|
|
|
|
|
|
297 |
// 6.1 Adding Analytics Scripts
|
298 |
add_action('amp_post_template_head','ampforwp_register_analytics_script', 20);
|
299 |
function ampforwp_register_analytics_script(){ ?>
|
300 |
-
|
301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
|
|
|
303 |
}
|
304 |
|
305 |
// 7. Footer for AMP Pages
|
306 |
add_filter( 'amp_post_template_file', 'ampforwp_custom_footer', 10, 3 );
|
307 |
function ampforwp_custom_footer( $file, $type, $post ) {
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
}
|
313 |
|
314 |
add_action('ampforwp_global_after_footer','ampforwp_footer');
|
@@ -585,6 +624,7 @@
|
|
585 |
$content = preg_replace('/(<[^>]+) imap=".*?"/', '$1', $content);
|
586 |
$content = preg_replace('/(<[^>]+) date/', '$1', $content);
|
587 |
$content = preg_replace('/(<[^>]+) spellcheck/', '$1', $content);
|
|
|
588 |
|
589 |
//removing scripts and rel="nofollow" from Body and from divs
|
590 |
//issue #268
|
@@ -639,12 +679,17 @@
|
|
639 |
function ampforwp_update_metadata( $metadata, $post ) {
|
640 |
global $redux_builder_amp;
|
641 |
|
642 |
-
|
|
|
|
|
643 |
|
644 |
-
if ($
|
645 |
-
|
|
|
|
|
|
|
646 |
} else {
|
647 |
-
$structured_data_logo = $
|
648 |
}
|
649 |
$metadata['publisher']['logo'] = array(
|
650 |
'@type' => 'ImageObject',
|
@@ -676,13 +721,16 @@
|
|
676 |
function ampforwp_update_metadata_featured_image( $metadata, $post ) {
|
677 |
global $redux_builder_amp;
|
678 |
global $post;
|
679 |
-
$post_id =
|
680 |
$post_image_id = get_post_thumbnail_id( $post_id );
|
681 |
$structured_data_image = wp_get_attachment_image_src( $post_image_id, 'full' );
|
682 |
$post_image_check = $structured_data_image;
|
683 |
|
684 |
if ( $post_image_check == false) {
|
685 |
-
|
|
|
|
|
|
|
686 |
$structured_data_height = intval($redux_builder_amp['amp-structured-data-placeholder-image-height']);
|
687 |
$structured_data_width = intval($redux_builder_amp['amp-structured-data-placeholder-image-width']);
|
688 |
|
@@ -753,7 +801,7 @@ function ampforwp_title_custom_meta() {
|
|
753 |
if( $redux_builder_amp['amp-on-off-for-all-pages'] && $post_type == 'page' ) {
|
754 |
add_meta_box( 'ampforwp_title_meta', __( 'Show AMP for Current Page?' ), 'ampforwp_title_callback','page','side' );
|
755 |
}
|
756 |
-
|
757 |
}
|
758 |
}
|
759 |
}
|
@@ -889,7 +937,7 @@ add_action( 'template_redirect', 'ampforwp_remove_print_scripts' );
|
|
889 |
// 17. Archives Canonical in AMP version
|
890 |
// function ampforwp_rel_canonical_archive() {
|
891 |
//
|
892 |
-
// // $archivelink = esc_url( get_permalink( $id ) .
|
893 |
// echo "<link rel='canonical' href='$current_archive_url' />\n";
|
894 |
// }
|
895 |
// add_action( 'amp_post_template_head', 'ampforwp_rel_canonical_archive' );
|
@@ -898,7 +946,7 @@ add_action( 'template_redirect', 'ampforwp_remove_print_scripts' );
|
|
898 |
// function ampforwp_rel_canonical() {
|
899 |
// if ( !is_home() )
|
900 |
// return;
|
901 |
-
// // $link = esc_url( get_permalink( $id ) .
|
902 |
// $homelink = get_home_url();
|
903 |
// echo "<link rel='canonical' href='$homelink' />\n";
|
904 |
// }
|
@@ -908,7 +956,7 @@ add_action( 'template_redirect', 'ampforwp_remove_print_scripts' );
|
|
908 |
// function ampforwp_rel_canonical_frontpage() {
|
909 |
// if ( is_home() || is_front_page() )
|
910 |
// return;
|
911 |
-
// // $link = esc_url( get_permalink( $id ) .
|
912 |
// $homelink = get_home_url();
|
913 |
// echo "<link rel='canonical' href='$homelink' />\n";
|
914 |
// }
|
@@ -1004,9 +1052,11 @@ function ampforwp_sticky_social_icons(){
|
|
1004 |
//
|
1005 |
// }
|
1006 |
// add_action('amp_post_template_head','ampforwp_register_social_sharing_script');
|
1007 |
-
function ampforwp_register_social_sharing_script() {
|
1008 |
-
|
|
|
1009 |
<?php }
|
|
|
1010 |
|
1011 |
// 25. Yoast meta Support
|
1012 |
function ampforwp_custom_yoast_meta(){
|
@@ -1127,6 +1177,10 @@ function ampforwp_remove_title_tags(){
|
|
1127 |
}
|
1128 |
}
|
1129 |
echo $site_title ;
|
|
|
|
|
|
|
|
|
1130 |
} ?>
|
1131 |
</title>
|
1132 |
<?php
|
@@ -1140,6 +1194,7 @@ function ampforwp_remove_title_tags(){
|
|
1140 |
if ( $ampforwp_is_amp_endpoint ) {
|
1141 |
$content_buffer = preg_replace("/' defer='defer/", "", $content_buffer);
|
1142 |
$content_buffer = preg_replace("/' defer onload='/", "", $content_buffer);
|
|
|
1143 |
$content_buffer = preg_replace("/onclick=[^>]*/", "", $content_buffer);
|
1144 |
$content_buffer = preg_replace("/<\\/?thrive_headline(.|\\s)*?>/",'',$content_buffer);
|
1145 |
// Remove Extra styling added by other Themes/ Plugins
|
@@ -1202,6 +1257,33 @@ function ampforwp_remove_js_script_cleantalk() {
|
|
1202 |
remove_action('wp_loaded', 'ct_add_nocache_script', 1);
|
1203 |
}
|
1204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1205 |
|
1206 |
//33. Google tag manager support added
|
1207 |
// Remove any old scripts that have been loaded by other Plugins
|
@@ -1260,39 +1342,43 @@ function ampforwp_add_disqus_support() {
|
|
1260 |
|
1261 |
global $redux_builder_amp;
|
1262 |
if ( $redux_builder_amp['ampforwp-disqus-comments-support'] ) {
|
|
|
|
|
1263 |
|
1264 |
-
|
1265 |
|
1266 |
-
|
|
|
|
|
1267 |
|
1268 |
-
|
1269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1270 |
}
|
1271 |
-
|
1272 |
-
$disqus_url = $disqus_script_host_url.'?disqus_title='.$post_slug.'&url='.get_permalink().'&disqus_name='. esc_url( $redux_builder_amp['ampforwp-disqus-comments-name'] ) ."/embed.js" ;
|
1273 |
-
?>
|
1274 |
-
<section class="amp-wp-content post-comments amp-wp-article-content amp-disqus-comments" id="comments">
|
1275 |
-
<amp-iframe
|
1276 |
-
height="350"
|
1277 |
-
sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"
|
1278 |
-
resizable
|
1279 |
-
frameborder="0"
|
1280 |
-
src="<?php echo $disqus_url ?>" >
|
1281 |
-
<div overflow tabindex="0" role="button" aria-label="Read more"> Disqus Comments Loading...</div>
|
1282 |
-
</amp-iframe>
|
1283 |
-
</section>
|
1284 |
-
<?php
|
1285 |
}
|
1286 |
}
|
1287 |
|
1288 |
-
|
1289 |
function ampforwp_add_disqus_scripts( $data ) {
|
1290 |
global $redux_builder_amp;
|
1291 |
-
if ( $redux_builder_amp['ampforwp-disqus-comments-support'] ) {
|
1292 |
if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
|
1293 |
$data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
|
1294 |
}
|
1295 |
}
|
|
|
|
|
1296 |
return $data;
|
1297 |
}
|
1298 |
|
@@ -1317,15 +1403,14 @@ add_action('amp_init','ampforwp_copat_wp_html_compression');
|
|
1317 |
|
1318 |
//38. Extra Design Specific Features
|
1319 |
add_action('pre_amp_render_post','ampforwp_add_extra_functions',12);
|
1320 |
-
function ampforwp_add_extra_functions(){
|
1321 |
global $redux_builder_amp;
|
1322 |
-
if ( $redux_builder_amp['amp-design-selector'] == 3) {
|
1323 |
-
|
1324 |
-
require AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/functions.php';
|
1325 |
}
|
1326 |
}
|
1327 |
|
1328 |
-
//
|
1329 |
add_filter( 'get_the_archive_title', 'ampforwp_editable_archvies_title' );
|
1330 |
function ampforwp_editable_archvies_title($title) {
|
1331 |
global $redux_builder_amp;
|
@@ -1337,35 +1422,7 @@ function ampforwp_editable_archvies_title($title) {
|
|
1337 |
return $title;
|
1338 |
}
|
1339 |
|
1340 |
-
//
|
1341 |
-
add_filter( 'amp_init', 'ampforwp_lazy_loading_plugins_compatibility' );
|
1342 |
-
function ampforwp_lazy_loading_plugins_compatibility() {
|
1343 |
-
|
1344 |
-
//WP Rocket
|
1345 |
-
add_filter( 'do_rocket_lazyload', '__return_false', PHP_INT_MAX );
|
1346 |
-
add_filter( 'do_rocket_lazyload_iframes', '__return_false', PHP_INT_MAX );
|
1347 |
-
|
1348 |
-
//Lazy Load XT
|
1349 |
-
global $lazyloadxt;
|
1350 |
-
remove_filter( 'the_content', array( $lazyloadxt, 'filter_html' ) );
|
1351 |
-
remove_filter( 'widget_text', array( $lazyloadxt, 'filter_html' ) );
|
1352 |
-
remove_filter( 'post_thumbnail_html', array( $lazyloadxt, 'filter_html' ) );
|
1353 |
-
remove_filter( 'get_avatar', array( $lazyloadxt, 'filter_html' ) );
|
1354 |
-
|
1355 |
-
// Lazy Load
|
1356 |
-
add_filter( 'lazyload_is_enabled', '__return_false', PHP_INT_MAX );
|
1357 |
-
|
1358 |
-
}
|
1359 |
-
|
1360 |
-
//Removing bj loading for amp
|
1361 |
-
function ampforwp_remove_bj_load() {
|
1362 |
-
if ( function_exists( 'ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint() ) {
|
1363 |
-
add_filter( 'bjll/enabled', '__return_false' );
|
1364 |
-
}
|
1365 |
-
}
|
1366 |
-
add_action( 'bjll/compat', 'ampforwp_remove_bj_load' );
|
1367 |
-
|
1368 |
-
//33. #560 Header and Footer Editable html enabled script area
|
1369 |
add_action('amp_post_template_footer','ampforwp_footer_html_output',11);
|
1370 |
function ampforwp_footer_html_output() {
|
1371 |
global $redux_builder_amp;
|
@@ -1383,12 +1440,12 @@ function ampforwp_header_html_output() {
|
|
1383 |
}
|
1384 |
|
1385 |
|
1386 |
-
//
|
1387 |
add_action('amp_post_template_head' , 'ampforwp_talking_to_robots');
|
1388 |
function ampforwp_talking_to_robots() {
|
1389 |
|
1390 |
global $redux_builder_amp;
|
1391 |
-
$message_to_robots = '<meta name="robots" content="noindex,
|
1392 |
$talk_to_robots=false;
|
1393 |
|
1394 |
//author arhives index/noindex
|
@@ -1401,8 +1458,18 @@ function ampforwp_talking_to_robots() {
|
|
1401 |
$talk_to_robots = true;
|
1402 |
}
|
1403 |
|
1404 |
-
//
|
1405 |
-
if( (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1406 |
$talk_to_robots = true;
|
1407 |
}
|
1408 |
|
@@ -1426,3 +1493,201 @@ function ampforwp_talking_to_robots() {
|
|
1426 |
|
1427 |
}
|
1428 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
35. Disqus Comments Support
|
46 |
36. remove photon support in AMP
|
47 |
37. compatibility with wp-html-compression
|
48 |
+
38. #529 editable archives
|
49 |
+
39. #560 Header and Footer Editable html enabled script area
|
50 |
+
40. Meta Robots
|
51 |
+
41. Rewrite URL only on save #511
|
52 |
+
42. registeing AMP sidebars
|
53 |
+
43. custom actions for widgets output
|
54 |
+
44. auto adding /amp for the menu
|
55 |
+
45. search,frontpage,homepage structured data
|
56 |
+
46. search search search everywhere #615
|
57 |
+
47. social js properly adding when required
|
58 |
+
48. Remove all unwanted scripts on search pages
|
59 |
+
49. Properly adding ad Script the AMP way
|
60 |
*/
|
61 |
// Adding AMP-related things to the main theme
|
62 |
global $redux_builder_amp;
|
95 |
|
96 |
function ampforwp_home_archive_rel_canonical() {
|
97 |
global $redux_builder_amp;
|
98 |
+
global $wp;
|
99 |
if( is_attachment() ) {
|
100 |
return;
|
101 |
}
|
127 |
//dont Echo anything
|
128 |
} else {
|
129 |
$supported_types = array('post','page');
|
130 |
+
|
131 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
132 |
+
if( is_plugin_active( 'AMP-Custom-Post-Type/amp-custom-post-type.php' ) ) {
|
133 |
+
if ( $redux_builder_amp['ampforwp-custom-type'] ) {
|
134 |
+
foreach($redux_builder_amp['ampforwp-custom-type'] as $custom_post){
|
135 |
+
$supported_types[] = $custom_post;
|
136 |
+
}
|
137 |
}
|
138 |
}
|
139 |
|
149 |
|
150 |
if ( is_home() && $wp->query_vars['paged'] >= '2' ) {
|
151 |
$new_url = home_url('/');
|
152 |
+
$new_url = $new_url . AMPFORWP_AMP_QUERY_VAR . '/' . $wp->request ;
|
153 |
$amp_url = $new_url ;
|
154 |
}
|
155 |
if ( is_archive() && $wp->query_vars['paged'] >= '2' ) {
|
156 |
$new_url = home_url('/');
|
157 |
$category_path = $wp->request;
|
158 |
$explode_path = explode("/",$category_path);
|
159 |
+
$inserted = array(AMPFORWP_AMP_QUERY_VAR);
|
160 |
array_splice( $explode_path, -2, 0, $inserted );
|
161 |
$impode_url = implode('/', $explode_path);
|
162 |
|
163 |
$amp_url = $new_url . $impode_url ;
|
164 |
}
|
165 |
|
166 |
+
if( is_search() ) {
|
167 |
+
$current_search_url =trailingslashit(get_home_url())."?amp=1&s=".get_search_query();
|
168 |
+
if ( $wp->query_vars['paged'] >= '2' ) {
|
169 |
+
$current_search_url =trailingslashit(get_home_url()) . $wp->request .'/'."?amp=1&s=".get_search_query();
|
170 |
+
}
|
171 |
+
$amp_url = untrailingslashit($current_search_url);
|
172 |
+
}
|
173 |
|
174 |
if( $supported_amp_post_types) {
|
175 |
printf( '<link rel="amphtml" href="%s" />', esc_url( $amp_url ) );
|
217 |
$file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/archive.php';
|
218 |
}
|
219 |
|
|
|
|
|
220 |
|
221 |
+
// Search pages
|
222 |
+
if ( is_search() &&
|
223 |
+
( $redux_builder_amp['amp-design-1-search-feature'] ||
|
224 |
+
$redux_builder_amp['amp-design-2-search-feature'] ||
|
225 |
+
$redux_builder_amp['amp-design-3-search-feature'] )
|
226 |
+
) {
|
227 |
+
$file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/search.php';
|
228 |
}
|
229 |
|
230 |
+
|
231 |
// Custom Single file
|
232 |
if ( is_single() || is_page() ) {
|
233 |
|
297 |
function ampforwp_register_additional_scripts() {
|
298 |
global $redux_builder_amp;
|
299 |
if( is_page() ) { ?>
|
300 |
+
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
|
301 |
<?php } ?>
|
302 |
+
|
303 |
<?php if($redux_builder_amp['amp-enable-notifications'] == true) { ?>
|
304 |
+
<script async custom-element="amp-user-notification" src="https://cdn.ampproject.org/v0/amp-user-notification-0.1.js"></script>
|
305 |
<?php } ?>
|
306 |
<?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) { ?>
|
307 |
+
<?php if( is_singular() ) {
|
308 |
+
if( is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
|
309 |
+
<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
|
310 |
+
<?php }
|
311 |
+
}
|
312 |
} ?>
|
313 |
<?php if($redux_builder_amp['amp-frontpage-select-option'] == 1) { ?>
|
314 |
+
<?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) {
|
315 |
+
if( is_home() ) {
|
316 |
+
if( is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
|
317 |
+
<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
|
318 |
+
<?php }
|
319 |
+
}
|
320 |
+
}
|
321 |
+
}
|
322 |
+
// Check if any of the ads are enabled then only load ads script
|
323 |
+
// moved this code to its own function and done the AMP way
|
324 |
+
}
|
325 |
// 6.1 Adding Analytics Scripts
|
326 |
add_action('amp_post_template_head','ampforwp_register_analytics_script', 20);
|
327 |
function ampforwp_register_analytics_script(){ ?>
|
328 |
+
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
|
329 |
+
<?php
|
330 |
+
|
331 |
+
}
|
332 |
+
|
333 |
+
add_filter( 'amp_post_template_data', 'ampforwp_add_amp_related_scripts', 20 );
|
334 |
+
function ampforwp_add_amp_related_scripts( $data ) {
|
335 |
+
global $redux_builder_amp;
|
336 |
+
// Adding Sidebar Script
|
337 |
+
if ( empty( $data['amp_component_scripts']['amp-sidebar'] ) ) {
|
338 |
+
$data['amp_component_scripts']['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js';
|
339 |
+
}
|
340 |
|
341 |
+
return $data;
|
342 |
}
|
343 |
|
344 |
// 7. Footer for AMP Pages
|
345 |
add_filter( 'amp_post_template_file', 'ampforwp_custom_footer', 10, 3 );
|
346 |
function ampforwp_custom_footer( $file, $type, $post ) {
|
347 |
+
if ( 'footer' === $type ) {
|
348 |
+
$file = AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-'. ampforwp_design_selector() .'/footer.php';
|
349 |
+
}
|
350 |
+
return $file;
|
351 |
}
|
352 |
|
353 |
add_action('ampforwp_global_after_footer','ampforwp_footer');
|
624 |
$content = preg_replace('/(<[^>]+) imap=".*?"/', '$1', $content);
|
625 |
$content = preg_replace('/(<[^>]+) date/', '$1', $content);
|
626 |
$content = preg_replace('/(<[^>]+) spellcheck/', '$1', $content);
|
627 |
+
$content = preg_replace('/<font(.*?)>(.*?)<\/font>/', '$2', $content);
|
628 |
|
629 |
//removing scripts and rel="nofollow" from Body and from divs
|
630 |
//issue #268
|
679 |
function ampforwp_update_metadata( $metadata, $post ) {
|
680 |
global $redux_builder_amp;
|
681 |
|
682 |
+
if (! empty( $redux_builder_amp['opt-media']['url'] ) ) {
|
683 |
+
$structured_data_main_logo = $redux_builder_amp['opt-media']['url'];
|
684 |
+
}
|
685 |
|
686 |
+
if (! empty( $redux_builder_amp['amp-structured-data-logo']['url'] ) ) {
|
687 |
+
$structured_data_logo = $redux_builder_amp['amp-structured-data-logo']['url'];
|
688 |
+
}
|
689 |
+
if ( $structured_data_logo ) {
|
690 |
+
$structured_data_logo = $structured_data_logo;
|
691 |
} else {
|
692 |
+
$structured_data_logo = $structured_data_main_logo;
|
693 |
}
|
694 |
$metadata['publisher']['logo'] = array(
|
695 |
'@type' => 'ImageObject',
|
721 |
function ampforwp_update_metadata_featured_image( $metadata, $post ) {
|
722 |
global $redux_builder_amp;
|
723 |
global $post;
|
724 |
+
$post_id = get_the_ID() ;
|
725 |
$post_image_id = get_post_thumbnail_id( $post_id );
|
726 |
$structured_data_image = wp_get_attachment_image_src( $post_image_id, 'full' );
|
727 |
$post_image_check = $structured_data_image;
|
728 |
|
729 |
if ( $post_image_check == false) {
|
730 |
+
if (! empty( $redux_builder_amp['amp-structured-data-placeholder-image']['url'] ) ) {
|
731 |
+
$structured_data_image_url = $redux_builder_amp['amp-structured-data-placeholder-image']['url'];
|
732 |
+
}
|
733 |
+
$structured_data_image = $structured_data_image_url;
|
734 |
$structured_data_height = intval($redux_builder_amp['amp-structured-data-placeholder-image-height']);
|
735 |
$structured_data_width = intval($redux_builder_amp['amp-structured-data-placeholder-image-width']);
|
736 |
|
801 |
if( $redux_builder_amp['amp-on-off-for-all-pages'] && $post_type == 'page' ) {
|
802 |
add_meta_box( 'ampforwp_title_meta', __( 'Show AMP for Current Page?' ), 'ampforwp_title_callback','page','side' );
|
803 |
}
|
804 |
+
|
805 |
}
|
806 |
}
|
807 |
}
|
937 |
// 17. Archives Canonical in AMP version
|
938 |
// function ampforwp_rel_canonical_archive() {
|
939 |
//
|
940 |
+
// // $archivelink = esc_url( get_permalink( $id ) . AMPFORWP_AMP_QUERY_VAR . '/' );
|
941 |
// echo "<link rel='canonical' href='$current_archive_url' />\n";
|
942 |
// }
|
943 |
// add_action( 'amp_post_template_head', 'ampforwp_rel_canonical_archive' );
|
946 |
// function ampforwp_rel_canonical() {
|
947 |
// if ( !is_home() )
|
948 |
// return;
|
949 |
+
// // $link = esc_url( get_permalink( $id ) . AMPFORWP_AMP_QUERY_VAR . '/' );
|
950 |
// $homelink = get_home_url();
|
951 |
// echo "<link rel='canonical' href='$homelink' />\n";
|
952 |
// }
|
956 |
// function ampforwp_rel_canonical_frontpage() {
|
957 |
// if ( is_home() || is_front_page() )
|
958 |
// return;
|
959 |
+
// // $link = esc_url( get_permalink( $id ) . AMPFORWP_AMP_QUERY_VAR . '/' );
|
960 |
// $homelink = get_home_url();
|
961 |
// echo "<link rel='canonical' href='$homelink' />\n";
|
962 |
// }
|
1052 |
//
|
1053 |
// }
|
1054 |
// add_action('amp_post_template_head','ampforwp_register_social_sharing_script');
|
1055 |
+
function ampforwp_register_social_sharing_script() {
|
1056 |
+
if( is_socialshare_or_socialsticky_enabled_in_ampforwp() ) { ?>
|
1057 |
+
<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
|
1058 |
<?php }
|
1059 |
+
}
|
1060 |
|
1061 |
// 25. Yoast meta Support
|
1062 |
function ampforwp_custom_yoast_meta(){
|
1177 |
}
|
1178 |
}
|
1179 |
echo $site_title ;
|
1180 |
+
}
|
1181 |
+
|
1182 |
+
if( is_search() ) {
|
1183 |
+
echo $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();
|
1184 |
} ?>
|
1185 |
</title>
|
1186 |
<?php
|
1194 |
if ( $ampforwp_is_amp_endpoint ) {
|
1195 |
$content_buffer = preg_replace("/' defer='defer/", "", $content_buffer);
|
1196 |
$content_buffer = preg_replace("/' defer onload='/", "", $content_buffer);
|
1197 |
+
$content_buffer = preg_replace("/' defer /", "", $content_buffer);
|
1198 |
$content_buffer = preg_replace("/onclick=[^>]*/", "", $content_buffer);
|
1199 |
$content_buffer = preg_replace("/<\\/?thrive_headline(.|\\s)*?>/",'',$content_buffer);
|
1200 |
// Remove Extra styling added by other Themes/ Plugins
|
1257 |
remove_action('wp_loaded', 'ct_add_nocache_script', 1);
|
1258 |
}
|
1259 |
|
1260 |
+
//32. various lazy loading plugins Support
|
1261 |
+
add_filter( 'amp_init', 'ampforwp_lazy_loading_plugins_compatibility' );
|
1262 |
+
function ampforwp_lazy_loading_plugins_compatibility() {
|
1263 |
+
|
1264 |
+
//WP Rocket
|
1265 |
+
add_filter( 'do_rocket_lazyload', '__return_false', PHP_INT_MAX );
|
1266 |
+
add_filter( 'do_rocket_lazyload_iframes', '__return_false', PHP_INT_MAX );
|
1267 |
+
|
1268 |
+
//Lazy Load XT
|
1269 |
+
global $lazyloadxt;
|
1270 |
+
remove_filter( 'the_content', array( $lazyloadxt, 'filter_html' ) );
|
1271 |
+
remove_filter( 'widget_text', array( $lazyloadxt, 'filter_html' ) );
|
1272 |
+
remove_filter( 'post_thumbnail_html', array( $lazyloadxt, 'filter_html' ) );
|
1273 |
+
remove_filter( 'get_avatar', array( $lazyloadxt, 'filter_html' ) );
|
1274 |
+
|
1275 |
+
// Lazy Load
|
1276 |
+
add_filter( 'lazyload_is_enabled', '__return_false', PHP_INT_MAX );
|
1277 |
+
|
1278 |
+
}
|
1279 |
+
|
1280 |
+
//Removing bj loading for amp
|
1281 |
+
function ampforwp_remove_bj_load() {
|
1282 |
+
if ( function_exists( 'ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint() ) {
|
1283 |
+
add_filter( 'bjll/enabled', '__return_false' );
|
1284 |
+
}
|
1285 |
+
}
|
1286 |
+
add_action( 'bjll/compat', 'ampforwp_remove_bj_load' );
|
1287 |
|
1288 |
//33. Google tag manager support added
|
1289 |
// Remove any old scripts that have been loaded by other Plugins
|
1342 |
|
1343 |
global $redux_builder_amp;
|
1344 |
if ( $redux_builder_amp['ampforwp-disqus-comments-support'] ) {
|
1345 |
+
if( $redux_builder_amp['ampforwp-disqus-comments-name'] !== '' ) {
|
1346 |
+
global $post; $post_slug=$post->post_name;
|
1347 |
|
1348 |
+
$disqus_script_host_url = "https://ampforwp.appspot.com/?api=". AMPFORWP_DISQUS_URL;
|
1349 |
|
1350 |
+
if( $redux_builder_amp['ampforwp-disqus-host-position'] == 0 ) {
|
1351 |
+
$disqus_script_host_url = esc_url( $redux_builder_amp['ampforwp-disqus-host-file'] );
|
1352 |
+
}
|
1353 |
|
1354 |
+
$disqus_url = $disqus_script_host_url.'?disqus_title='.$post_slug.'&url='.get_permalink().'&disqus_name='. esc_url( $redux_builder_amp['ampforwp-disqus-comments-name'] ) ."/embed.js" ;
|
1355 |
+
?>
|
1356 |
+
<section class="amp-wp-content post-comments amp-wp-article-content amp-disqus-comments" id="comments">
|
1357 |
+
<amp-iframe
|
1358 |
+
height=200
|
1359 |
+
width=300
|
1360 |
+
layout="responsive"
|
1361 |
+
sandbox="allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"
|
1362 |
+
frameborder="0"
|
1363 |
+
src="<?php echo $disqus_url ?>" >
|
1364 |
+
<div overflow tabindex="0" role="button" aria-label="Read more"> Disqus Comments Loading...</div>
|
1365 |
+
</amp-iframe>
|
1366 |
+
</section>
|
1367 |
+
<?php
|
1368 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1369 |
}
|
1370 |
}
|
1371 |
|
1372 |
+
add_filter( 'amp_post_template_data', 'ampforwp_add_disqus_scripts' );
|
1373 |
function ampforwp_add_disqus_scripts( $data ) {
|
1374 |
global $redux_builder_amp;
|
1375 |
+
if ( $redux_builder_amp['ampforwp-disqus-comments-support'] && is_singular() ) {
|
1376 |
if ( empty( $data['amp_component_scripts']['amp-iframe'] ) ) {
|
1377 |
$data['amp_component_scripts']['amp-iframe'] = 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js';
|
1378 |
}
|
1379 |
}
|
1380 |
+
// remove direction attribute from the AMP HTMl #541
|
1381 |
+
unset( $data['html_tag_attributes']['dir'] );
|
1382 |
return $data;
|
1383 |
}
|
1384 |
|
1403 |
|
1404 |
//38. Extra Design Specific Features
|
1405 |
add_action('pre_amp_render_post','ampforwp_add_extra_functions',12);
|
1406 |
+
function ampforwp_add_extra_functions() {
|
1407 |
global $redux_builder_amp;
|
1408 |
+
if ( $redux_builder_amp['amp-design-selector'] == 3 ) {
|
1409 |
+
require AMPFORWP_PLUGIN_DIR . '/templates/design-manager/design-3/functions.php';
|
|
|
1410 |
}
|
1411 |
}
|
1412 |
|
1413 |
+
//38. #529 editable archives
|
1414 |
add_filter( 'get_the_archive_title', 'ampforwp_editable_archvies_title' );
|
1415 |
function ampforwp_editable_archvies_title($title) {
|
1416 |
global $redux_builder_amp;
|
1422 |
return $title;
|
1423 |
}
|
1424 |
|
1425 |
+
//39. #560 Header and Footer Editable html enabled script area
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1426 |
add_action('amp_post_template_footer','ampforwp_footer_html_output',11);
|
1427 |
function ampforwp_footer_html_output() {
|
1428 |
global $redux_builder_amp;
|
1440 |
}
|
1441 |
|
1442 |
|
1443 |
+
//40. Meta Robots
|
1444 |
add_action('amp_post_template_head' , 'ampforwp_talking_to_robots');
|
1445 |
function ampforwp_talking_to_robots() {
|
1446 |
|
1447 |
global $redux_builder_amp;
|
1448 |
+
$message_to_robots = '<meta name="robots" content="noindex,nofollow"/>';
|
1449 |
$talk_to_robots=false;
|
1450 |
|
1451 |
//author arhives index/noindex
|
1458 |
$talk_to_robots = true;
|
1459 |
}
|
1460 |
|
1461 |
+
//Search pages noindexing by default
|
1462 |
+
if( is_search() ) {
|
1463 |
+
$talk_to_robots = true;
|
1464 |
+
}
|
1465 |
+
|
1466 |
+
//categorys index/noindex
|
1467 |
+
if( is_category() && !$redux_builder_amp['ampforwp-robots-archive-category-pages'] ) {
|
1468 |
+
$talk_to_robots = true;
|
1469 |
+
}
|
1470 |
+
|
1471 |
+
//categorys index/noindex
|
1472 |
+
if( is_tag() && !$redux_builder_amp['ampforwp-robots-archive-tag-pages'] ) {
|
1473 |
$talk_to_robots = true;
|
1474 |
}
|
1475 |
|
1493 |
|
1494 |
}
|
1495 |
|
1496 |
+
// 41. Rewrite URL only on save #511
|
1497 |
+
function ampforwp_auto_flush_on_save($redux_builder_amp) {
|
1498 |
+
if ( $redux_builder_amp['amp-on-off-for-all-pages'] == 1 || $redux_builder_amp['ampforwp-archive-support'] == 1 ) {
|
1499 |
+
global $wp_rewrite;
|
1500 |
+
$wp_rewrite->flush_rules();
|
1501 |
+
}
|
1502 |
+
}
|
1503 |
+
add_action("redux/options/redux_builder_amp/saved",'ampforwp_auto_flush_on_save', 10, 1);
|
1504 |
+
|
1505 |
+
// 42. registeing AMP sidebars
|
1506 |
+
if (function_exists('register_sidebar')) {
|
1507 |
+
|
1508 |
+
register_sidebar(array(
|
1509 |
+
'name' => 'AMP Above Loop',
|
1510 |
+
'id' => 'ampforwp-above-loop',
|
1511 |
+
'description' => 'Widget area for above the Loop Output',
|
1512 |
+
'before_widget' => '<div class="category-widget-wrapper"><div class="category-widget-gutter">',
|
1513 |
+
'after_widget' => '</div></div>',
|
1514 |
+
'before_title' => '<h4>',
|
1515 |
+
'after_title' => '</h4>'
|
1516 |
+
));
|
1517 |
+
register_sidebar(array(
|
1518 |
+
'name' => 'AMP Below Loop',
|
1519 |
+
'id' => 'ampforwp-below-loop',
|
1520 |
+
'description' => 'Widget area for below the Loop Output',
|
1521 |
+
'before_widget' => '<div class="category-widget-wrapper"><div class="category-widget-gutter">',
|
1522 |
+
'after_widget' => '</div></div>',
|
1523 |
+
'before_title' => '<h4>',
|
1524 |
+
'after_title' => '</h4>'
|
1525 |
+
));
|
1526 |
+
|
1527 |
+
}
|
1528 |
+
|
1529 |
+
// 43. custom actions for widgets output
|
1530 |
+
add_action( 'ampforwp_home_above_loop' , 'ampforwp_output_widget_content_above_loop' );
|
1531 |
+
function ampforwp_output_widget_content_above_loop() {
|
1532 |
+
dynamic_sidebar( 'ampforwp-above-loop' );
|
1533 |
+
}
|
1534 |
+
|
1535 |
+
add_action( 'ampforwp_home_below_loop' , 'ampforwp_output_widget_content_below_loop' );
|
1536 |
+
function ampforwp_output_widget_content_below_loop() {
|
1537 |
+
dynamic_sidebar( 'ampforwp-below-loop' );
|
1538 |
+
}
|
1539 |
+
|
1540 |
+
// 44. auto adding /amp for the menu
|
1541 |
+
add_action('amp_init','ampforwp_auto_add_amp_menu_link_insert');
|
1542 |
+
function ampforwp_auto_add_amp_menu_link_insert() {
|
1543 |
+
add_action( 'wp', 'ampforwp_auto_add_amp_in_link_check' );
|
1544 |
+
}
|
1545 |
+
|
1546 |
+
function ampforwp_auto_add_amp_in_link_check() {
|
1547 |
+
global $redux_builder_amp;
|
1548 |
+
$ampforwp_is_amp_endpoint = ampforwp_is_amp_endpoint();
|
1549 |
+
|
1550 |
+
if ( $ampforwp_is_amp_endpoint && $redux_builder_amp['ampforwp-auto-amp-menu-link'] == 1 ) {
|
1551 |
+
add_filter( 'nav_menu_link_attributes', 'ampforwp_auto_add_amp_in_menu_link', 10, 3 );
|
1552 |
+
}
|
1553 |
+
}
|
1554 |
+
|
1555 |
+
function ampforwp_auto_add_amp_in_menu_link( $atts, $item, $args ) {
|
1556 |
+
|
1557 |
+
$atts['href'] = trailingslashit( $atts['href'] ) . AMPFORWP_AMP_QUERY_VAR;
|
1558 |
+
return $atts;
|
1559 |
+
}
|
1560 |
+
|
1561 |
+
|
1562 |
+
// 45. searchpage, frontpage, homepage structured data
|
1563 |
+
add_filter( 'amp_post_template_metadata', 'ampforwp_search_or_homepage_or_staticpage_metadata', 10, 2 );
|
1564 |
+
function ampforwp_search_or_homepage_or_staticpage_metadata( $metadata, $post ) {
|
1565 |
+
global $redux_builder_amp;
|
1566 |
+
|
1567 |
+
if( is_search() || is_home() || ( is_front_page() && $redux_builder_amp['amp-frontpage-select-option'] )) {
|
1568 |
+
|
1569 |
+
if( is_home() || is_front_page() ){
|
1570 |
+
global $wp;
|
1571 |
+
$current_url = home_url( $wp->request );
|
1572 |
+
$current_url = dirname( $current_url );
|
1573 |
+
$headline = get_bloginfo('name') . ' | ' . get_option( 'blogdescription' );
|
1574 |
+
} else {
|
1575 |
+
$current_url = trailingslashit(get_home_url())."?s=".get_search_query();
|
1576 |
+
$current_url = untrailingslashit( $current_url );
|
1577 |
+
$headline = $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();
|
1578 |
+
}
|
1579 |
+
|
1580 |
+
// placeholder Image area
|
1581 |
+
if (! empty( $redux_builder_amp['amp-structured-data-placeholder-image']['url'] ) ) {
|
1582 |
+
$structured_data_image_url = $redux_builder_amp['amp-structured-data-placeholder-image']['url'];
|
1583 |
+
}
|
1584 |
+
$structured_data_image = $structured_data_image_url; // Placeholder Image URL
|
1585 |
+
$structured_data_height = intval($redux_builder_amp['amp-structured-data-placeholder-image-height']); // Placeholder Image width
|
1586 |
+
$structured_data_width = intval($redux_builder_amp['amp-structured-data-placeholder-image-width']); // Placeholder Image height
|
1587 |
+
|
1588 |
+
if( is_front_page() ) {
|
1589 |
+
$ID = $redux_builder_amp['amp-frontpage-select-option-pages']; // ID of slected front page
|
1590 |
+
$headline = get_the_title( $ID ) . ' | ' . get_option('blogname');
|
1591 |
+
$static_page_data = get_post( $ID );
|
1592 |
+
|
1593 |
+
$datePublished = $static_page_data->post_date;
|
1594 |
+
$dateModified = $static_page_data->post_modified;
|
1595 |
+
|
1596 |
+
$featured_image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $ID ) ); // Featured Image structured Data
|
1597 |
+
if( $featured_image_array ) {
|
1598 |
+
$structured_data_image = $featured_image_array[0];
|
1599 |
+
$structured_data_image = $featured_image_array[1];
|
1600 |
+
$structured_data_image = $featured_image_array[2];
|
1601 |
+
}
|
1602 |
+
} else {
|
1603 |
+
// To DO : check the entire else section .... time for search and homepage...wierd ???
|
1604 |
+
$datePublished = date( 'Y-m-d H:i:s', current_time( 'timestamp', 0 ) - 2 );
|
1605 |
+
// time difference is 2 minute between published and modified date
|
1606 |
+
$dateModified = date( 'Y-m-d H:i:s', current_time( 'timestamp', 0 ) );
|
1607 |
+
}
|
1608 |
+
$metadata['datePublished'] = $datePublished; // proper published date added
|
1609 |
+
$metadata['dateModified'] = $dateModified; // proper modified date
|
1610 |
+
|
1611 |
+
$metadata['image'] = array(
|
1612 |
+
'@type' => 'ImageObject',
|
1613 |
+
'url' => $structured_data_image ,
|
1614 |
+
'height' => $structured_data_height,
|
1615 |
+
'width' => $structured_data_width,
|
1616 |
+
);
|
1617 |
+
|
1618 |
+
$metadata['mainEntityOfPage'] = $current_url; // proper URL added
|
1619 |
+
$metadata['headline'] = $headline; // proper headline added
|
1620 |
+
}
|
1621 |
+
return $metadata;
|
1622 |
+
}
|
1623 |
+
|
1624 |
+
|
1625 |
+
// 46. search search search everywhere #615
|
1626 |
+
require 'search-functions.php';
|
1627 |
+
|
1628 |
+
// 47. social js properly adding when required
|
1629 |
+
if( !function_exists( 'is_socialshare_or_socialsticky_enabled_in_ampforwp' ) ) {
|
1630 |
+
function is_socialshare_or_socialsticky_enabled_in_ampforwp() {
|
1631 |
+
global $redux_builder_amp;
|
1632 |
+
if( $redux_builder_amp['enable-single-facebook-share'] ||
|
1633 |
+
$redux_builder_amp['enable-single-twitter-share'] ||
|
1634 |
+
$redux_builder_amp['enable-single-gplus-share'] ||
|
1635 |
+
$redux_builder_amp['enable-single-email-share'] ||
|
1636 |
+
$redux_builder_amp['enable-single-pinterest-share'] ||
|
1637 |
+
$redux_builder_amp['enable-single-linkedin-share'] ||
|
1638 |
+
$redux_builder_amp['enable-single-whatsapp-share'] ) {
|
1639 |
+
return true;
|
1640 |
+
}
|
1641 |
+
return false;
|
1642 |
+
}
|
1643 |
+
}
|
1644 |
+
|
1645 |
+
// 48. Remove all unwanted scripts on search pages
|
1646 |
+
add_filter( 'amp_post_template_data', 'ampforwp_remove_scripts_search_page' );
|
1647 |
+
function ampforwp_remove_scripts_search_page( $data ) {
|
1648 |
+
if( is_search() ) {
|
1649 |
+
// Remove all unwanted scripts on search pages
|
1650 |
+
unset( $data['amp_component_scripts']);
|
1651 |
+
}
|
1652 |
+
return $data;
|
1653 |
+
}
|
1654 |
+
|
1655 |
+
// 49. Properly adding ad Script the AMP way
|
1656 |
+
add_filter( 'amp_post_template_data', 'ampforwp_add_ads_scripts' );
|
1657 |
+
function ampforwp_add_ads_scripts( $data ) {
|
1658 |
+
global $redux_builder_amp;
|
1659 |
+
|
1660 |
+
if ( $redux_builder_amp['enable-amp-ads-1'] ||
|
1661 |
+
$redux_builder_amp['enable-amp-ads-2'] ||
|
1662 |
+
$redux_builder_amp['enable-amp-ads-3'] ||
|
1663 |
+
$redux_builder_amp['enable-amp-ads-4'] ) {
|
1664 |
+
if ( empty( $data['amp_component_scripts']['amp-ad'] ) ) {
|
1665 |
+
$data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
|
1666 |
+
}
|
1667 |
+
}
|
1668 |
+
|
1669 |
+
return $data;
|
1670 |
+
}
|
1671 |
+
|
1672 |
+
// internal function for checing if social profiles have been set
|
1673 |
+
if( !function_exists('ampforwp_checking_any_social_profiles') ) {
|
1674 |
+
function ampforwp_checking_any_social_profiles() {
|
1675 |
+
global $redux_builder_amp;
|
1676 |
+
if(
|
1677 |
+
$redux_builder_amp['enable-single-twittter-profile'] ||
|
1678 |
+
$redux_builder_amp['enable-single-facebook-profile'] ||
|
1679 |
+
$redux_builder_amp['enable-single-pintrest-profile'] ||
|
1680 |
+
$redux_builder_amp['enable-single-google-plus-profile'] ||
|
1681 |
+
$redux_builder_amp['enable-single-linkdin-profile'] ||
|
1682 |
+
$redux_builder_amp['enable-single-youtube-profile'] ||
|
1683 |
+
$redux_builder_amp['enable-single-instagram-profile'] ||
|
1684 |
+
$redux_builder_amp['enable-single-VKontakte-profile'] ||
|
1685 |
+
$redux_builder_amp['enable-single-reddit-profile'] ||
|
1686 |
+
$redux_builder_amp['enable-single-snapchat-profile'] ||
|
1687 |
+
$redux_builder_amp['enable-single-Tumblr-profile']
|
1688 |
+
) {
|
1689 |
+
return true;
|
1690 |
+
}
|
1691 |
+
return false;
|
1692 |
+
}
|
1693 |
+
}
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! function_exists( 'ampforwp_reporting_bugs' ) ) {
|
3 |
+
function ampforwp_reporting_bugs($sections){
|
4 |
+
|
5 |
+
$sections[] = array(
|
6 |
+
'title' => __( 'Report an Issue /<br> Request a Feature', 'redux-framework-demo' ),
|
7 |
+
// 'id' => 'opt-structured-data',
|
8 |
+
// 'subsection' => true,
|
9 |
+
'icon' => 'el el-warning-sign ',
|
10 |
+
'desc' => "<p><br /><h3>Tell Us What's Happening</h3><strong>We need your help in improving this plugin!</strong></p>
|
11 |
+
<p>We take every issue and bug report very seriously. Me and my team personally goes through your feedback and works hard on solving them.</p>
|
12 |
+
<p>
|
13 |
+
<a href='https://goo.gl/forms/zIks2sTbhBZK0A3L2' style='background: #E91E63;
|
14 |
+
padding: 10px 16px;
|
15 |
+
text-decoration: none;
|
16 |
+
color: #fff;
|
17 |
+
margin-top: 10px;
|
18 |
+
display: inline-block;
|
19 |
+
font-size: 16px;
|
20 |
+
border-radius: 3px;' target='_blank'>Report an Error</a>
|
21 |
+
<a href='https://goo.gl/forms/GVeHSzpZVWBok2oo2' style='background: #4CAF50;
|
22 |
+
padding: 10px 16px;
|
23 |
+
text-decoration: none;margin-left:9px;
|
24 |
+
color: #fff;
|
25 |
+
margin-top: 10px;
|
26 |
+
display: inline-block;
|
27 |
+
font-size: 16px;
|
28 |
+
border-radius: 3px;' target='_blank'>Request a Feature</a></p><br />",
|
29 |
+
);
|
30 |
+
|
31 |
+
return $sections;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
add_filter("redux/options/redux_builder_amp/sections", 'ampforwp_reporting_bugs', PHP_INT_MAX);
|
35 |
+
?>
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// 46. search search search everywhere #615
|
4 |
+
|
5 |
+
add_action('pre_amp_render_post','ampforwp_search_related_functions',12);
|
6 |
+
function ampforwp_search_related_functions(){
|
7 |
+
global $redux_builder_amp;
|
8 |
+
if ( $redux_builder_amp['amp-design-selector'] == 1 ||
|
9 |
+
$redux_builder_amp['amp-design-selector'] == 2 ||
|
10 |
+
$redux_builder_amp['amp-design-selector'] == 3 ) {
|
11 |
+
|
12 |
+
add_filter( 'amp_post_template_data', 'ampforwp_add_lightbox_and_form_scripts');
|
13 |
+
add_action('ampforwp_search_form','ampforwp_the_search_form');
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
+
add_action('ampforwp_global_after_footer','ampforwp_lightbox_html_output');
|
18 |
+
function ampforwp_lightbox_html_output() {
|
19 |
+
if ( is_search_enabled_in_ampforwp() ) {
|
20 |
+
global $redux_builder_amp;
|
21 |
+
if( $redux_builder_amp['amp-design-1-search-feature'] ||
|
22 |
+
$redux_builder_amp['amp-design-2-search-feature'] ||
|
23 |
+
$redux_builder_amp['amp-design-3-search-feature'] ) { ?>
|
24 |
+
|
25 |
+
<amp-lightbox id="search-icon" layout="nodisplay">
|
26 |
+
<?php do_action('ampforwp_search_form'); ?>
|
27 |
+
<button on="tap:search-icon.close" class="closebutton">X</button>
|
28 |
+
<i class="icono-cross"></i>
|
29 |
+
</amp-lightbox>
|
30 |
+
<?php }
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
add_action( 'ampforwp_header_search' , 'ampforwp_search_button_html_output' );
|
35 |
+
function ampforwp_search_button_html_output(){
|
36 |
+
if ( is_search_enabled_in_ampforwp() ) {
|
37 |
+
global $redux_builder_amp;
|
38 |
+
if( $redux_builder_amp['amp-design-1-search-feature'] ||
|
39 |
+
$redux_builder_amp['amp-design-2-search-feature'] ||
|
40 |
+
$redux_builder_amp['amp-design-3-search-feature'] ) { ?>
|
41 |
+
<div class="searchmenu">
|
42 |
+
<button on="tap:search-icon">
|
43 |
+
<i class="icono-search"></i>
|
44 |
+
</button>
|
45 |
+
</div>
|
46 |
+
<?php }
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
function ampforwp_add_lightbox_and_form_scripts( $data ) {
|
51 |
+
if ( is_search_enabled_in_ampforwp() ) {
|
52 |
+
global $redux_builder_amp;
|
53 |
+
// Add Scripts only when Search is Enabled
|
54 |
+
if( $redux_builder_amp['amp-design-1-search-feature'] ||
|
55 |
+
$redux_builder_amp['amp-design-2-search-feature'] ||
|
56 |
+
$redux_builder_amp['amp-design-3-search-feature'] ) {
|
57 |
+
if ( empty( $data['amp_component_scripts']['amp-lightbox'] ) ) {
|
58 |
+
$data['amp_component_scripts']['amp-lightbox'] = 'https://cdn.ampproject.org/v0/amp-lightbox-0.1.js';
|
59 |
+
}
|
60 |
+
if ( empty( $data['amp_component_scripts']['amp-form'] ) ) {
|
61 |
+
$data['amp_component_scripts']['amp-form'] = 'https://cdn.ampproject.org/v0/amp-form-0.1.js';
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
return $data;
|
66 |
+
}
|
67 |
+
|
68 |
+
function ampforwp_the_search_form() {
|
69 |
+
echo ampforwp_get_search_form();
|
70 |
+
}
|
71 |
+
function ampforwp_get_search_form() {
|
72 |
+
if ( is_search_enabled_in_ampforwp() ) {
|
73 |
+
global $redux_builder_amp;
|
74 |
+
$label = $redux_builder_amp['ampforwp-search-label'];
|
75 |
+
$placeholder = $redux_builder_amp['ampforwp-search-placeholder'];
|
76 |
+
$form = '<form role="search" method="get" id="searchform" class="searchform" target="_top" action="' . get_bloginfo('url') .'">
|
77 |
+
<div>
|
78 |
+
<label class="screen-reader-text" for="s">' . $label . '</label>
|
79 |
+
<input type="text" placeholder="AMP" value="1" name="amp" class="hide" id="ampsomething" />
|
80 |
+
<input type="text" placeholder="'.$placeholder.'" value="' . get_search_query() . '" name="s" id="s" />
|
81 |
+
<input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
|
82 |
+
</div>
|
83 |
+
</form>';
|
84 |
+
return $form;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
if( !function_exists( 'is_search_enabled_in_ampforwp' ) ) {
|
89 |
+
function is_search_enabled_in_ampforwp() {
|
90 |
+
global $redux_builder_amp;
|
91 |
+
if( ( $redux_builder_amp['amp-design-selector']==1 && $redux_builder_amp['amp-design-1-search-feature'] ) ||
|
92 |
+
( $redux_builder_amp['amp-design-selector']==2 && $redux_builder_amp['amp-design-2-search-feature'] ) ||
|
93 |
+
( $redux_builder_amp['amp-design-selector']==3 && $redux_builder_amp['amp-design-3-search-feature'] ) ) {
|
94 |
+
return true;
|
95 |
+
}
|
96 |
+
return false;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
|
100 |
+
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php class AMPFORWP_Categories_Widget extends WP_Widget {
|
2 |
+
|
3 |
+
// Set up the widget name and description.
|
4 |
+
public function __construct() {
|
5 |
+
$widget_options = array(
|
6 |
+
'classname' => 'ampforwp_categories_widget',
|
7 |
+
'description' => 'This Widget adds categories where necessary in AMP Pages'
|
8 |
+
);
|
9 |
+
parent::__construct( 'ampforwp_categories_widget', 'AMP Categories', $widget_options );
|
10 |
+
}
|
11 |
+
|
12 |
+
|
13 |
+
// args for the output of the form
|
14 |
+
public $args = array(
|
15 |
+
'before_title' => '<h4 class="widgettitle">',
|
16 |
+
'after_title' => '</h4>',
|
17 |
+
'before_widget' => '<div class="widget-wrap">',
|
18 |
+
'after_widget' => '</div>'
|
19 |
+
);
|
20 |
+
|
21 |
+
// Create the widget output.
|
22 |
+
public function widget( $args, $instance ) {
|
23 |
+
$ampforwp_title = apply_filters( 'widget_title', $instance[ 'title' ] );
|
24 |
+
$ampforwp_category_count = $instance[ 'count' ];
|
25 |
+
$ampforwp_category_id = $instance[ 'category' ];
|
26 |
+
$ampforwp_category_link = $instance[ 'showButton' ];
|
27 |
+
|
28 |
+
// echo . $args['before_title'] . . $args['after_title']; ?>
|
29 |
+
|
30 |
+
<?php
|
31 |
+
$exclude_ids = get_option('ampforwp_exclude_post');
|
32 |
+
|
33 |
+
$args = array(
|
34 |
+
'cat' => $ampforwp_category_id,
|
35 |
+
'posts_per_page' => $ampforwp_category_count,
|
36 |
+
'post__not_in' => $exclude_ids,
|
37 |
+
'has_password' => false,
|
38 |
+
'post_status'=> 'publish'
|
39 |
+
);
|
40 |
+
// The Query
|
41 |
+
$the_query = new WP_Query( $args );
|
42 |
+
|
43 |
+
// The Loop
|
44 |
+
|
45 |
+
if ( $the_query->have_posts() ) {
|
46 |
+
echo '<div class="amp-category-block"><ul>';
|
47 |
+
echo '<li class="amp-category-block-title">'.$ampforwp_title .'</li>';
|
48 |
+
while ( $the_query->have_posts() ) {
|
49 |
+
$the_query->the_post();
|
50 |
+
$ampforwp_post_url = get_permalink(); ?>
|
51 |
+
<li class="amp-category-post">
|
52 |
+
<?php if ( has_post_thumbnail() ) { ?>
|
53 |
+
<?php
|
54 |
+
$thumb_id = get_post_thumbnail_id();
|
55 |
+
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
|
56 |
+
$thumb_url = $thumb_url_array[0];
|
57 |
+
?>
|
58 |
+
<a href="<?php echo trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR ;?>"><amp-img src=<?php echo $thumb_url ?> width=150 height=150 layout=responsive></amp-img></a>
|
59 |
+
<?php } ?>
|
60 |
+
|
61 |
+
<a href="<?php echo trailingslashit($ampforwp_post_url) . AMPFORWP_AMP_QUERY_VAR ;?>">
|
62 |
+
<?php echo get_the_title(); ?>
|
63 |
+
</a>
|
64 |
+
</li> <?php
|
65 |
+
}
|
66 |
+
|
67 |
+
//show more
|
68 |
+
if( $ampforwp_category_link === 'yes' && $ampforwp_category_id !== '' ) {
|
69 |
+
global $redux_builder_amp;
|
70 |
+
echo '<a class="amp-category-block-btn" href="'.trailingslashit(get_category_link($ampforwp_category_id)).'amp'.'">'.$redux_builder_amp['amp-translator-show-more-text'].'</a>';
|
71 |
+
}
|
72 |
+
echo '</ul></div>';
|
73 |
+
|
74 |
+
} else {
|
75 |
+
// no posts found
|
76 |
+
}
|
77 |
+
/* Restore original Post Data */
|
78 |
+
wp_reset_postdata();
|
79 |
+
// echo $args['after_widget'];
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
// Create the admin area widget settings form.
|
84 |
+
public function form( $instance ) {
|
85 |
+
|
86 |
+
// Declarations for all the values to be stored
|
87 |
+
$ampforwp_title = ! empty( $instance['title'] ) ? $instance['title'] : 'Category Title';
|
88 |
+
$selected_category = ! empty( $instance['category'] ) ? $instance['category'] : '';
|
89 |
+
$ampforwp_category_count = ! empty( $instance['count'] ) ? $instance['count'] : 3 ;
|
90 |
+
$radio_buttons = ! empty( $instance['showButton'] ) ? $instance['showButton'] : 'yes';
|
91 |
+
|
92 |
+
?>
|
93 |
+
<!-- Form Ends Here -->
|
94 |
+
<p>
|
95 |
+
<!-- text Start Here -->
|
96 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>">Title:
|
97 |
+
<input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $ampforwp_title ); ?>" />
|
98 |
+
</label><br>
|
99 |
+
<!-- text End Here -->
|
100 |
+
</p>
|
101 |
+
<!-- select Start Here -->
|
102 |
+
<p>
|
103 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'category' ) ); ?>">Category:
|
104 |
+
<select id="<?php echo $this->get_field_id('category'); ?>" name="<?php echo $this->get_field_name('category'); ?>" class="widefat" value>
|
105 |
+
<?php
|
106 |
+
|
107 |
+
$categories = get_categories( array(
|
108 |
+
'orderby' => 'name',
|
109 |
+
'order' => 'ASC'
|
110 |
+
) );
|
111 |
+
|
112 |
+
echo '<option selected value="none">Recent Posts </option>';
|
113 |
+
foreach( $categories as $category ) {
|
114 |
+
echo '<option '. selected( $instance['category'], $category->term_id) . ' value="'. $category->term_id . '">' . $category->name . '</option>';
|
115 |
+
} ?>
|
116 |
+
</select>
|
117 |
+
</label>
|
118 |
+
</p>
|
119 |
+
<!-- select End Here -->
|
120 |
+
|
121 |
+
<p>
|
122 |
+
<!-- text starts Here -->
|
123 |
+
<label for="<?php echo $this->get_field_id( 'count' ); ?>">Number of Posts:
|
124 |
+
<input class="widefat" type="number" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" value="<?php echo esc_attr( $ampforwp_category_count ); ?>" />
|
125 |
+
</label>
|
126 |
+
</p>
|
127 |
+
<!-- text End Here -->
|
128 |
+
<p>
|
129 |
+
<!-- radio buttons starts Here -->
|
130 |
+
<label for="<?php echo $this->get_field_id( 'showButton' ); ?>" value="<?php echo esc_attr( $ampforwp_title );?>">Show View more Button:</label><br>
|
131 |
+
<label for="<?php echo $this->get_field_id('show_button_1'); ?>">
|
132 |
+
<input class="widefat" id="<?php echo $this->get_field_id('show_button_1'); ?>" name="<?php echo $this->get_field_name('showButton'); ?>" type="radio" value="yes" <?php if($radio_buttons === 'yes'){ echo 'checked="checked"'; } ?> /><?php _e('Yes '); ?>
|
133 |
+
</label>
|
134 |
+
<label for="<?php echo $this->get_field_id('show_button_2'); ?>">
|
135 |
+
<input class="widefat" id="<?php echo $this->get_field_id('show_button_2'); ?>" name="<?php echo $this->get_field_name('showButton'); ?>" type="radio" value="no" <?php if($radio_buttons === 'no'){ echo 'checked="checked"'; } ?> /><?php _e(' No'); ?>
|
136 |
+
</label>
|
137 |
+
<!-- radio buttons Ends Here -->
|
138 |
+
|
139 |
+
</p>
|
140 |
+
<!-- Form Ends Here -->
|
141 |
+
|
142 |
+
<?php
|
143 |
+
}
|
144 |
+
|
145 |
+
|
146 |
+
|
147 |
+
// Apply settings to the widget instance.
|
148 |
+
public function update( $new_instance, $old_instance ) {
|
149 |
+
$instance = $old_instance;
|
150 |
+
$instance[ 'title' ] = strip_tags( $new_instance[ 'title' ] );
|
151 |
+
$instance[ 'count' ] = strip_tags( $new_instance[ 'count' ] );
|
152 |
+
|
153 |
+
if( strip_tags( $new_instance[ 'category' ] ) !== 'none' ) {
|
154 |
+
$instance[ 'category' ] = strip_tags( $new_instance[ 'category' ] );
|
155 |
+
} else {
|
156 |
+
$instance[ 'category' ] = '';
|
157 |
+
}
|
158 |
+
$instance['showButton'] = strip_tags($new_instance['showButton']);
|
159 |
+
return $instance;
|
160 |
+
}
|
161 |
+
|
162 |
+
}
|
163 |
+
|
164 |
+
// Register the widget.
|
165 |
+
function ampforwp_register_categories_widget() {
|
166 |
+
register_widget( 'AMPFORWP_Categories_Widget' );
|
167 |
+
}
|
168 |
+
add_action( 'widgets_init', 'ampforwp_register_categories_widget' );
|
169 |
+
|
170 |
+
?>
|