Version Description
- Proper Details at http://ampforwp.com/blog/amp-0-7-7/
- Big Validation Error fix Update
- Disable AMP support on specific Pages and Posts
- Option to disable the Post meta from the Single
- Footer Credits and Copyright Text Option
- New options for Social Sharing Bar in Single
- Jetpack Social & Related Sharing Issue fixed
- Gaping in footer if the Sticky bar is enabled
- Text domain added on few strings
Download this release
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 0.7.7 |
Comparing to | |
See all releases |
Code changes from version 0.7.6 to 0.7.7
- README.md +15 -4
- accelerated-moblie-pages.php +40 -18
- admin/ampwp-newsletter.php +121 -0
- options/options-init.php +264 -165
- readme.txt +22 -11
- themes/default/footer.php +22 -22
- themes/default/functions.php +80 -46
- themes/default/header.php +70 -67
- themes/default/single.php +73 -68
README.md
CHANGED
@@ -7,17 +7,17 @@ Contributors: mohammed_kaludi, ahmedkaludi
|
|
7 |
Tags: amp, accelerated mobile pages, mobile, amp project, google amp, amp wp, google
|
8 |
Requires at least: 3.0
|
9 |
Tested up to: 4.5.3
|
10 |
-
Stable tag: 0.7.
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
14 |
-
Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site.
|
15 |
|
16 |
== Description ==
|
17 |
|
18 |
Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site. AMP WP is a plugin that needs to no configuration, just activate it and you are done.
|
19 |
|
20 |
-
[View Demo and Screenshot of the plugin](http://ahmedkaludi.com/accelerated-mobile-pages/)
|
21 |
|
22 |
**Features:**
|
23 |
|
@@ -138,4 +138,15 @@ Please check if you have "Pretty Permalinks" enabled. If not then activate it. F
|
|
138 |
|
139 |
= 0.7.6 =
|
140 |
* Google Adsense Support Added with AMP-Ad
|
141 |
-
* Wrong Homepage rel amphtml bug fixed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
Tags: amp, accelerated mobile pages, mobile, amp project, google amp, amp wp, google
|
8 |
Requires at least: 3.0
|
9 |
Tested up to: 4.5.3
|
10 |
+
Stable tag: 0.7.7
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
14 |
+
Supports AMP for WordPress out of the box. Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site.
|
15 |
|
16 |
== Description ==
|
17 |
|
18 |
Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site. AMP WP is a plugin that needs to no configuration, just activate it and you are done.
|
19 |
|
20 |
+
[What's New in Version 0.7.7?](http://ampforwp.com/blog/amp-0-7-7/) | [View Demo and Screenshot of the plugin](http://ahmedkaludi.com/accelerated-mobile-pages/)
|
21 |
|
22 |
**Features:**
|
23 |
|
138 |
|
139 |
= 0.7.6 =
|
140 |
* Google Adsense Support Added with AMP-Ad
|
141 |
+
* Wrong Homepage rel amphtml bug fixed
|
142 |
+
|
143 |
+
= 0.7.7 =
|
144 |
+
* Proper Details at http://ampforwp.com/blog/amp-0-7-7/
|
145 |
+
* Big Validation Error fix Update
|
146 |
+
* Disable AMP support on specific Pages and Posts
|
147 |
+
* Option to disable the Post meta from the Single
|
148 |
+
* Footer Credits and Copyright Text Option
|
149 |
+
* New options for Social Sharing Bar in Single
|
150 |
+
* Jetpack Social & Related Sharing Issue fixed
|
151 |
+
* Gaping in footer if the Sticky bar is enabled
|
152 |
+
* Text domain added on few strings
|
accelerated-moblie-pages.php
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: Accelerated Mobile Pages for WordPress
|
6 |
-
Version: 0.7.
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
-
Author URI: http://
|
9 |
License: GPL2
|
10 |
*/
|
11 |
// Exit if accessed directly.
|
@@ -24,28 +24,50 @@ if ( class_exists( 'Ampwp_core' ) ) {
|
|
24 |
@session_start();
|
25 |
}
|
26 |
// Initialize the AmpWP check logic and rendering
|
27 |
-
$ampwp_core->ampwp_load_site();
|
28 |
-
|
29 |
}
|
|
|
30 |
/*
|
31 |
* Add "amphtml" in the main theme to target it to the AMP page
|
32 |
*/
|
|
|
|
|
|
|
|
|
33 |
|
34 |
-
|
35 |
-
$
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
|
|
|
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
|
51 |
// Registering Custom AMP menu for this plugin
|
@@ -62,5 +84,5 @@ if (! function_exists( 'register_amp_menu') ) {
|
|
62 |
add_action( 'init', 'register_amp_menu' );
|
63 |
}
|
64 |
require_once( dirname( __FILE__ ) . '/options/admin-init.php' );
|
65 |
-
|
66 |
?>
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: Accelerated Mobile Pages for WordPress
|
6 |
+
Version: 0.7.7
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
+
Author URI: http://ampforwp.com/
|
9 |
License: GPL2
|
10 |
*/
|
11 |
// Exit if accessed directly.
|
24 |
@session_start();
|
25 |
}
|
26 |
// Initialize the AmpWP check logic and rendering
|
27 |
+
$ampwp_core->ampwp_load_site();
|
|
|
28 |
}
|
29 |
+
|
30 |
/*
|
31 |
* Add "amphtml" in the main theme to target it to the AMP page
|
32 |
*/
|
33 |
+
add_action( 'wp_head', 'ampwp_rel_info_on_off',2 );
|
34 |
+
function ampwp_rel_info_on_off() {
|
35 |
+
global $redux_builder_amp;
|
36 |
+
$current_page_id = get_queried_object_id();
|
37 |
|
38 |
+
// Hide AMPHTML on Specific Pages
|
39 |
+
$amp_pages = $redux_builder_amp['amp-multi-select-pages'];
|
40 |
+
if ( $amp_pages ) {
|
41 |
+
foreach($amp_pages as $i => $item) {
|
42 |
+
$hide_on_pages = $item;
|
43 |
+
if ( $hide_on_pages == $current_page_id ) {
|
44 |
+
remove_action( 'wp_head', 'ampwp_add_rel_info' );
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
// Hide AMPHTML on Specific Posts
|
49 |
+
$amp_posts = $redux_builder_amp['amp-multi-select-posts'];
|
50 |
+
if ( $amp_posts ) {
|
51 |
+
foreach($amp_posts as $i => $item) {
|
52 |
+
$hide_on_posts = $item;
|
53 |
+
if ( $hide_on_posts == $current_page_id ) {
|
54 |
+
remove_action( 'wp_head', 'ampwp_add_rel_info' );
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
|
60 |
+
add_action( 'wp_head', 'ampwp_add_rel_info' );
|
61 |
+
function ampwp_add_rel_info() {
|
62 |
|
63 |
+
$amp_url = trailingslashit( get_permalink() ); ?>
|
64 |
+
<?php // TO DO: Add support for archives, and other parts and stuff..
|
65 |
+
if ( is_home() ) { ?>
|
66 |
+
<link rel="amphtml" href="<?php echo get_home_url(); ?>?amp" /> <?php
|
67 |
+
} else { ?>
|
68 |
+
<link rel="amphtml" href="<?php echo $amp_url; ?>?amp" /> <?php
|
69 |
+
}
|
70 |
+
}
|
71 |
|
72 |
|
73 |
// Registering Custom AMP menu for this plugin
|
84 |
add_action( 'init', 'register_amp_menu' );
|
85 |
}
|
86 |
require_once( dirname( __FILE__ ) . '/options/admin-init.php' );
|
87 |
+
require_once( dirname( __FILE__ ) . '/admin/ampwp-newsletter.php' );
|
88 |
?>
|
admin/ampwp-newsletter.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class ampwp_pointers1 {
|
3 |
+
const DISPLAY_VERSION = 'v1.0';
|
4 |
+
function __construct () {
|
5 |
+
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
|
6 |
+
}
|
7 |
+
function admin_enqueue_scripts () {
|
8 |
+
$dismissed = explode (',', get_user_meta (wp_get_current_user ()->ID, 'dismissed_wp_pointers', true));
|
9 |
+
$do_tour = !in_array ('test_wp_pointer', $dismissed);
|
10 |
+
if ($do_tour) {
|
11 |
+
wp_enqueue_style ('wp-pointer');
|
12 |
+
wp_enqueue_script ('wp-pointer');
|
13 |
+
|
14 |
+
add_action('admin_print_footer_scripts', array($this, 'admin_print_footer_scripts'));
|
15 |
+
add_action('admin_head', array($this, 'admin_head')); // Hook to admin head
|
16 |
+
}
|
17 |
+
}
|
18 |
+
function admin_head () {
|
19 |
+
?>
|
20 |
+
<style type="text/css" media="screen"> #pointer-primary { margin: 0 5px 0 0; } </style>
|
21 |
+
<?php }
|
22 |
+
function admin_print_footer_scripts () {
|
23 |
+
global $pagenow;
|
24 |
+
global $current_user;
|
25 |
+
$tour = array ();
|
26 |
+
$tab = isset($_GET['tab']) ? $_GET['tab'] : '';
|
27 |
+
$function = '';
|
28 |
+
$button2 = '';
|
29 |
+
$options = array ();
|
30 |
+
$show_pointer = false;
|
31 |
+
|
32 |
+
if (!array_key_exists($tab, $tour)) {
|
33 |
+
|
34 |
+
$show_pointer = true;
|
35 |
+
$file_error = true;
|
36 |
+
|
37 |
+
$id = '#dashboard_right_now'; // Define ID used on page html element where we want to display pointer
|
38 |
+
$content = '<h3>' . sprintf (__('You are awesome for using AMP!', 'ampwp'), self::DISPLAY_VERSION) . '</h3>';
|
39 |
+
$content .= __('<p>Do you want the latest on <b>AMP update</b> before others and some best resources on AMP in a single email? - Free just for users of AMP!</p>', 'ampwp');
|
40 |
+
$content .= __('
|
41 |
+
<!-- Begin MailChimp Signup Form -->
|
42 |
+
<style type="text/css">
|
43 |
+
.wp-pointer-buttons{ padding:0 }
|
44 |
+
.wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #bcbcbc;} .wp-pointer-content .button-primary{ display:none} #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
|
45 |
+
</style>
|
46 |
+
<div id="mc_embed_signup">
|
47 |
+
<form action="//ampforwp.us14.list-manage.com/subscribe/post?u=a631df13442f19caede5a5baf&id=c9a71edce6" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
|
48 |
+
<div id="mc_embed_signup_scroll">
|
49 |
+
<div class="mc-field-group" style=" margin-left: 15px; width: 175px; float: left;">
|
50 |
+
<input type="email" value="' . esc_attr( $current_user->user_email ) . '" name="EMAIL" class="required email" id="mce-EMAIL" style=" width: 168px; padding: 6px 5px;">
|
51 |
+
</div> <div id="mce-responses">
|
52 |
+
<div class="response" id="mce-error-response" style="display:none"></div>
|
53 |
+
<div class="response" id="mce-success-response" style="display:none"></div>
|
54 |
+
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
|
55 |
+
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>
|
56 |
+
<input type="submit" value="Sure, Thanks!" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">
|
57 |
+
</div>
|
58 |
+
</form>
|
59 |
+
</div>','ampwp');
|
60 |
+
$options = array (
|
61 |
+
'content' => $content,
|
62 |
+
'position' => array ('edge' => 'top', 'align' => 'left')
|
63 |
+
);
|
64 |
+
}
|
65 |
+
if ($show_pointer) {
|
66 |
+
$this->make_pointer_script ($id, $options, __('Dismiss', 'ampwp'), $button2, $function);
|
67 |
+
}
|
68 |
+
}
|
69 |
+
function get_admin_url($page, $tab) {
|
70 |
+
$url = admin_url();
|
71 |
+
$url .= $page.'?tab='.$tab;
|
72 |
+
return $url;
|
73 |
+
}
|
74 |
+
function make_pointer_script ($id, $options, $button1, $button2=false, $function='') {
|
75 |
+
?>
|
76 |
+
<script type="text/javascript">
|
77 |
+
(function ($) {
|
78 |
+
var wp_pointers_tour_opts = <?php echo json_encode ($options); ?>, setup;
|
79 |
+
wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
|
80 |
+
buttons: function (event, t) {
|
81 |
+
button = jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php echo $button1; ?>' + '</a>');
|
82 |
+
button.bind ('click.pointer', function () {
|
83 |
+
t.element.pointer ('close');
|
84 |
+
});
|
85 |
+
return button;
|
86 |
+
},
|
87 |
+
close: function () {
|
88 |
+
$.post (ajaxurl, {
|
89 |
+
pointer: 'test_wp_pointer',
|
90 |
+
action: 'dismiss-wp-pointer'
|
91 |
+
});
|
92 |
+
}
|
93 |
+
});
|
94 |
+
setup = function () {
|
95 |
+
$('<?php echo $id; ?>').pointer(wp_pointers_tour_opts).pointer('open');
|
96 |
+
<?php if ($button2) { ?>
|
97 |
+
jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php echo $button2; ?>' + '</a>');
|
98 |
+
jQuery ('#pointer-primary').click (function () {
|
99 |
+
<?php echo $function; ?>
|
100 |
+
});
|
101 |
+
jQuery ('#pointer-close').click (function () {
|
102 |
+
$.post (ajaxurl, {
|
103 |
+
pointer: 'test_wp_pointer',
|
104 |
+
action: 'dismiss-wp-pointer'
|
105 |
+
});
|
106 |
+
})
|
107 |
+
<?php } ?>
|
108 |
+
};
|
109 |
+
if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
|
110 |
+
$(window).bind('load.wp-pointers', setup);
|
111 |
+
}
|
112 |
+
else {
|
113 |
+
setup ();
|
114 |
+
}
|
115 |
+
}) (jQuery);
|
116 |
+
</script>
|
117 |
+
<?php
|
118 |
+
}
|
119 |
+
}
|
120 |
+
$ampwp_pointers1 = new ampwp_pointers1();
|
121 |
+
?>
|
options/options-init.php
CHANGED
@@ -28,7 +28,7 @@
|
|
28 |
'page_slug' => 'amp_options',
|
29 |
'page_title' => 'Accelerated Mobile Pages Options',
|
30 |
'update_notice' => false,
|
31 |
-
'intro_text' => '<a href="https://wordpress.org/support/plugin/accelerated-mobile-pages" target="_blank">Need Help? Support Forum</a> | <a href="https://wordpress.org/plugins/accelerated-mobile-pages/faq/" target="_blank">FAQ</a> | <a href="https://wordpress.org/plugins/accelerated-mobile-pages/changelog/" target="_blank">Change Log</a> | <a href="https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages" target="_blank">Reviews</a>',
|
32 |
'footer_text' => '',
|
33 |
'admin_bar' => TRUE,
|
34 |
'menu_type' => 'menu',
|
@@ -138,7 +138,7 @@
|
|
138 |
Redux::setSection( $opt_name, array(
|
139 |
'title' => __( 'Welcome', 'redux-framework-demo' ),
|
140 |
'id' => 'basic',
|
141 |
-
'desc' => __( '<div class="amp-faq">Thank you for using Accelerated Mobile Pages plugin.'. '<p>' . 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. I have put togeather some frequently asked questions below.', 'redux-framework-demo' ), '
|
142 |
. '<h2>' . __( 'Frequently Asked Questions', 'redux-framework-demo' ) . '</h2>'
|
143 |
. '<p><strong>' . __( 'How to Setup Navigation Menu?', 'redux-framework-demo' ) . '</strong><br/>' . __( 'We have created a Seperate Navigation menu for AMP version which you can setup from the WordPress Menus, then navigate to Menu Locations, their you will notice AMP Menu. You can assign existing menus to this locations.', 'redux-framework-demo' ) . '</p>'
|
144 |
. '<p><strong>' . __( 'I added /?amp on the end of one of my URLs and a minimalist version of my page appeared. It looks just like on one of your screenshots, so I guess its installed properly. Okay what now? Is it just enough to install it and the plugin will do the rest?', 'redux-framework-demo' ) . '</strong><br/>' . __( 'After you see the minimalist view if you use the url with ?amp then it means that it has been installed properly. You dont need any extra steps to enable it.', 'redux-framework-demo' ) . '</p>'
|
@@ -153,12 +153,12 @@
|
|
153 |
', 'redux-framework-demo' ) . '</strong><br/>' . __( 'Add /?amp at the end of your website url and you will get amp version of your website.', 'redux-framework-demo' ) . '</p>'
|
154 |
|
155 |
. '<p><strong>' . sprintf( __( 'I have addded /?amp at the end of the url and still I am not able to see the AMP version of my site?
|
156 |
-
', 'redux-framework-demo' ), '
|
157 |
. sprintf( __( 'Please check if you have "Pretty Permalinks" enabled. If not then activate it.', 'redux-framework-demo' ), '' )
|
158 |
. '</p>'
|
159 |
|
160 |
. '<p><strong>' . sprintf( __( 'How do I report Bug reports?
|
161 |
-
', 'redux-framework-demo' ), '
|
162 |
. sprintf( __( 'Before you submit a new bug, please check if there already is an existing bug report for it. If so, it may be far more valuable to add to the existing one, than to create a new bug report. You can submit bug reports and feature requests at
|
163 |
|
164 |
%1$sGitHub Issues Page%2$s.
|
@@ -169,7 +169,7 @@
|
|
169 |
. sprintf( __( '
|
170 |
|
171 |
<h2>%1$sLike this plugin? Support us by leaving a 5 Star Rating%2$s</h2><br />
|
172 |
-
', 'redux-framework-demo' ), '<a target="_blank" href="' . esc_url( 'https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages#postform' ) . '">', '</a>' )
|
173 |
. '</p></div>'
|
174 |
|
175 |
, 'redux-framework-demo' ),
|
@@ -183,28 +183,25 @@
|
|
183 |
'subsection' => true,
|
184 |
'fields' => array(
|
185 |
$fields = array(
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
// 'default' => array(
|
193 |
-
// 'url'=>'http://s.wordpress.org/style/images/codeispoetry.png'
|
194 |
-
// ),
|
195 |
-
),
|
196 |
-
|
197 |
-
//$fields = array(
|
198 |
-
// 'id' => 'opt-switch',
|
199 |
-
// 'type' => 'switch',
|
200 |
-
// 'title' => __('Switch On', 'redux-framework-demo'),
|
201 |
-
// 'subtitle' => __('Look, it\'s on!', 'redux-framework-demo'),
|
202 |
-
// 'default' => true
|
203 |
-
//),
|
204 |
|
205 |
-
|
206 |
-
//
|
207 |
-
//
|
|
|
|
|
|
|
|
|
|
|
208 |
array(
|
209 |
'id' => 'ga-feild',
|
210 |
'type' => 'text',
|
@@ -213,68 +210,88 @@
|
|
213 |
'desc' => __( 'Enter your Google Analytics ID. Example: UA-XXXXX-Y.', 'redux-framework-demo' ),
|
214 |
'default' => 'UA-XXXXX-Y',
|
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 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
|
257 |
|
258 |
|
259 |
) );
|
260 |
|
261 |
-
// ADS SECTION
|
262 |
Redux::setSection( $opt_name, array(
|
263 |
'title' => __( 'Advertisement', 'redux-framework-demo' ),
|
264 |
-
|
265 |
'id' => 'amp-ads',
|
266 |
'subsection' => true,
|
267 |
'fields' => array(
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
'
|
272 |
-
|
273 |
-
'
|
274 |
-
'
|
275 |
-
'
|
276 |
-
|
277 |
-
|
278 |
array(
|
279 |
'id' => 'enable-amp-ads-select-1',
|
280 |
'type' => 'select',
|
@@ -290,35 +307,33 @@ array(
|
|
290 |
),
|
291 |
'default' => '2',
|
292 |
),
|
293 |
-
|
294 |
array(
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
),
|
302 |
array(
|
303 |
-
'id'
|
304 |
-
'type'
|
305 |
-
'title'
|
306 |
-
'desc'=> __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
|
307 |
'default' => '',
|
308 |
'required' => array('enable-amp-ads-1', '=' , '1'),
|
309 |
),
|
310 |
-
|
311 |
-
//2
|
312 |
array(
|
313 |
-
|
314 |
-
|
315 |
'title' => __('AD #2', 'redux-framework-demo'),
|
316 |
-
|
317 |
-
'subtitle' => __('Below the
|
318 |
'true' => 'Enabled',
|
319 |
'false' => 'Disabled',
|
320 |
),
|
321 |
-
|
322 |
array(
|
323 |
'id' => 'enable-amp-ads-select-2',
|
324 |
'type' => 'select',
|
@@ -334,79 +349,75 @@ array(
|
|
334 |
),
|
335 |
'default' => '2',
|
336 |
),
|
337 |
-
|
338 |
array(
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
),
|
346 |
array(
|
347 |
'id' => 'enable-amp-ads-text-feild-slot-2',
|
348 |
'type' => 'text',
|
349 |
-
'title'
|
350 |
-
'desc'=> __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
|
351 |
'default' => '',
|
352 |
'required' => array('enable-amp-ads-2', '=' , '1'),
|
353 |
),
|
354 |
-
// 2
|
355 |
-
//3
|
356 |
array(
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
),
|
365 |
-
|
366 |
array(
|
367 |
-
'id'
|
368 |
-
'type'
|
369 |
-
'title'
|
370 |
-
'required'
|
371 |
// Must provide key => value pairs for select options
|
372 |
-
'options'
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
),
|
379 |
'default' => '2',
|
380 |
),
|
381 |
-
|
382 |
array(
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
),
|
390 |
array(
|
391 |
-
'id'
|
392 |
-
'type'
|
393 |
-
'title'
|
394 |
-
'desc'=> __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
|
395 |
-
'default'
|
396 |
-
'required'
|
397 |
),
|
398 |
-
// 3
|
399 |
-
//4
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
'title'
|
404 |
-
|
405 |
-
'subtitle'
|
406 |
-
'true'
|
407 |
-
'false'
|
408 |
-
|
409 |
-
|
410 |
array(
|
411 |
'id' => 'enable-amp-ads-select-4',
|
412 |
'type' => 'select',
|
@@ -422,29 +433,117 @@ array(
|
|
422 |
),
|
423 |
'default' => '2',
|
424 |
),
|
425 |
-
|
426 |
array(
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
),
|
434 |
array(
|
435 |
-
'id'
|
436 |
-
'type'
|
437 |
-
'title'
|
438 |
-
'desc'=> __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
|
439 |
-
'default'
|
440 |
-
'required'
|
441 |
)
|
442 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
),
|
444 |
|
445 |
) );
|
446 |
|
447 |
-
// CSS
|
448 |
Redux::setSection( $opt_name, array(
|
449 |
'title' => __( 'Custom CSS Editor', 'redux-framework-demo' ),
|
450 |
// 'desc' => __( 'For full documentation on this field, visit: ', 'redux-framework-demo' ) . '<a href="http://docs.reduxframework.com/core/fields/textarea/" target="_blank">http://docs.reduxframework.com/core/fields/textarea/</a>',
|
28 |
'page_slug' => 'amp_options',
|
29 |
'page_title' => 'Accelerated Mobile Pages Options',
|
30 |
'update_notice' => false,
|
31 |
+
'intro_text' => '<a href="https://wordpress.org/support/plugin/accelerated-mobile-pages" target="_blank">Need Help? Support Forum</a> | <a href="https://wordpress.org/plugins/accelerated-mobile-pages/faq/" target="_blank">FAQ</a> | <a href="https://wordpress.org/plugins/accelerated-mobile-pages/changelog/" target="_blank">Change Log</a> | <a href="https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages" target="_blank">Reviews</a>| <a href="https://www.paypal.me/Kaludi/5" target="_blank">Donate</a>',
|
32 |
'footer_text' => '',
|
33 |
'admin_bar' => TRUE,
|
34 |
'menu_type' => 'menu',
|
138 |
Redux::setSection( $opt_name, array(
|
139 |
'title' => __( 'Welcome', 'redux-framework-demo' ),
|
140 |
'id' => 'basic',
|
141 |
+
'desc' => __( '<div class="amp-faq">Thank you for using Accelerated Mobile Pages plugin. <b> <a href="http://ampforwp.com/blog/amp-0-7-7/" target="_blank"> What\'s New in this Version?</a></b>'. '<p>' . 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. I have put togeather some frequently asked questions below.', 'redux-framework-demo' ), 'redux-framework-demo' ) . '</p>'
|
142 |
. '<h2>' . __( 'Frequently Asked Questions', 'redux-framework-demo' ) . '</h2>'
|
143 |
. '<p><strong>' . __( 'How to Setup Navigation Menu?', 'redux-framework-demo' ) . '</strong><br/>' . __( 'We have created a Seperate Navigation menu for AMP version which you can setup from the WordPress Menus, then navigate to Menu Locations, their you will notice AMP Menu. You can assign existing menus to this locations.', 'redux-framework-demo' ) . '</p>'
|
144 |
. '<p><strong>' . __( 'I added /?amp on the end of one of my URLs and a minimalist version of my page appeared. It looks just like on one of your screenshots, so I guess its installed properly. Okay what now? Is it just enough to install it and the plugin will do the rest?', 'redux-framework-demo' ) . '</strong><br/>' . __( 'After you see the minimalist view if you use the url with ?amp then it means that it has been installed properly. You dont need any extra steps to enable it.', 'redux-framework-demo' ) . '</p>'
|
153 |
', 'redux-framework-demo' ) . '</strong><br/>' . __( 'Add /?amp at the end of your website url and you will get amp version of your website.', 'redux-framework-demo' ) . '</p>'
|
154 |
|
155 |
. '<p><strong>' . sprintf( __( 'I have addded /?amp at the end of the url and still I am not able to see the AMP version of my site?
|
156 |
+
', 'redux-framework-demo' ), 'redux-framework-demo' ) . '</strong><br/>'
|
157 |
. sprintf( __( 'Please check if you have "Pretty Permalinks" enabled. If not then activate it.', 'redux-framework-demo' ), '' )
|
158 |
. '</p>'
|
159 |
|
160 |
. '<p><strong>' . sprintf( __( 'How do I report Bug reports?
|
161 |
+
', 'redux-framework-demo' ), 'redux-framework-demo' ) . '</strong><br/>'
|
162 |
. sprintf( __( 'Before you submit a new bug, please check if there already is an existing bug report for it. If so, it may be far more valuable to add to the existing one, than to create a new bug report. You can submit bug reports and feature requests at
|
163 |
|
164 |
%1$sGitHub Issues Page%2$s.
|
169 |
. sprintf( __( '
|
170 |
|
171 |
<h2>%1$sLike this plugin? Support us by leaving a 5 Star Rating%2$s</h2><br />
|
172 |
+
', 'redux-framework-demo' ), '<a target="_blank" href="' . esc_url( 'https://wordpress.org/support/view/plugin-reviews/accelerated-mobile-pages?rate=5#postform' ) . '">', '</a>' )
|
173 |
. '</p></div>'
|
174 |
|
175 |
, 'redux-framework-demo' ),
|
183 |
'subsection' => true,
|
184 |
'fields' => array(
|
185 |
$fields = array(
|
186 |
+
'id' => 'opt-media',
|
187 |
+
'type' => 'media',
|
188 |
+
'url' => true,
|
189 |
+
'title' => __('Logo', 'redux-framework-demo'),
|
190 |
+
//'desc' => __('', 'redux-framework-demo'),
|
191 |
+
'desc' => __('Upload a logo for the AMP version. Recommend logo size is: 190x36', 'redux-framework-demo'),
|
192 |
+
// 'default' => array(
|
193 |
+
// 'url'=>'http://s.wordpress.org/style/images/codeispoetry.png'
|
194 |
+
// ),
|
195 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
|
197 |
+
//$fields = array(
|
198 |
+
// 'id' => 'opt-switch',
|
199 |
+
// 'type' => 'switch',
|
200 |
+
// 'title' => __('Switch On', 'redux-framework-demo'),
|
201 |
+
// 'subtitle' => __('Look, it\'s on!', 'redux-framework-demo'),
|
202 |
+
// 'default' => true
|
203 |
+
//),
|
204 |
+
|
205 |
array(
|
206 |
'id' => 'ga-feild',
|
207 |
'type' => 'text',
|
210 |
'desc' => __( 'Enter your Google Analytics ID. Example: UA-XXXXX-Y.', 'redux-framework-demo' ),
|
211 |
'default' => 'UA-XXXXX-Y',
|
212 |
),
|
213 |
+
array(
|
214 |
+
'id' => 'opt-color-rgba',
|
215 |
+
'type' => 'color_rgba',
|
216 |
+
'title' => 'Color Scheme',
|
217 |
+
'subtitle' => 'Set color and alpha channel',
|
218 |
+
'desc' => 'Change the color scheme to your branding color',
|
219 |
+
|
220 |
+
// See Notes below about these lines.
|
221 |
+
//'output' => array('background-color' => '.site-header'),
|
222 |
+
//'compiler' => array('color' => '.site-header, .site-footer', 'background-color' => '.nav-bar'),
|
223 |
+
'default' => array(
|
224 |
+
'color' => '#312C7E',
|
225 |
+
'alpha' => 1
|
226 |
+
),
|
227 |
+
|
228 |
+
// These options display a fully functional color palette. Omit this argument
|
229 |
+
// for the minimal color picker, and change as desired.
|
230 |
+
'options' => array(
|
231 |
+
'show_input' => true,
|
232 |
+
'show_initial' => true,
|
233 |
+
'show_alpha' => true,
|
234 |
+
'show_palette' => true,
|
235 |
+
'show_palette_only' => false,
|
236 |
+
'show_selection_palette' => true,
|
237 |
+
'max_palette_size' => 10,
|
238 |
+
'allow_empty' => true,
|
239 |
+
'clickout_fires_change' => false,
|
240 |
+
'choose_text' => 'Choose',
|
241 |
+
'cancel_text' => 'Cancel',
|
242 |
+
'show_buttons' => true,
|
243 |
+
'use_extended_classes' => true,
|
244 |
+
'palette' => null, // show default
|
245 |
+
'input_text' => 'Select Color'
|
246 |
+
)
|
247 |
+
),
|
248 |
+
array(
|
249 |
+
'id' => 'amp-multi-select-pages',
|
250 |
+
'type' => 'select',
|
251 |
+
'multi' => true,
|
252 |
+
'title' => __('Hide AMP on Specific Pages', 'redux-framework-demo'),
|
253 |
+
'data' => 'pages',
|
254 |
+
),
|
255 |
+
array(
|
256 |
+
'id' => 'amp-multi-select-posts',
|
257 |
+
'type' => 'select',
|
258 |
+
'multi' => true,
|
259 |
+
'title' => __('Hide AMP on Specific Posts', 'redux-framework-demo'),
|
260 |
+
'data' => 'post',
|
261 |
+
'args' => array(
|
262 |
+
'post_type' => 'post',
|
263 |
+
'posts_per_page' => 500
|
264 |
+
),
|
265 |
+
),
|
266 |
+
array(
|
267 |
+
'id' => 'amp-footer-text',
|
268 |
+
'title' => __('Footer', 'redux-framework-demo'),
|
269 |
+
'type' => 'text',
|
270 |
+
'default' => 'Copyright © 2016'
|
271 |
+
),
|
272 |
+
)
|
273 |
|
274 |
|
275 |
|
276 |
) );
|
277 |
|
278 |
+
// ADS SECTION
|
279 |
Redux::setSection( $opt_name, array(
|
280 |
'title' => __( 'Advertisement', 'redux-framework-demo' ),
|
281 |
+
'desc' => __( 'The First and Only plugin to be the Adsense AMP-AD compatible!'),
|
282 |
'id' => 'amp-ads',
|
283 |
'subsection' => true,
|
284 |
'fields' => array(
|
285 |
+
// Ad 1 Starts
|
286 |
+
array(
|
287 |
+
'id' =>'enable-amp-ads-1',
|
288 |
+
'type' => 'switch',
|
289 |
+
'title' => __('AD #1', 'redux-framework-demo'),
|
290 |
+
'default' => 0,
|
291 |
+
'subtitle' => __('Below the Header (SiteWide)', 'redux-framework-demo'),
|
292 |
+
'true' => 'Enabled',
|
293 |
+
'false' => 'Disabled',
|
294 |
+
),
|
295 |
array(
|
296 |
'id' => 'enable-amp-ads-select-1',
|
297 |
'type' => 'select',
|
307 |
),
|
308 |
'default' => '2',
|
309 |
),
|
|
|
310 |
array(
|
311 |
+
'id' =>'enable-amp-ads-text-feild-client-1',
|
312 |
+
'type' => 'text',
|
313 |
+
'required' => array('enable-amp-ads-1', '=' , '1'),
|
314 |
+
'title' => __('Data AD Client', 'redux-framework-demo'),
|
315 |
+
'desc' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code. e.g. ca-pub-2005682797531342', 'redux-framework-demo'),
|
316 |
+
'default' => ''
|
317 |
),
|
318 |
array(
|
319 |
+
'id' => 'enable-amp-ads-text-feild-slot-1',
|
320 |
+
'type' => 'text',
|
321 |
+
'title' => __('Data AD Slot', 'redux-framework-demo'),
|
322 |
+
'desc' => __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
|
323 |
'default' => '',
|
324 |
'required' => array('enable-amp-ads-1', '=' , '1'),
|
325 |
),
|
326 |
+
// Ad 1 ends
|
327 |
+
// Ad 2 Starts
|
328 |
array(
|
329 |
+
'id'=>'enable-amp-ads-2',
|
330 |
+
'type' => 'switch',
|
331 |
'title' => __('AD #2', 'redux-framework-demo'),
|
332 |
+
'default' => 0,
|
333 |
+
'subtitle' => __('Below the Footer (SiteWide)', 'redux-framework-demo'),
|
334 |
'true' => 'Enabled',
|
335 |
'false' => 'Disabled',
|
336 |
),
|
|
|
337 |
array(
|
338 |
'id' => 'enable-amp-ads-select-2',
|
339 |
'type' => 'select',
|
349 |
),
|
350 |
'default' => '2',
|
351 |
),
|
|
|
352 |
array(
|
353 |
+
'id' =>'enable-amp-ads-text-feild-client-2',
|
354 |
+
'type' => 'text',
|
355 |
+
'required' => array('enable-amp-ads-2', '=' , '1'),
|
356 |
+
'title' => __('Data AD Client', 'redux-framework-demo'),
|
357 |
+
'desc' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code. e.g. ca-pub-2005682797531342', 'redux-framework-demo'),
|
358 |
+
'default' => ''
|
359 |
),
|
360 |
array(
|
361 |
'id' => 'enable-amp-ads-text-feild-slot-2',
|
362 |
'type' => 'text',
|
363 |
+
'title' => __('Data AD Slot', 'redux-framework-demo'),
|
364 |
+
'desc' => __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
|
365 |
'default' => '',
|
366 |
'required' => array('enable-amp-ads-2', '=' , '1'),
|
367 |
),
|
368 |
+
// Ad 2 ends
|
369 |
+
// Ad 3 starts
|
370 |
array(
|
371 |
+
'id' => 'enable-amp-ads-3',
|
372 |
+
'type' => 'switch',
|
373 |
+
'title' => __('AD #3', 'redux-framework-demo'),
|
374 |
+
'default' => 0,
|
375 |
+
'subtitle' => __('Above the Post Content (Single Post)', 'redux-framework-demo'),
|
376 |
+
'true' => 'Enabled',
|
377 |
+
'false' => 'Disabled',
|
378 |
),
|
|
|
379 |
array(
|
380 |
+
'id' => 'enable-amp-ads-select-3',
|
381 |
+
'type' => 'select',
|
382 |
+
'title' => __('AD Size', 'redux-framework-demo'),
|
383 |
+
'required' => array('enable-amp-ads-3', '=' , '1'),
|
384 |
// Must provide key => value pairs for select options
|
385 |
+
'options' => array(
|
386 |
+
'1' => '300x250',
|
387 |
+
'2' => '336x280',
|
388 |
+
'3' => '728x90',
|
389 |
+
'4' => '300x600',
|
390 |
+
'5' => '320x100'
|
391 |
),
|
392 |
'default' => '2',
|
393 |
),
|
|
|
394 |
array(
|
395 |
+
'id' =>'enable-amp-ads-text-feild-client-3',
|
396 |
+
'type' => 'text',
|
397 |
+
'required' => array('enable-amp-ads-3', '=' , '1'),
|
398 |
+
'title' => __('Data AD Client', 'redux-framework-demo'),
|
399 |
+
'desc' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code. e.g. ca-pub-2005682797531342', 'redux-framework-demo'),
|
400 |
+
'default' => ''
|
401 |
),
|
402 |
array(
|
403 |
+
'id' => 'enable-amp-ads-text-feild-slot-3',
|
404 |
+
'type' => 'text',
|
405 |
+
'title' => __('Data AD Slot', 'redux-framework-demo'),
|
406 |
+
'desc' => __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
|
407 |
+
'default' => '',
|
408 |
+
'required' => array('enable-amp-ads-3', '=' , '1'),
|
409 |
),
|
410 |
+
// Ad 3 ends
|
411 |
+
// Ad 4 Starts
|
412 |
+
array(
|
413 |
+
'id' => 'enable-amp-ads-4',
|
414 |
+
'type' => 'switch',
|
415 |
+
'title' => __('AD #4', 'redux-framework-demo'),
|
416 |
+
'default' => 0,
|
417 |
+
'subtitle' => __('Below the Post Content (Single Post)', 'redux-framework-demo'),
|
418 |
+
'true' => 'Enabled',
|
419 |
+
'false' => 'Disabled',
|
420 |
+
),
|
|
|
421 |
array(
|
422 |
'id' => 'enable-amp-ads-select-4',
|
423 |
'type' => 'select',
|
433 |
),
|
434 |
'default' => '2',
|
435 |
),
|
|
|
436 |
array(
|
437 |
+
'id' =>'enable-amp-ads-text-feild-client-4',
|
438 |
+
'type' => 'text',
|
439 |
+
'required' => array('enable-amp-ads-4', '=' , '1'),
|
440 |
+
'title' => __('Data AD Client', 'redux-framework-demo'),
|
441 |
+
'desc' => __('Enter the Data Ad Client (data-ad-client) from the adsense ad code. e.g. ca-pub-2005682797531342', 'redux-framework-demo'),
|
442 |
+
'default' => ''
|
443 |
),
|
444 |
array(
|
445 |
+
'id' => 'enable-amp-ads-text-feild-slot-4',
|
446 |
+
'type' => 'text',
|
447 |
+
'title' => __('Data AD Slot', 'redux-framework-demo'),
|
448 |
+
'desc' => __('Enter the Data Ad Slot (data-ad-slot) from the adsense ad code. e.g. 7046626912', 'redux-framework-demo'),
|
449 |
+
'default' => '',
|
450 |
+
'required' => array('enable-amp-ads-4', '=' , '1'),
|
451 |
)
|
452 |
+
// Ad 4 ends
|
453 |
+
),
|
454 |
+
|
455 |
+
) );
|
456 |
+
|
457 |
+
|
458 |
+
// Single Section
|
459 |
+
Redux::setSection( $opt_name, array(
|
460 |
+
'title' => __( 'Single', 'redux-framework-demo' ),
|
461 |
+
'desc' => __( 'Additional Options to control the look of Single', 'redux-framework-demo' ),
|
462 |
+
'id' => 'amp-single',
|
463 |
+
'subsection' => true,
|
464 |
+
'fields' => array(
|
465 |
+
|
466 |
+
// Featured Image ON/OFF
|
467 |
+
// array(
|
468 |
+
// 'id' => 'enable-single-featured-image',
|
469 |
+
// 'type' => 'switch',
|
470 |
+
// 'title' => __('Featured Image Above Post Content', 'redux-framework-demo'),
|
471 |
+
// 'default' => 0,
|
472 |
+
// 'subtitle' => __('Enable Featured Image in the single post', 'redux-framework-demo'),
|
473 |
+
// 'true' => 'Enabled',
|
474 |
+
// 'false' => 'Disabled',
|
475 |
+
// ),
|
476 |
+
// Post Meta ON/OFF
|
477 |
+
array(
|
478 |
+
'id' => 'enable-single-post-meta',
|
479 |
+
'type' => 'switch',
|
480 |
+
'title' => __('Post Meta Above Post Content', 'redux-framework-demo'),
|
481 |
+
'default' => 1,
|
482 |
+
'subtitle' => __('Enable Post Meta in the single post', 'redux-framework-demo'),
|
483 |
+
'true' => 'Enabled',
|
484 |
+
'false' => 'Disabled',
|
485 |
+
),
|
486 |
+
// Social Icons ON/OFF
|
487 |
+
array(
|
488 |
+
'id' => 'enable-single-social-icons',
|
489 |
+
'type' => 'switch',
|
490 |
+
'title' => __('Social Icons', 'redux-framework-demo'),
|
491 |
+
'default' => 1,
|
492 |
+
'subtitle' => __('Enable Social Icons in single', 'redux-framework-demo'),
|
493 |
+
),
|
494 |
+
// Facebook ON/OFF
|
495 |
+
array(
|
496 |
+
'id' => 'enable-single-facebook-share',
|
497 |
+
'type' => 'switch',
|
498 |
+
'required' => array('enable-single-social-icons', '=' , '1'),
|
499 |
+
'title' => __('Facebook', 'redux-framework-demo'),
|
500 |
+
'default' => 1,
|
501 |
+
),
|
502 |
+
// Twitter ON/OFF
|
503 |
+
array(
|
504 |
+
'id' => 'enable-single-twitter-share',
|
505 |
+
'type' => 'switch',
|
506 |
+
'required' => array('enable-single-social-icons', '=' , '1'),
|
507 |
+
'title' => __('Twitter', 'redux-framework-demo'),
|
508 |
+
'default' => 1,
|
509 |
+
),
|
510 |
+
// GooglePlus ON/OFF
|
511 |
+
array(
|
512 |
+
'id' => 'enable-single-gplus-share',
|
513 |
+
'type' => 'switch',
|
514 |
+
'required' => array('enable-single-social-icons', '=' , '1'),
|
515 |
+
'title' => __('GooglePlus', 'redux-framework-demo'),
|
516 |
+
'default' => 1,
|
517 |
+
),
|
518 |
+
// Email ON/OFF
|
519 |
+
array(
|
520 |
+
'id' => 'enable-single-email-share',
|
521 |
+
'type' => 'switch',
|
522 |
+
'required' => array('enable-single-social-icons', '=' , '1'),
|
523 |
+
'title' => __('Email', 'redux-framework-demo'),
|
524 |
+
'default' => 1,
|
525 |
+
),
|
526 |
+
// Pinterest ON/OFF
|
527 |
+
array(
|
528 |
+
'id' => 'enable-single-pinterest-share',
|
529 |
+
'type' => 'switch',
|
530 |
+
'required' => array('enable-single-social-icons', '=' , '1'),
|
531 |
+
'title' => __('Pinterest', 'redux-framework-demo'),
|
532 |
+
'default' => 1,
|
533 |
+
),
|
534 |
+
// LinkedIn ON/OFF
|
535 |
+
array(
|
536 |
+
'id' => 'enable-single-linkedin-share',
|
537 |
+
'type' => 'switch',
|
538 |
+
'required' => array('enable-single-social-icons', '=' , '1'),
|
539 |
+
'title' => __('LinkedIn', 'redux-framework-demo'),
|
540 |
+
'default' => 1,
|
541 |
+
),
|
542 |
),
|
543 |
|
544 |
) );
|
545 |
|
546 |
+
// CSS
|
547 |
Redux::setSection( $opt_name, array(
|
548 |
'title' => __( 'Custom CSS Editor', 'redux-framework-demo' ),
|
549 |
// 'desc' => __( 'For full documentation on this field, visit: ', 'redux-framework-demo' ) . '<a href="http://docs.reduxframework.com/core/fields/textarea/" target="_blank">http://docs.reduxframework.com/core/fields/textarea/</a>',
|
readme.txt
CHANGED
@@ -3,17 +3,17 @@ Contributors: mohammed_kaludi, ahmedkaludi
|
|
3 |
Tags: amp, accelerated mobile pages, mobile, amp project, google amp, amp wp, google
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.5.3
|
6 |
-
Stable tag: 0.7.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
-
Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site. AMP WP is a plugin that needs to no configuration, just activate it and you are done.
|
15 |
|
16 |
-
[View Demo and Screenshot of the plugin](http://ahmedkaludi.com/accelerated-mobile-pages/)
|
17 |
|
18 |
**Features:**
|
19 |
|
@@ -32,10 +32,10 @@ Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on
|
|
32 |
* Great Support & Active Development
|
33 |
|
34 |
|
35 |
-
**NOTE: Next Big Update of this plugin will be released
|
36 |
|
37 |
|
38 |
-
**How to test if AMP is working or not?**
|
39 |
|
40 |
After you install the plugin, Google will automatically index the amp pages using the amp tag and then show you the updates in the search console.
|
41 |
|
@@ -103,16 +103,16 @@ Add /?amp at the end of your website url and you will get amp version of your we
|
|
103 |
|
104 |
= I have addded /?amp at the end of the url and still I'm not able to see the AMP version of my site? =
|
105 |
|
106 |
-
Please check if you have "Pretty Permalinks" enabled. If not then activate it. For more details about Pretty Permalinks check out this wonderful article https://codex.wordpress.org/Using_Permalinks
|
107 |
|
108 |
|
109 |
|
110 |
== Screenshots ==
|
111 |
-
1. AMP Homepage
|
112 |
2. AMP Single Post
|
113 |
3. Post Navigation in Single
|
114 |
4. Sticky Social sharing icons
|
115 |
-
5. Overlay Navigation menu sidebar.
|
116 |
|
117 |
|
118 |
== Changelog ==
|
@@ -129,7 +129,7 @@ Please check if you have "Pretty Permalinks" enabled. If not then activate it. F
|
|
129 |
* ?mobile & ?nomobile is now ?amp & ?noamp
|
130 |
|
131 |
= 0.3 =
|
132 |
-
* Support of amp-img added in single posts
|
133 |
* minor css bug fixed
|
134 |
|
135 |
= 0.4 =
|
@@ -166,5 +166,16 @@ Please check if you have "Pretty Permalinks" enabled. If not then activate it. F
|
|
166 |
* Few Minor Bugs Fixed
|
167 |
|
168 |
= 0.7.6 =
|
169 |
-
* Google Adsense Support Added with AMP-Ad
|
170 |
-
* Wrong Homepage rel amphtml bug fixed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
Tags: amp, accelerated mobile pages, mobile, amp project, google amp, amp wp, google
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.5.3
|
6 |
+
Stable tag: 0.7.7
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
+
AMP for WordPress Support out of the box. Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site. AMP WP is a plugin that needs to no configuration, just activate it and you are done.
|
15 |
|
16 |
+
[What's New in Version 0.7.7?](http://ampforwp.com/blog/amp-0-7-7/) | [Priority Support](http://ampforwp.com/priority-support/) | [View Demo and Screenshot of the plugin](http://ahmedkaludi.com/accelerated-mobile-pages/)
|
17 |
|
18 |
**Features:**
|
19 |
|
32 |
* Great Support & Active Development
|
33 |
|
34 |
|
35 |
+
**NOTE: Next Big Update of this plugin will be released by 23rd September 2016.
|
36 |
|
37 |
|
38 |
+
**How to test if AMP is working or not?**
|
39 |
|
40 |
After you install the plugin, Google will automatically index the amp pages using the amp tag and then show you the updates in the search console.
|
41 |
|
103 |
|
104 |
= I have addded /?amp at the end of the url and still I'm not able to see the AMP version of my site? =
|
105 |
|
106 |
+
Please check if you have "Pretty Permalinks" enabled. If not then activate it. For more details about Pretty Permalinks check out this wonderful article https://codex.wordpress.org/Using_Permalinks
|
107 |
|
108 |
|
109 |
|
110 |
== Screenshots ==
|
111 |
+
1. AMP Homepage
|
112 |
2. AMP Single Post
|
113 |
3. Post Navigation in Single
|
114 |
4. Sticky Social sharing icons
|
115 |
+
5. Overlay Navigation menu sidebar.
|
116 |
|
117 |
|
118 |
== Changelog ==
|
129 |
* ?mobile & ?nomobile is now ?amp & ?noamp
|
130 |
|
131 |
= 0.3 =
|
132 |
+
* Support of amp-img added in single posts
|
133 |
* minor css bug fixed
|
134 |
|
135 |
= 0.4 =
|
166 |
* Few Minor Bugs Fixed
|
167 |
|
168 |
= 0.7.6 =
|
169 |
+
* Google Adsense Support Added with AMP-Ad
|
170 |
+
* Wrong Homepage rel amphtml bug fixed
|
171 |
+
|
172 |
+
= 0.7.7 =
|
173 |
+
* Proper Details at http://ampforwp.com/blog/amp-0-7-7/
|
174 |
+
* Big Validation Error fix Update
|
175 |
+
* Disable AMP support on specific Pages and Posts
|
176 |
+
* Option to disable the Post meta from the Single
|
177 |
+
* Footer Credits and Copyright Text Option
|
178 |
+
* New options for Social Sharing Bar in Single
|
179 |
+
* Jetpack Social & Related Sharing Issue fixed
|
180 |
+
* Gaping in footer if the Sticky bar is enabled
|
181 |
+
* Text domain added on few strings
|
themes/default/footer.php
CHANGED
@@ -1,30 +1,30 @@
|
|
1 |
<?php global $redux_builder_amp; ?>
|
2 |
-
<?php if($redux_builder_amp['enable-amp-ads-2'] == true)
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
<?php
|
22 |
</main>
|
23 |
|
24 |
<footer class="container">
|
25 |
<div id="footer">
|
26 |
-
<p><a href="#header">Top
|
27 |
-
<p
|
28 |
</div>
|
29 |
</footer>
|
30 |
<?php //wp_footer(); ?>
|
1 |
<?php global $redux_builder_amp; ?>
|
2 |
+
<?php if($redux_builder_amp['enable-amp-ads-2'] == true) { ?>
|
3 |
+
<div class="amp-ad-wrapper">
|
4 |
+
<amp-ad class="amp-ad-2"
|
5 |
+
<?php if($redux_builder_amp['enable-amp-ads-select-2'] == 1) : ?>
|
6 |
+
width=300 height=250
|
7 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-2'] == 2) :?>
|
8 |
+
width=336 height=280
|
9 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-2'] == 3) :?>
|
10 |
+
width=728 height=90
|
11 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-2'] == 4) :?>
|
12 |
+
width=300 height=600
|
13 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-2'] == 5) :?>
|
14 |
+
width=320 height=100
|
15 |
+
<?php endif?>
|
16 |
+
type="adsense"
|
17 |
+
data-ad-client="<?php echo $redux_builder_amp['enable-amp-ads-text-feild-client-2']; ?>"
|
18 |
+
data-ad-slot="<?php echo $redux_builder_amp['enable-amp-ads-text-feild-slot-2']; ?>">
|
19 |
+
</amp-ad>
|
20 |
+
</div>
|
21 |
+
<?php } ?>
|
22 |
</main>
|
23 |
|
24 |
<footer class="container">
|
25 |
<div id="footer">
|
26 |
+
<p><a href="#header"> <?php _e('Top','ampwp');?></a> | <a href="?noamp"><?php _e('View Non-AMP Version','ampwp');?></a></p>
|
27 |
+
<p><?php echo $redux_builder_amp['amp-footer-text']; ?> </p>
|
28 |
</div>
|
29 |
</footer>
|
30 |
<?php //wp_footer(); ?>
|
themes/default/functions.php
CHANGED
@@ -44,44 +44,42 @@ function amp_custom_style() {
|
|
44 |
display: inline-block
|
45 |
}
|
46 |
.toggle-navigationv2 ul li a{
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
}
|
54 |
.close-nav{
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
}
|
66 |
.close-nav:hover{
|
67 |
-
|
68 |
}
|
69 |
|
70 |
.sticky_social{
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
text-align: center;
|
83 |
}
|
84 |
-
|
85 |
body{
|
86 |
font: 16px/1.4 Sans-serif;
|
87 |
}
|
@@ -259,6 +257,9 @@ function amp_custom_style() {
|
|
259 |
#footer p{
|
260 |
margin: 0
|
261 |
}
|
|
|
|
|
|
|
262 |
.single_img img{
|
263 |
width: 100%;
|
264 |
height: 100%
|
@@ -383,7 +384,7 @@ add_action('amp_custom_style','amp_custom_style');
|
|
383 |
// amp_image_tag will convert all the img tags and will change it to amp-img to make it AMP compatible.
|
384 |
function amp_image_tag($content) {
|
385 |
$replace = array (
|
386 |
-
|
387 |
);
|
388 |
$content = strtr($content, $replace);
|
389 |
return $content;
|
@@ -395,26 +396,59 @@ add_filter('the_content','amp_image_tag');
|
|
395 |
function amp_iframe_tag($content) {
|
396 |
$replace = array (
|
397 |
'<iframe' => '<amp-iframe',
|
398 |
-
'</iframe>' => '</amp-iframe>'
|
399 |
);
|
400 |
$content = strtr($content, $replace);
|
401 |
return $content;
|
402 |
}
|
403 |
-
add_filter('the_content','amp_iframe_tag');
|
404 |
-
|
405 |
|
|
|
406 |
// Strip the styles
|
407 |
-
add_filter( 'the_content', 'the_content_filter', 20 );
|
408 |
-
function the_content_filter( $content ) {
|
409 |
-
$content = preg_replace('
|
410 |
-
$content = preg_replace('
|
411 |
-
$content = preg_replace('
|
412 |
-
$content = preg_replace('#<
|
413 |
-
$content = preg_replace('#<
|
414 |
-
$content = preg_replace('#<
|
415 |
-
$content = preg_replace('#<
|
416 |
-
$content = preg_replace('#<
|
417 |
-
$content = preg_replace('#<
|
418 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
}
|
420 |
?>
|
44 |
display: inline-block
|
45 |
}
|
46 |
.toggle-navigationv2 ul li a{
|
47 |
+
padding: 15px 25px;
|
48 |
+
width: 100%;
|
49 |
+
display: inline-block;
|
50 |
+
background: #fafafa;
|
51 |
+
font-size: 14px;
|
52 |
+
border-bottom: 1px solid #efefef;
|
53 |
}
|
54 |
.close-nav{
|
55 |
+
font-size: 12px;
|
56 |
+
background: rgba(0, 0, 0, 0.25);
|
57 |
+
letter-spacing: 1px;
|
58 |
+
display: inline-block;
|
59 |
+
padding: 10px;
|
60 |
+
border-radius: 100px;
|
61 |
+
line-height: 8px;
|
62 |
+
margin: 14px;
|
63 |
+
left: 191px;
|
64 |
+
color: #fff;
|
65 |
}
|
66 |
.close-nav:hover{
|
67 |
+
background: rgba(0, 0, 0, 0.45);
|
68 |
}
|
69 |
|
70 |
.sticky_social{
|
71 |
+
width: 100%;
|
72 |
+
bottom: 0;
|
73 |
+
display: block;
|
74 |
+
left: 0;
|
75 |
+
box-shadow: 0px 4px 7px #000;
|
76 |
+
background: #fff;
|
77 |
+
padding: 7px 0px 0px 0px;
|
78 |
+
position: fixed;
|
79 |
+
margin: 0;
|
80 |
+
z-index: 999;
|
81 |
+
text-align: center;
|
|
|
82 |
}
|
|
|
83 |
body{
|
84 |
font: 16px/1.4 Sans-serif;
|
85 |
}
|
257 |
#footer p{
|
258 |
margin: 0
|
259 |
}
|
260 |
+
.sticky-ad-enabled footer {
|
261 |
+
padding-bottom: 41px;
|
262 |
+
}
|
263 |
.single_img img{
|
264 |
width: 100%;
|
265 |
height: 100%
|
384 |
// amp_image_tag will convert all the img tags and will change it to amp-img to make it AMP compatible.
|
385 |
function amp_image_tag($content) {
|
386 |
$replace = array (
|
387 |
+
// '<img' => '<amp-img'
|
388 |
);
|
389 |
$content = strtr($content, $replace);
|
390 |
return $content;
|
396 |
function amp_iframe_tag($content) {
|
397 |
$replace = array (
|
398 |
'<iframe' => '<amp-iframe',
|
399 |
+
'</iframe>' => '</amp-iframe>'
|
400 |
);
|
401 |
$content = strtr($content, $replace);
|
402 |
return $content;
|
403 |
}
|
404 |
+
add_filter('the_content','amp_iframe_tag', 20 );
|
|
|
405 |
|
406 |
+
|
407 |
// Strip the styles
|
408 |
+
add_filter( 'the_content', 'the_content_filter', 20 );
|
409 |
+
function the_content_filter( $content ) {
|
410 |
+
$content = preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', '', $content); // This will replace all sequences of two or more spaces, tabs, and/or line breaks with a single space:
|
411 |
+
$content = preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', '', $content);
|
412 |
+
$content = preg_replace('/<style\b[^>]*>(.*?)<\/style>/is', '', $content);
|
413 |
+
$content = preg_replace('#<fb:like\b[^>]*>(.*?)</fb:like>#i', '', $content);
|
414 |
+
$content = preg_replace('#<fb:comments\b[^>]*>(.*?)</fb:comments>#i', '', $content);
|
415 |
+
$content = preg_replace('#<script .*?>(.*?)</script>#i', '', $content);
|
416 |
+
$content = preg_replace('#<script type="text/javascript">.*?</script>#i', '', $content);
|
417 |
+
$content = preg_replace('#<fb:like (.*?)></fb:like>#i', '', $content);
|
418 |
+
$content = preg_replace('#<fb:comments .*?></fb:comments>#i', '', $content);
|
419 |
+
$content = preg_replace('#<img (.*?)>#i', '<amp-img layout="responsive" \1></amp-img>', $content);
|
420 |
+
$content = preg_replace('#<img (.*?) />#i', '<amp-img layout="responsive" \1></amp-img>', $content);
|
421 |
+
$content = preg_replace('/style[^>]*/', '', $content);
|
422 |
+
$content = preg_replace('/onclick[^>]*/', '', $content);
|
423 |
+
$content = preg_replace('/onmouseover[^>]*/', '', $content);
|
424 |
+
$content = preg_replace('/onmouseout[^>]*/', '', $content);
|
425 |
+
$content = preg_replace('/target[^>]*/', '', $content);
|
426 |
+
return $content;
|
427 |
+
}
|
428 |
+
|
429 |
+
// Check if Jetpack is active and remove unsupported features
|
430 |
+
if ( class_exists( 'Jetpack' ) && ! ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ) {
|
431 |
+
ampwp_jetpack_disable_sharing();
|
432 |
+
ampwp_jetpack_disable_related_posts();
|
433 |
+
}
|
434 |
+
/**
|
435 |
+
* Remove JetPack Sharing
|
436 |
+
*
|
437 |
+
**/
|
438 |
+
function ampwp_jetpack_disable_sharing() {
|
439 |
+
add_filter( 'sharing_show', '__return_false', 100 );
|
440 |
+
}
|
441 |
+
|
442 |
+
/**
|
443 |
+
* Remove the Related Posts placeholder and headline that gets hooked into the_content
|
444 |
+
*
|
445 |
+
* That placeholder is useless since we can't ouput, and don't want to output Related Posts in AMP.
|
446 |
+
*
|
447 |
+
**/
|
448 |
+
function ampwp_jetpack_disable_related_posts() {
|
449 |
+
if ( class_exists( 'Jetpack_RelatedPosts' ) ) {
|
450 |
+
$ampwp_jprp = Jetpack_RelatedPosts::init();
|
451 |
+
remove_filter( 'the_content', array( $ampwp_jprp, 'filter_add_target_to_dom' ), 40 );
|
452 |
+
}
|
453 |
}
|
454 |
?>
|
themes/default/header.php
CHANGED
@@ -1,15 +1,17 @@
|
|
1 |
<?php global $redux_builder_amp; ?><!doctype html>
|
2 |
<html amp>
|
3 |
|
4 |
-
<head>
|
5 |
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
|
6 |
|
7 |
-
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
|
8 |
-
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
|
9 |
-
<script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>
|
10 |
-
|
11 |
-
<script async custom-element="amp-
|
12 |
-
|
|
|
|
|
13 |
|
14 |
<title>
|
15 |
<?php
|
@@ -52,63 +54,64 @@
|
|
52 |
*/
|
53 |
do_action('amp_custom_style'); ?>
|
54 |
|
55 |
-
</head>
|
56 |
-
|
57 |
-
<body id="<?php if ( !is_single() && !is_page() ) { ?>home<?php } ?>"
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
<?php
|
71 |
-
|
72 |
-
<?php
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
</
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
</
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
}
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
|
1 |
<?php global $redux_builder_amp; ?><!doctype html>
|
2 |
<html amp>
|
3 |
|
4 |
+
<head>
|
5 |
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
|
6 |
|
7 |
+
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
|
8 |
+
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
|
9 |
+
<script async custom-element="amp-sidebar" src="https://cdn.ampproject.org/v0/amp-sidebar-0.1.js"></script>
|
10 |
+
<?php if( $redux_builder_amp['enable-single-social-icons'] == true ) { ?>
|
11 |
+
<script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
|
12 |
+
<?php } ?>
|
13 |
+
<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
|
14 |
+
<script async custom-element="amp-sticky-ad" src="https://cdn.ampproject.org/v0/amp-sticky-ad-0.1.js"></script>
|
15 |
|
16 |
<title>
|
17 |
<?php
|
54 |
*/
|
55 |
do_action('amp_custom_style'); ?>
|
56 |
|
57 |
+
</head>
|
58 |
+
|
59 |
+
<body id="<?php if ( !is_single() && !is_page() ) { ?>home<?php } ?>" class="<?php if( is_single()
|
60 |
+
&& $redux_builder_amp['enable-single-social-icons'] == true ) { ?>sticky-ad-enabled <?php }?>">
|
61 |
+
|
62 |
+
<header class="container">
|
63 |
+
<div id="headerwrap">
|
64 |
+
<div id="header">
|
65 |
+
|
66 |
+
<?php global $redux_builder_amp; ?>
|
67 |
+
|
68 |
+
<?php if (true == ($redux_builder_amp['opt-media']['url'])): ?>
|
69 |
+
<a href="<?php bloginfo('url'); ?>">
|
70 |
+
<amp-img src="<?php echo $redux_builder_amp['opt-media']['url']; ?>" width="190" height="36" alt="logo" class="amp-logo"></amp-img>
|
71 |
+
</a>
|
72 |
+
<?php endif; ?>
|
73 |
+
<?php if (false == ($redux_builder_amp['opt-media']['url'])): ?>
|
74 |
+
<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
|
75 |
+
<?php endif ?>
|
76 |
+
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
</header>
|
80 |
+
|
81 |
+
|
82 |
+
<div on='tap:sidebar.toggle' role="button" tabindex="0" class="nav_container"> <a href="#" class="toggle-text">Navigate</a></div>
|
83 |
+
|
84 |
+
<amp-sidebar id='sidebar'
|
85 |
+
layout="nodisplay"
|
86 |
+
side="right">
|
87 |
+
<div class="toggle-navigationv2">
|
88 |
+
<div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div>
|
89 |
+
<?php wp_nav_menu( array( 'theme_location' => 'amp-menu' ) ); ?>
|
90 |
+
</div>
|
91 |
+
</amp-sidebar>
|
92 |
+
|
93 |
+
<?php if ( is_single() ) {
|
94 |
+
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. ?>
|
95 |
+
<?php }
|
96 |
+
} ?>
|
97 |
+
<main role="main">
|
98 |
+
<?php if($redux_builder_amp['enable-amp-ads-1'] == true) : ?>
|
99 |
+
<div class="amp-ad-wrapper">
|
100 |
+
<amp-ad class="amp-ad-1"
|
101 |
+
<?php if($redux_builder_amp['enable-amp-ads-select-1'] == 1) : ?>
|
102 |
+
width=300 height=250
|
103 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-1'] == 2) :?>
|
104 |
+
width=336 height=280
|
105 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-1'] == 3) :?>
|
106 |
+
width=728 height=90
|
107 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-1'] == 4) :?>
|
108 |
+
width=300 height=600
|
109 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-1'] == 5) :?>
|
110 |
+
width=320 height=100
|
111 |
+
<?php endif?>
|
112 |
+
type="adsense"
|
113 |
+
data-ad-client="<?php echo $redux_builder_amp['enable-amp-ads-text-feild-client-1']; ?>"
|
114 |
+
data-ad-slot="<?php echo $redux_builder_amp['enable-amp-ads-text-feild-slot-1']; ?>">
|
115 |
+
</amp-ad>
|
116 |
+
</div>
|
117 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-1'] == false) : endif ?>
|
themes/default/single.php
CHANGED
@@ -2,84 +2,89 @@
|
|
2 |
|
3 |
<div id="contentwrap">
|
4 |
<?php if ( have_posts() ): while ( have_posts() ): the_post(); ?>
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
<div id="title">
|
11 |
<h2><?php the_title(); ?></h2>
|
12 |
</div>
|
13 |
|
14 |
<div class="post">
|
15 |
-
<?php if($redux_builder_amp['enable-amp-ads-3'] == true)
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
<?php
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
56 |
|
57 |
<?php the_content(); ?>
|
58 |
<?php wp_link_pages( 'before=<p>&after=</p>&next_or_number=number&pagelink=Page %' ); ?>
|
59 |
|
60 |
-
<?php if($redux_builder_amp['enable-amp-ads-4'] == true)
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
<?php
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
<div id="posttags">
|
84 |
<p><?php the_tags( 'Tags: ', ', ' ); ?></p>
|
85 |
</div>
|
2 |
|
3 |
<div id="contentwrap">
|
4 |
<?php if ( have_posts() ): while ( have_posts() ): the_post(); ?>
|
5 |
+
<div class="<?php if($redux_builder_amp['enable-amp-ads-1'] == true) { ?> ad-1-wrapper <?php }?>">
|
6 |
+
<?php if($redux_builder_amp['enable-single-post-meta'] == true) { ?>
|
7 |
+
<div class="postmeta">
|
8 |
+
<p>By <a href="#"> <?php the_author_meta( 'display_name' ); ?> </a> on <?php the_time( get_option( 'date_format' ) ) ?> <span>Posted in <?php the_category( ', ' ) ?></span></p>
|
9 |
+
</div>
|
10 |
+
<?php } ?>
|
11 |
+
</div>
|
12 |
|
13 |
<div id="title">
|
14 |
<h2><?php the_title(); ?></h2>
|
15 |
</div>
|
16 |
|
17 |
<div class="post">
|
18 |
+
<?php if($redux_builder_amp['enable-amp-ads-3'] == true) { ?>
|
19 |
+
<div class="amp-ad-wrapper">
|
20 |
+
<amp-ad class="amp-ad-3"
|
21 |
+
<?php if($redux_builder_amp['enable-amp-ads-select-3'] == 1) : ?>
|
22 |
+
width=300 height=250
|
23 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 2) :?>
|
24 |
+
width=336 height=280
|
25 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 3) :?>
|
26 |
+
width=728 height=90
|
27 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 4) :?>
|
28 |
+
width=300 height=600
|
29 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-3'] == 5) :?>
|
30 |
+
width=320 height=100
|
31 |
+
<?php endif?>
|
32 |
+
type="adsense"
|
33 |
+
data-ad-client="<?php echo $redux_builder_amp['enable-amp-ads-text-feild-client-3']; ?>"
|
34 |
+
data-ad-slot="<?php echo $redux_builder_amp['enable-amp-ads-text-feild-slot-3']; ?>">
|
35 |
+
</amp-ad>
|
36 |
+
</div>
|
37 |
+
<?php } ?>
|
38 |
+
|
39 |
+
<?php if($redux_builder_amp['enable-single-social-icons'] == true) { ?>
|
40 |
+
<div class="sticky_social">
|
41 |
+
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
42 |
+
<amp-social-share type="facebook" width="50" height="28"></amp-social-share>
|
43 |
+
<?php } ?>
|
44 |
+
<?php if($redux_builder_amp['enable-single-twitter-share'] == true) { ?>
|
45 |
+
<amp-social-share type="twitter" width="50" height="28"></amp-social-share>
|
46 |
+
<?php } ?>
|
47 |
+
<?php if($redux_builder_amp['enable-single-gplus-share'] == true) { ?>
|
48 |
+
<amp-social-share type="gplus" width="50" height="28"></amp-social-share>
|
49 |
+
<?php } ?>
|
50 |
+
<?php if($redux_builder_amp['enable-single-email-share'] == true) { ?>
|
51 |
+
<amp-social-share type="email" width="50" height="28"></amp-social-share>
|
52 |
+
<?php } ?>
|
53 |
+
<?php if($redux_builder_amp['enable-single-pinterest-share'] == true) { ?>
|
54 |
+
<amp-social-share type="pinterest" width="50" height="28"></amp-social-share>
|
55 |
+
<?php } ?>
|
56 |
+
<?php if($redux_builder_amp['enable-single-linkedin-share'] == true) { ?>
|
57 |
+
<amp-social-share type="linkedin" width="50" height="28"></amp-social-share>
|
58 |
+
<?php } ?>
|
59 |
+
</div>
|
60 |
+
<?php } ?>
|
61 |
|
62 |
<?php the_content(); ?>
|
63 |
<?php wp_link_pages( 'before=<p>&after=</p>&next_or_number=number&pagelink=Page %' ); ?>
|
64 |
|
65 |
+
<?php if($redux_builder_amp['enable-amp-ads-4'] == true) { ?>
|
66 |
+
<div class="amp-ad-wrapper">
|
67 |
+
<amp-ad class="amp-ad-4"
|
68 |
+
<?php if($redux_builder_amp['enable-amp-ads-select-4'] == 1) : ?>
|
69 |
+
width=300 height=250
|
70 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-4'] == 2) :?>
|
71 |
+
width=336 height=280
|
72 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-4'] == 3) :?>
|
73 |
+
width=728 height=90
|
74 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-4'] == 4) :?>
|
75 |
+
width=300 height=600
|
76 |
+
<?php elseif ($redux_builder_amp['enable-amp-ads-select-4'] == 5) :?>
|
77 |
+
width=320 height=100
|
78 |
+
<?php endif?>
|
79 |
+
type="adsense"
|
80 |
+
data-ad-client="<?php echo $redux_builder_amp['enable-amp-ads-text-feild-client-4']; ?>"
|
81 |
+
data-ad-slot="<?php echo $redux_builder_amp['enable-amp-ads-text-feild-slot-4']; ?>">
|
82 |
+
</amp-ad>
|
83 |
+
</div>
|
84 |
+
<?php } ?>
|
85 |
+
|
86 |
+
</div>
|
87 |
+
|
88 |
<div id="posttags">
|
89 |
<p><?php the_tags( 'Tags: ', ', ' ); ?></p>
|
90 |
</div>
|