Version Description
(12th November 2017) = * View More details on https://ampforwp.com/0-9-68-released-stability-update-74th-update/ * ADs areOptimize For Viewability, meaning it will try to load faster than the original AMP AD loading strategy. * Content was disappearing issue was resolved #1392 * Featured Image from The Content option is connected to related post #1339 * Fix amp-web-push helper iframe configuration URL #1387 * Facebook Like button added to AMP #1327 * WPML support for AMP Improvement#1285 * Debug Errors fixed#1366 * Setting ad density for Facebook Instant Articles ads #1287 * Showing the number of comments in Single #1341 * Styling added to the sitewide ads and made sure that they are in the center. #1343 * One Signal buttons Translation added #1383 * Article type added to Structured data#1344 #1354 * The issue with the amp-carousel when RTL was enabled#1358 * amp-carousel with images of different sizes#1358 * a bug where Img is getting converted to amp-img if there's no height or width. which causing validation issue and image is not visible fixed. * Instant Article should have a default value for number of posts, it was causing the memory issue with alot of posts#1390 * Notice if a post has no author data #1338 * Added a new redux extension selectfield in redux framework#1349 * Issues with galleries as well as gallery captions #1363 * Added a hook for adding anything in between the loops #1396 * Hide meta boxes as per the user level types #1340 * ASwitch between the Date formats #1384 * Fix: Jannah theme lazy load issue#1362 * Issues with galleries as well as gallery captions #1363 * Create Dynamic url of amp according to the permalink structure #1318 * Minor code performance improvement. * Archive titles in Design 3 frontend issue
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 0.9.68 |
Comparing to | |
See all releases |
Code changes from version 0.9.67.0 to 0.9.68
- README.md +190 -7
- accelerated-moblie-pages.php +2 -2
- includes/options/admin-config.php +89 -8
- includes/options/extensions/demolink_image_select/demolink_image_select/field_demolink_image_select.css +1 -0
- includes/options/extensions/demolink_image_select/demolink_image_select/field_demolink_image_select.js +100 -0
- includes/options/extensions/demolink_image_select/demolink_image_select/field_demolink_image_select.php +234 -0
- includes/options/extensions/demolink_image_select/demolink_image_select/field_demolink_image_select.scss +19 -0
- includes/options/extensions/demolink_image_select/extension_demolink_image_select.php +110 -0
- includes/options/redux-core/assets/css/redux-admin.css +5 -1
- includes/vendor/amp/includes/class-amp-content.php +5 -3
- includes/vendor/amp/includes/class-amp-post-template.php +3 -1
- includes/vendor/amp/includes/embeds/class-amp-gallery-embed.php +3 -1
- pagebuilder/amp-page-builder.php +18 -8
- pagebuilder/functions.php +3 -1
- readme.txt +31 -1
- templates/custom-amp-content.php +21 -11
- templates/design-manager/design-1/archive.php +6 -2
- templates/design-manager/design-1/elements/comments.php +6 -2
- templates/design-manager/design-1/elements/related-posts.php +7 -7
- templates/design-manager/design-1/elements/social-icons.php +12 -0
- templates/design-manager/design-1/index.php +12 -5
- templates/design-manager/design-1/search.php +5 -1
- templates/design-manager/design-1/style.php +6 -1
- templates/design-manager/design-2/archive.php +6 -1
- templates/design-manager/design-2/elements/comments.php +6 -2
- templates/design-manager/design-2/elements/related-posts.php +7 -10
- templates/design-manager/design-2/elements/social-icons.php +12 -0
- templates/design-manager/design-2/index.php +5 -1
- templates/design-manager/design-2/search.php +5 -1
- templates/design-manager/design-2/style.php +7 -2
- templates/design-manager/design-3/archive.php +5 -1
- templates/design-manager/design-3/elements/comments.php +6 -2
- templates/design-manager/design-3/elements/related-posts.php +8 -11
- templates/design-manager/design-3/elements/social-icons.php +12 -0
- templates/design-manager/design-3/index.php +9 -6
- templates/design-manager/design-3/search.php +5 -1
- templates/design-manager/design-3/style.php +10 -3
- templates/features.php +208 -60
- templates/instant-articles/instant-article-sanitizer.php +6 -0
- templates/instant-articles/instant-article.php +3 -3
- templates/structured-data.php +9 -13
@@ -3,8 +3,8 @@ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
|
|
3 |
Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 4.8.
|
7 |
-
Stable tag: 0.9.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -31,11 +31,13 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
|
|
31 |
|
32 |
= Features: =
|
33 |
|
|
|
|
|
34 |
* NEW - Page Builder 2.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
|
35 |
* NEW - Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
|
36 |
* NEW - Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
|
37 |
-
*
|
38 |
-
*
|
39 |
* Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
|
40 |
* Facebook Comments Support
|
41 |
* Github Gist Support
|
@@ -56,7 +58,7 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
|
|
56 |
* 2 Designs Added
|
57 |
* Yoast SEO support on AMP pages and other SEO plugins
|
58 |
* AMP WooCommerce Support
|
59 |
-
* Switch on/off Support for Pages on AMP
|
60 |
* Translation Panel & RTL
|
61 |
* Internal AMP linking - You can browse AMP pages internally
|
62 |
* Related posts below the post
|
@@ -91,7 +93,10 @@ Bug reports for AMP for WP are [welcomed on GitHub](https://github.com/ahmedkalu
|
|
91 |
* Genesis SEO Support
|
92 |
* Breadcrumb Support added
|
93 |
* Facebook Instant Articles Support Added
|
94 |
-
* NEW - AMP
|
|
|
|
|
|
|
95 |
|
96 |
**[JOIN CHAT GROUP COMMUNITY](http://ampforwp.com/community/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
|
97 |
|
@@ -145,6 +150,184 @@ You can contact me using this url: http://ampforwp.com/contact/
|
|
145 |
|
146 |
== Changelog ==
|
147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
= 0.9.63 (8th October 2017) =
|
149 |
* View more details on https://ampforwp.com/new/
|
150 |
* Category and Tag Base Remover as core features #1079
|
@@ -166,7 +349,7 @@ You can contact me using this url: http://ampforwp.com/contact/
|
|
166 |
* Structured data improvements #1048 #1044 #1085 #1118
|
167 |
* Twitter share URL based on users choice, you can allow people to share pretty links and short links. #1097
|
168 |
* Author Avatar removed code fixed which has been displayed in the div "amp-wp-meta amp-wp-byline". #1087
|
169 |
-
* Only one
|
170 |
* Image alt tags are empty and cause issues fixed. #1154
|
171 |
* Button to copy the content into Custom AMP Editor #783
|
172 |
* Rename AMP loop widget areas or add proper descriptions #1045
|
3 |
Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 4.8.3
|
7 |
+
Stable tag: 0.9.67.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
31 |
|
32 |
= Features: =
|
33 |
|
34 |
+
* NEW - OneSignal Push Notifications integration
|
35 |
+
* NEW - Structured Data Options
|
36 |
* NEW - Page Builder 2.0 for AMP! [Learn More & Video](https://ampforwp.com/tutorials/article/amp-page-builder-installation/)
|
37 |
* NEW - Advanced WooCommerce Support [More Info](https://ampforwp.com/woocommerce/)
|
38 |
* NEW - Gravity Forms Support [More Info](https://ampforwp.com/gravity-forms/)
|
39 |
+
* AMP Plugins Manager - Which allows you to disable a specific plugin functionality only in the AMP version
|
40 |
+
* Page Break / NextPage (Pagination) Support
|
41 |
* Contact Form 7 Support [More Info](https://ampforwp.com/contact-form-7/)
|
42 |
* Facebook Comments Support
|
43 |
* Github Gist Support
|
58 |
* 2 Designs Added
|
59 |
* Yoast SEO support on AMP pages and other SEO plugins
|
60 |
* AMP WooCommerce Support
|
61 |
+
* Switch on/off Support for Pages & Posts on AMP
|
62 |
* Translation Panel & RTL
|
63 |
* Internal AMP linking - You can browse AMP pages internally
|
64 |
* Related posts below the post
|
93 |
* Genesis SEO Support
|
94 |
* Breadcrumb Support added
|
95 |
* Facebook Instant Articles Support Added
|
96 |
+
* NEW - AMP Installation Wizard that makes it easy to setup for new users.
|
97 |
+
* NEW - Category base remover support
|
98 |
+
* NEW - Tag base remover support
|
99 |
+
* NEW - AMP Theme Framework Core Support Added. You can now create Custom AMP templates in just minutes. **[More](https://ampforwp.com/amp-theme-framework/)**
|
100 |
|
101 |
**[JOIN CHAT GROUP COMMUNITY](http://ampforwp.com/community/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
|
102 |
|
150 |
|
151 |
== Changelog ==
|
152 |
|
153 |
+
= 0.9.68 (12th November 2017) =
|
154 |
+
* View More details on https://ampforwp.com/0-9-68-released-stability-update-74th-update/
|
155 |
+
* ADs are Optimize For Viewability, meaning it will try to load faster than the original AMP AD loading strategy.
|
156 |
+
* Content was disappearing issue was resolved #1392
|
157 |
+
* Featured Image from The Content option is connected to related post #1339
|
158 |
+
* Fix amp-web-push helper iframe configuration URL #1387
|
159 |
+
* Facebook Like button added to AMP #1327
|
160 |
+
* WPML support for AMP Improvement #1285
|
161 |
+
* Debug Errors fixed #1366
|
162 |
+
* Setting ad density for Facebook Instant Articles ads #1287
|
163 |
+
* Showing the number of comments in Single #1341
|
164 |
+
* Styling added to the sitewide ads and made sure that they are in the center. #1343
|
165 |
+
* One Signal buttons Translation added #1383
|
166 |
+
* Article type added to Structured data #1344 #1354
|
167 |
+
* The issue with the amp-carousel when RTL was enabled #1358
|
168 |
+
* amp-carousel with images of different sizes #1358
|
169 |
+
* a bug where Img is getting converted to amp-img if there's no height or width. which causing validation issue and image is not visible fixed.
|
170 |
+
* Instant Article should have a default value for number of posts, it was causing the memory issue with alot of posts #1390
|
171 |
+
* Notice if a post has no author data #1338
|
172 |
+
* Added a new redux extension select field in redux framework #1349
|
173 |
+
* Issues with galleries as well as gallery captions #1363
|
174 |
+
* Added a hook for adding anything in between the loops #1396
|
175 |
+
* Hide meta boxes as per the user level types #1340
|
176 |
+
* A Switch between the Date formats #1384
|
177 |
+
* Fix: Jannah theme lazy load issue #1362
|
178 |
+
* Issues with galleries as well as gallery captions #1363
|
179 |
+
* Create Dynamic url of amp according to the permalink structure #1318
|
180 |
+
* Minor code performance improvement.
|
181 |
+
* Archive titles in Design 3 frontend issue
|
182 |
+
|
183 |
+
= 0.9.67.0 (6th November 2017) =
|
184 |
+
* View more details on https://ampforwp.com/one-signal-push-notifications-for-amp/
|
185 |
+
* OneSignal Push Notifications integrated #807
|
186 |
+
* Vimeo embed support added
|
187 |
+
* SoundCloud embed support added
|
188 |
+
* Pinterest embed support added
|
189 |
+
* PlayBuzz embed support added
|
190 |
+
* DailyMotion embed support added
|
191 |
+
* Fix: Handle issues with data uri images in CSS #1033
|
192 |
+
* Fix attribute when adding AMP Mustache lib #1033
|
193 |
+
* Fix: Output CSS for feature image #1033
|
194 |
+
* An option added for users who don't want to receive update notifications #1342
|
195 |
+
* Structured data nav improvement
|
196 |
+
* Sitenavigationelement has been implemented correctly for footer menu. #1345
|
197 |
+
* Style sanitization for Menu Items #1359
|
198 |
+
* Polylang flags support for menu #1360
|
199 |
+
* Mobile Redirection issues fixed #1173
|
200 |
+
* Jetpack fatal error fixed #1355
|
201 |
+
* AMP Page Builder requires a button to be clicked, so the scripts are not running on the runtime making it easy on the edit screen page and avoid the possible script conflict.
|
202 |
+
* Needs proper CTA Bar's styling. #1361
|
203 |
+
* Debug errors on archive pages #1353
|
204 |
+
* Preview shall only be loaded on click rather than in background #1331
|
205 |
+
* ampforwp_is_home() function code improved
|
206 |
+
* making sure scripts and styling is properly adding when sanitizing the sidebar #868
|
207 |
+
* All the backend css and js should be versioned, so it's not cached. #1335
|
208 |
+
|
209 |
+
= 0.9.66.1 (30th October 2017) =
|
210 |
+
* Fatal error if has version less than WP 4.8 fixed
|
211 |
+
* More Minor Validation errors fixed
|
212 |
+
* Odnoklassniki sharing button is not working #1337
|
213 |
+
|
214 |
+
= 0.9.66.0 (29th October 2017) =
|
215 |
+
* View more details on https://ampforwp.com/0-9-66-released-bug-squashing-oct-2017-72nd-update/
|
216 |
+
* Design 3 & Design 1 are optimised with 90+ Google PageSpeed Score on Mobile and 95+ in desktop performance #1273
|
217 |
+
* Featured Image from the content for blog and homepage #1295
|
218 |
+
* Category Module for AMP Page builder added #888
|
219 |
+
* Don't load unused CSS selectors. All the CSS is conditionally loading, to decrease the number of CSS loaded per page and increased in performance #1292
|
220 |
+
* Twitter Video embed code support added in AMP #1307
|
221 |
+
* Video Posting Structured data #1293
|
222 |
+
* Navigation menus are now Schema compatible for better Structured data integration #1229
|
223 |
+
* Yoast checking conditions for Structured Data Improved #1293
|
224 |
+
* Added "back to Top" in design 3 #959
|
225 |
+
* Proper blog check and author for custom frontpage #1260 (Made some changes to check the blog properly and also added the author details for Custom Frontpage)
|
226 |
+
* AMP not working on password-protected pages #1192
|
227 |
+
* Debug errors reported by the user #1284 and few more we found internally
|
228 |
+
* Inline Style Sanitizer for Comments to avoid any validation issues #1193
|
229 |
+
* Next/Previous links removed from pages #1268 props @Frenchomatic
|
230 |
+
* WPML Multilingual CMS plugin flags compatibility added #1270
|
231 |
+
* Image sanitizer added for the Sidebar #1270
|
232 |
+
* Added AMP Components the correct way. Added amp-gist, amp-social-share. #336
|
233 |
+
* amp-video script added - Which decreases the non-critical validation issues #991
|
234 |
+
* Arrows in Design 3 pagination #1000
|
235 |
+
* Author page links in Single #1282
|
236 |
+
* Added previous open state of option panel and show again when search clean #1238
|
237 |
+
* Odnoklassniki Social Sharing Support for AMP (with target blank for better bounce rate) #1230
|
238 |
+
* GIF or animated images resize problem fixed #1281
|
239 |
+
* In Design1, Header Background & Link Color have same option #1249
|
240 |
+
* FB Pixel for AMP added #1231
|
241 |
+
* Structured Data Type option for AMPed Custom Post types only #1259
|
242 |
+
* Attribute ‘readability in the tag ‘div’ removed - this decreases the validation issues #1306
|
243 |
+
* AMP Theme Framework Improvements: loop, author, related_post, Add Author support #1311
|
244 |
+
* Commentator's Avatar in the comments section #1132
|
245 |
+
* Remove 'Welcome to AMP' from Dashboard sub-menu and moved to the options area to decrease the annoyance and increase the user happiness #902
|
246 |
+
* Option to Sort the Random Order of Related Posts to increase the audience engagement (Default is 'ID', on enabling the option it will change to 'rand') #1250
|
247 |
+
* View AMP on Admin Bar for the respected page/post If enable. #1236
|
248 |
+
* google maps iframe – link to larger map #1099
|
249 |
+
* Comments now jumping due to the slash at the end #1309
|
250 |
+
* Page Builder causes Incompatibility with the Divi theme (We restructured the Text Module for Page builder for better compatibility and UX) #1162
|
251 |
+
* Inline Style Sanitizer for Comments added. Less Critical Validation issues and Better Presentation #1193
|
252 |
+
* WPML amp-html error fixed #1285
|
253 |
+
* Radio button not working for Show View more Button" #1018
|
254 |
+
* Added registered handle for tinymcePointer localize data #1301
|
255 |
+
* Date in the Design 2 should not be hidden in mobile version #1315
|
256 |
+
* Page builder not working on homepage(Selected as front page) #1316
|
257 |
+
* Instant articles number of posts option #1271 (Removed some unused code as well, it will rendered all posts if none is enter in the options)
|
258 |
+
* Auto flush on save for FBIA to improve the UX.
|
259 |
+
* Plain Permalinks Support improved. #1318
|
260 |
+
* Tables support added to FB Instant Articles #1266
|
261 |
+
* Demo link added in the Theme selector option #1248
|
262 |
+
* Remove invalid attributes from multiple tags which reduces critical validation errors and validates pages.
|
263 |
+
* AMP makes a problem in archive page label, when it is active in non-amp version #1304
|
264 |
+
* placeholder-icon.png is 404 fixed #1310
|
265 |
+
* Category & Tags switches for Single added. #1055
|
266 |
+
* Copy Content (Custom AMP Editor) Option Not showing with Page Builder of SiteOrigin issue fixed #1280
|
267 |
+
* Improving UX with: when AMP support is off for a specific post type then all the AMP related metaboxes should be removed #1289
|
268 |
+
* Options Panel Options rearranged, labels rewritten, descriptions repositioned for better User interaction [commit]
|
269 |
+
|
270 |
+
= 0.9.65.2 (25th October 2017) =
|
271 |
+
* TypeWatch is not a function #1299
|
272 |
+
* Error with BackupBuddy fixed #1303
|
273 |
+
|
274 |
+
= 0.9.65.1 (24th October 2017) =
|
275 |
+
* AMP Minifcation Issues fixed
|
276 |
+
|
277 |
+
= 0.9.65 (22nd October 2017) =
|
278 |
+
* View more details on https://ampforwp.com/new/
|
279 |
+
* Favicon for AMP #1039
|
280 |
+
* AMP Minification option added with Performance Tab in Options #1286
|
281 |
+
* Post support is turned off then Meta box should also be removed #1253
|
282 |
+
* Excerpt Length feature in Design two and Three #1122
|
283 |
+
* Test Contact form plugins and their settings in the options panel #1121
|
284 |
+
* Mobile preview in Edit Screen #1082
|
285 |
+
* Search feature for Options Panel #1238
|
286 |
+
* WordPress Social Share Buttons Validation Issues #1272
|
287 |
+
* itemtype attribute is striping in the ul tag #1210
|
288 |
+
* Debug Error in Breadcrumb 0.9.64 #1267
|
289 |
+
* Disable AMP linking at Wordpress Search Page #969
|
290 |
+
* Featured Image is missing #1071
|
291 |
+
* Removed ampforwp_plugin_activation_notice #1034
|
292 |
+
* Add VK (Vkontakte) Sharing Button #1187
|
293 |
+
* Grab the first image instead of post thumbnail for featured image #1189
|
294 |
+
* AMP theme framework core changes #1274
|
295 |
+
* Grab the first image instead of post thumbnail for featured image #1189
|
296 |
+
* Create a Switch on Top of Page Builder #1279
|
297 |
+
* Inline Related Posts added that helps you with improving bounce rate #1078
|
298 |
+
* Caption Support in Image Gallery Carousel #1172 #1136
|
299 |
+
* Instant Articles feed shows sticky posts on top #945
|
300 |
+
* Added search check, to fix debug notice
|
301 |
+
* Option to hide date from Design 1 & Design 3 Homepage Loop #1264
|
302 |
+
* UI labels improvements in the Options panel
|
303 |
+
* Sorting out design #2 – static front page #1175
|
304 |
+
|
305 |
+
= 0.9.64 (15th October 2017) =
|
306 |
+
* View more details on https://ampforwp.com/new/
|
307 |
+
* Structured Data Type option added. You can now change the structured data format for Posts, Pages and Custom post types #323
|
308 |
+
* When comments plugin activate, Comments section should remove. #1093
|
309 |
+
* Notification causes a validation error. #1147
|
310 |
+
* CSS !important need sanitization #1225 - This will help us to validate tens of thousands of pages.
|
311 |
+
* Strange spaces when using Sassy Social Share #1185
|
312 |
+
* Remote CDN use? Let's host it? #549
|
313 |
+
* Typo fix for Linkedin Profile Page URL section #905 [Thanks to Prayag @pra85]
|
314 |
+
* Replace fastimage with fasterimage for PHP 5.4+ #1191
|
315 |
+
* Debug Errors Post 0.9.63 #1219
|
316 |
+
* Ad5 code injected twice #1116
|
317 |
+
* Homepage Support must be Off when we turn Off Homepage Support. #738
|
318 |
+
* Add custom class in post pagination for styling #1100
|
319 |
+
* Removed the Lazy Loading issue of Schema Theme #1170
|
320 |
+
* H1 tag for archive titles (Commit) #1155
|
321 |
+
* Alt tag for the Logo #1155
|
322 |
+
* Design 3 Menu RTL issue fixed #1106
|
323 |
+
* Ability to add dynamic classes in body tag #1237
|
324 |
+
* Warnings fixed on 404 page #1243
|
325 |
+
* Properly structured data for Homepage, Custom Frontpage and Blog #1155 #1242
|
326 |
+
* Option added to Enable/Disable categories and Tags links from Single #1155
|
327 |
+
* Fatal error after 0.9.63 fixed #1220
|
328 |
+
* Debug Error due to vendor AMP #1213
|
329 |
+
* PHP warning on line 147 after 0.9.63 #1241
|
330 |
+
|
331 |
= 0.9.63 (8th October 2017) =
|
332 |
* View more details on https://ampforwp.com/new/
|
333 |
* Category and Tag Base Remover as core features #1079
|
349 |
* Structured data improvements #1048 #1044 #1085 #1118
|
350 |
* Twitter share URL based on users choice, you can allow people to share pretty links and short links. #1097
|
351 |
* Author Avatar removed code fixed which has been displayed in the div "amp-wp-meta amp-wp-byline". #1087
|
352 |
+
* Only one figure element is allowed in the article header FB Instant Articles #1127 & #1157
|
353 |
* Image alt tags are empty and cause issues fixed. #1154
|
354 |
* Button to copy the content into Custom AMP Editor #783
|
355 |
* Rename AMP loop widget areas or add proper descriptions #1045
|
@@ -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/25
|
@@ -18,7 +18,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
|
|
18 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
|
19 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
20 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
21 |
-
define('AMPFORWP_VERSION','0.9.
|
22 |
|
23 |
// any changes to AMP_QUERY_VAR should be refelected here
|
24 |
function ampforwp_generate_endpoint(){
|
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.68
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
18 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
|
19 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
20 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
21 |
+
define('AMPFORWP_VERSION','0.9.68');
|
22 |
|
23 |
// any changes to AMP_QUERY_VAR should be refelected here
|
24 |
function ampforwp_generate_endpoint(){
|
@@ -13,6 +13,7 @@ $comment_AD_URL = "http://ampforwp.com/amp-comments/#utm_source=options-panel&ut
|
|
13 |
$comment_desc = '<a href="'.$comment_AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/comments-banner.png" width="560" height="85" /></a>';
|
14 |
}
|
15 |
// If CTA is not Activated
|
|
|
16 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
17 |
if(!is_plugin_active( 'AMP-cta/amp-cta.php' )){
|
18 |
$cta_AD_URL = "http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=call-to-action_banner_in_notification_bar&utm_campaign=AMP%20Plugin";
|
@@ -579,6 +580,15 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
579 |
'subsection' => true,
|
580 |
'fields' => array(
|
581 |
// Ad 1 Starts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
582 |
array(
|
583 |
'id' =>'enable-amp-ads-1',
|
584 |
'type' => 'switch',
|
@@ -1231,7 +1241,8 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1231 |
'NewsArticle' => 'NewsArticle',
|
1232 |
'Recipe' => 'Recipe',
|
1233 |
'Product' => 'Product',
|
1234 |
-
'VideoObject' => 'VideoObject'
|
|
|
1235 |
);
|
1236 |
return $options;
|
1237 |
}
|
@@ -1395,6 +1406,7 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1395 |
'id' => 'ampforwp-push-notifications',
|
1396 |
'desc' => " ",
|
1397 |
'subsection' => true,
|
|
|
1398 |
'fields' => array(
|
1399 |
array(
|
1400 |
'id' => 'ampforwp-web-push-onesignal',
|
@@ -1430,6 +1442,28 @@ Redux::setArgs( "redux_builder_amp", $args );
|
|
1430 |
array('ampforwp-web-push-onesignal', '=' , '1'),
|
1431 |
array('ampforwp-onesignal-http-site', '=','1')),
|
1432 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1433 |
)
|
1434 |
)
|
1435 |
);
|
@@ -1572,7 +1606,7 @@ function fb_instant_article() {
|
|
1572 |
|
1573 |
// Facebook Instant Articles
|
1574 |
Redux::setSection( $opt_name, array(
|
1575 |
-
'title' => __( '
|
1576 |
'id' => 'fb-instant-article',
|
1577 |
'subsection' => true,
|
1578 |
'fields' => array(
|
@@ -1599,7 +1633,8 @@ Redux::setSection( $opt_name, array(
|
|
1599 |
'title' => __('Number of Posts', 'accelerated-mobile-pages'),
|
1600 |
'subtitle' => __('Enter the number of posts to generate for Instant Articles.', 'accelerated-mobile-pages'),
|
1601 |
'desc' => __('Leave this empty to generate All Posts.', 'accelerated-mobile-pages'),
|
1602 |
-
'required' => array('fb-instant-article-switch', '=', 1)
|
|
|
1603 |
),
|
1604 |
array(
|
1605 |
'id' => 'fb-instant-article-ads',
|
@@ -1618,7 +1653,19 @@ Redux::setSection( $opt_name, array(
|
|
1618 |
'subtitle' => __('You can find out more about this <a href="https://developers.facebook.com/docs/instant-articles/monetization/audience-network">here</a>. ', 'accelerated-mobile-pages'),
|
1619 |
'required' => array('fb-instant-article-ads', '=', 1)
|
1620 |
),
|
1621 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1622 |
'id' => 'fb-instant-article-analytics',
|
1623 |
'type' => 'switch',
|
1624 |
'title' => __('Analytics', 'accelerated-mobile-pages'),
|
@@ -1697,7 +1744,16 @@ Redux::setSection( $opt_name, array(
|
|
1697 |
'default' => 0,
|
1698 |
|
1699 |
),
|
1700 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1701 |
array(
|
1702 |
'id' => 'amp-header-text-area-for-html',
|
1703 |
'type' => 'textarea',
|
@@ -2171,7 +2227,7 @@ Redux::setSection( $opt_name, array(
|
|
2171 |
|
2172 |
$fields = array(
|
2173 |
'id' => 'amp-design-selector',
|
2174 |
-
'type' => '
|
2175 |
'title' => __( 'Themes Selector', 'accelerated-mobile-pages' ),
|
2176 |
'subtitle' => __( 'Select your design from dropdown or <br /><a href="https://ampforwp.com/themes/" style="position: relative;
|
2177 |
top: 20px;text-decoration: none;
|
@@ -2543,7 +2599,15 @@ Redux::setSection( $opt_name, array(
|
|
2543 |
'default' =>'1',
|
2544 |
),
|
2545 |
|
2546 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2547 |
|
2548 |
|
2549 |
// Homepage thumbnail
|
@@ -2850,6 +2914,23 @@ Redux::setSection( $opt_name, array(
|
|
2850 |
'desc' => __('All the Social sharing and the social profile related settings are here','accelerated-mobile-pages'),
|
2851 |
'subsection' => true,
|
2852 |
'fields' => array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2853 |
// Facebook ON/OFF
|
2854 |
array(
|
2855 |
'id' => 'enable-single-facebook-share',
|
@@ -3269,7 +3350,7 @@ Redux::setSection( $opt_name, array(
|
|
3269 |
) );
|
3270 |
|
3271 |
|
3272 |
-
|
3273 |
/*
|
3274 |
* <--- END SECTIONS
|
3275 |
*/
|
13 |
$comment_desc = '<a href="'.$comment_AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/comments-banner.png" width="560" height="85" /></a>';
|
14 |
}
|
15 |
// If CTA is not Activated
|
16 |
+
$cta_desc = "";
|
17 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
18 |
if(!is_plugin_active( 'AMP-cta/amp-cta.php' )){
|
19 |
$cta_AD_URL = "http://ampforwp.com/call-to-action/#utm_source=options-panel&utm_medium=call-to-action_banner_in_notification_bar&utm_campaign=AMP%20Plugin";
|
580 |
'subsection' => true,
|
581 |
'fields' => array(
|
582 |
// Ad 1 Starts
|
583 |
+
array(
|
584 |
+
'id' =>'ampforwp-ads-data-loading-strategy',
|
585 |
+
'type' => 'switch',
|
586 |
+
'title' => __('Optimize For Viewability', 'accelerated-mobile-pages'),
|
587 |
+
'default' => 0,
|
588 |
+
'subtitle' => __('This will increase the loading speed of the Ads', 'accelerated-mobile-pages'),
|
589 |
+
'true' => 'Enabled',
|
590 |
+
'false' => 'Disabled',
|
591 |
+
),
|
592 |
array(
|
593 |
'id' =>'enable-amp-ads-1',
|
594 |
'type' => 'switch',
|
1241 |
'NewsArticle' => 'NewsArticle',
|
1242 |
'Recipe' => 'Recipe',
|
1243 |
'Product' => 'Product',
|
1244 |
+
'VideoObject' => 'VideoObject',
|
1245 |
+
'Article' => 'Article'
|
1246 |
);
|
1247 |
return $options;
|
1248 |
}
|
1406 |
'id' => 'ampforwp-push-notifications',
|
1407 |
'desc' => " ",
|
1408 |
'subsection' => true,
|
1409 |
+
'class' =>'ampforwp-new-element',
|
1410 |
'fields' => array(
|
1411 |
array(
|
1412 |
'id' => 'ampforwp-web-push-onesignal',
|
1442 |
array('ampforwp-web-push-onesignal', '=' , '1'),
|
1443 |
array('ampforwp-onesignal-http-site', '=','1')),
|
1444 |
),
|
1445 |
+
array(
|
1446 |
+
'id' => 'translation',
|
1447 |
+
'type' => 'section',
|
1448 |
+
'title' => __('Translation', 'accelerated-mobile-pages'),
|
1449 |
+
'required' => array( 'ampforwp-web-push-onesignal', '=' , 1 ),
|
1450 |
+
'indent' => true,
|
1451 |
+
'required' => array( 'amp-use-pot', '=' , 0 )
|
1452 |
+
),
|
1453 |
+
array(
|
1454 |
+
'id' => 'ampforwp-onesignal-translator-subscribe',
|
1455 |
+
'type' => 'text',
|
1456 |
+
'title' => __('Subscribe', 'accelerated-mobile-pages'),
|
1457 |
+
'default' => __('Subscribe to updates','accelerated-mobile-pages'),
|
1458 |
+
'placeholder'=>__('Add some text','accelerated-mobile-pages'),
|
1459 |
+
),
|
1460 |
+
array(
|
1461 |
+
'id' => 'ampforwp-onesignal-translator-unsubscribe',
|
1462 |
+
'type' => 'text',
|
1463 |
+
'title' => __('Unsubsribe', 'accelerated-mobile-pages'),
|
1464 |
+
'default' => __('Unsubscribe from updates','accelerated-mobile-pages'),
|
1465 |
+
'placeholder'=>__('Add some text','accelerated-mobile-pages'),
|
1466 |
+
),
|
1467 |
)
|
1468 |
)
|
1469 |
);
|
1606 |
|
1607 |
// Facebook Instant Articles
|
1608 |
Redux::setSection( $opt_name, array(
|
1609 |
+
'title' => __( 'Instant Articles', 'accelerated-mobile-pages' ),
|
1610 |
'id' => 'fb-instant-article',
|
1611 |
'subsection' => true,
|
1612 |
'fields' => array(
|
1633 |
'title' => __('Number of Posts', 'accelerated-mobile-pages'),
|
1634 |
'subtitle' => __('Enter the number of posts to generate for Instant Articles.', 'accelerated-mobile-pages'),
|
1635 |
'desc' => __('Leave this empty to generate All Posts.', 'accelerated-mobile-pages'),
|
1636 |
+
'required' => array('fb-instant-article-switch', '=', 1),
|
1637 |
+
'default' => '50'
|
1638 |
),
|
1639 |
array(
|
1640 |
'id' => 'fb-instant-article-ads',
|
1653 |
'subtitle' => __('You can find out more about this <a href="https://developers.facebook.com/docs/instant-articles/monetization/audience-network">here</a>. ', 'accelerated-mobile-pages'),
|
1654 |
'required' => array('fb-instant-article-ads', '=', 1)
|
1655 |
),
|
1656 |
+
array(
|
1657 |
+
'id' => 'fb-instant-article-ad-density',
|
1658 |
+
'type' => 'select',
|
1659 |
+
'title' => __('How often should ads show in Instant Article pages', 'accelerated-mobile-pages'),
|
1660 |
+
'options' => array(
|
1661 |
+
'defualt' => __('Every 250 words', 'accelerated-mobile-pages' ),
|
1662 |
+
'medium' => __('Every 350 words', 'accelerated-mobile-pages' ),
|
1663 |
+
'low' => __('Every 500 words', 'accelerated-mobile-pages' ),
|
1664 |
+
),
|
1665 |
+
'required' => array('fb-instant-article-ads', '=', 1),
|
1666 |
+
'default' => 'defualt',
|
1667 |
+
),
|
1668 |
+
array(
|
1669 |
'id' => 'fb-instant-article-analytics',
|
1670 |
'type' => 'switch',
|
1671 |
'title' => __('Analytics', 'accelerated-mobile-pages'),
|
1744 |
'default' => 0,
|
1745 |
|
1746 |
),
|
1747 |
+
array(
|
1748 |
+
'id' => 'amp-meta-permissions',
|
1749 |
+
'type' => 'select',
|
1750 |
+
'title' => __('AMP Metabox Permission', 'accelerated-mobile-pages'),
|
1751 |
+
'options' => array(
|
1752 |
+
'all' => 'All users who can post',
|
1753 |
+
'admin' => 'Only to Admin'
|
1754 |
+
),
|
1755 |
+
'default' => 'all',
|
1756 |
+
),
|
1757 |
array(
|
1758 |
'id' => 'amp-header-text-area-for-html',
|
1759 |
'type' => 'textarea',
|
2227 |
|
2228 |
$fields = array(
|
2229 |
'id' => 'amp-design-selector',
|
2230 |
+
'type' => 'demolink_image_select',
|
2231 |
'title' => __( 'Themes Selector', 'accelerated-mobile-pages' ),
|
2232 |
'subtitle' => __( 'Select your design from dropdown or <br /><a href="https://ampforwp.com/themes/" style="position: relative;
|
2233 |
top: 20px;text-decoration: none;
|
2599 |
'default' =>'1',
|
2600 |
),
|
2601 |
|
2602 |
+
// Full date Format
|
2603 |
+
array(
|
2604 |
+
'id' =>'ampforwp-full-post-date',
|
2605 |
+
'type' =>'switch',
|
2606 |
+
'title' =>__('Date Format','accelerated-mobile-pages'),
|
2607 |
+
'subtitle' => __('Display Full Date of Posts on Homepage/Archives. ex: 11 November 2017', 'accelerated-mobile-pages'),
|
2608 |
+
'required' => array(array('amp-design-selector', '!=' , '2') ),
|
2609 |
+
'default' =>'0',
|
2610 |
+
),
|
2611 |
|
2612 |
|
2613 |
// Homepage thumbnail
|
2914 |
'desc' => __('All the Social sharing and the social profile related settings are here','accelerated-mobile-pages'),
|
2915 |
'subsection' => true,
|
2916 |
'fields' => array(
|
2917 |
+
// Facebook Like
|
2918 |
+
array(
|
2919 |
+
'id' => 'ampforwp-facebook-like-button',
|
2920 |
+
'type' => 'switch',
|
2921 |
+
'title' => __('Facebook Like Button', 'accelerated-mobile-pages'),
|
2922 |
+
'default' => 0,
|
2923 |
+
),
|
2924 |
+
// Facebook Like URL
|
2925 |
+
array(
|
2926 |
+
'id' => 'ampforwp-facebook-like-url',
|
2927 |
+
'title' => __('Facebook Page URL', 'accelerated-mobile-pages'),
|
2928 |
+
'subtitle' => __('The absolute URL of the page that will be liked. For example, https://www.facebook.com/ampforwp/', 'accelerated-mobile-pages'),
|
2929 |
+
'type' => 'text',
|
2930 |
+
'required' => array('ampforwp-facebook-like-button', '=' , '1'),
|
2931 |
+
'placeholder' => __('Enter your facebook page url','accelerated-mobile-pages'),
|
2932 |
+
'default' => ''
|
2933 |
+
),
|
2934 |
// Facebook ON/OFF
|
2935 |
array(
|
2936 |
'id' => 'enable-single-facebook-share',
|
3350 |
) );
|
3351 |
|
3352 |
|
3353 |
+
Redux::setExtensions( $opt_name, AMPFORWP_PLUGIN_DIR.'includes/options/extensions/demolink_image_select' );
|
3354 |
/*
|
3355 |
* <--- END SECTIONS
|
3356 |
*/
|
@@ -0,0 +1 @@
|
|
|
1 |
+
.redux-container-demolink_image_select{margin-top:2px;margin-left:5px;width:100%;margin-bottom:0}.redux-preview-image{max-height:250px;max-width:250px;padding:5px;margin-top:10px;border:1px solid #e3e3e3;background:#f7f7f7;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*global redux_change, redux*/
|
2 |
+
|
3 |
+
(function( $ ) {
|
4 |
+
"use strict";
|
5 |
+
|
6 |
+
redux.field_objects = redux.field_objects || {};
|
7 |
+
redux.field_objects.demolink_image_select = redux.field_objects.demolink_image_select || {};
|
8 |
+
|
9 |
+
$( document ).ready(
|
10 |
+
function() {
|
11 |
+
//redux.field_objects.demolink_image_select.init();
|
12 |
+
}
|
13 |
+
);
|
14 |
+
|
15 |
+
redux.field_objects.demolink_image_select.init = function( selector ) {
|
16 |
+
|
17 |
+
if ( !selector ) {
|
18 |
+
selector = $( document ).find( ".redux-group-tab:visible" ).find( '.redux-container-demolink_image_select:visible' );
|
19 |
+
}
|
20 |
+
|
21 |
+
$( selector ).each(
|
22 |
+
function() {
|
23 |
+
var el = $( this );
|
24 |
+
var parent = el;
|
25 |
+
if ( !el.hasClass( 'redux-field-container' ) ) {
|
26 |
+
parent = el.parents( '.redux-field-container:first' );
|
27 |
+
}
|
28 |
+
if ( parent.is( ":hidden" ) ) { // Skip hidden fields
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
if ( parent.hasClass( 'redux-field-init' ) ) {
|
32 |
+
parent.removeClass( 'redux-field-init' );
|
33 |
+
} else {
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
var default_params = {
|
37 |
+
width: 'resolve',
|
38 |
+
triggerChange: true,
|
39 |
+
allowClear: true
|
40 |
+
};
|
41 |
+
|
42 |
+
var select2_handle = el.find( '.redux-container-demolink_image_select' ).find( '.select2_params' );
|
43 |
+
|
44 |
+
if ( select2_handle.size() > 0 ) {
|
45 |
+
var select2_params = select2_handle.val();
|
46 |
+
|
47 |
+
select2_params = JSON.parse( select2_params );
|
48 |
+
default_params = $.extend( {}, default_params, select2_params );
|
49 |
+
}
|
50 |
+
|
51 |
+
el.find( 'select.redux-select-images' ).select2( default_params );
|
52 |
+
|
53 |
+
el.find( '.redux-select-images' ).on(
|
54 |
+
'change', function() {
|
55 |
+
var preview = $( this ).parents( '.redux-field:first' ).find( '.redux-preview-image' );
|
56 |
+
|
57 |
+
if(typeof $( this ).select2().find(":selected").data("demolink")!="undefined"){
|
58 |
+
if($( this ).select2().find(":selected").data("demolink")!=""){
|
59 |
+
preview.next('#theme-selected-demo-link').remove();
|
60 |
+
var demo = $( this ).select2().find(":selected").data("demolink");
|
61 |
+
preview.after('<a href="'+demo+'" id="theme-selected-demo-link" target="_blank"> Demo </a>');
|
62 |
+
|
63 |
+
preview.attr('onclick','return window.open(\''+demo+'\')');
|
64 |
+
}
|
65 |
+
else {
|
66 |
+
preview.attr('onclick','');
|
67 |
+
preview.next('#theme-selected-demo-link').remove();
|
68 |
+
}
|
69 |
+
|
70 |
+
}
|
71 |
+
if(typeof $( this ).select2().find(":selected").data("image")!="undefined"){
|
72 |
+
if($( this ).select2().find(":selected").data("image")===""){
|
73 |
+
preview.fadeOut(
|
74 |
+
'medium', function() {
|
75 |
+
preview.attr( 'src', '' );
|
76 |
+
}
|
77 |
+
);
|
78 |
+
}else{
|
79 |
+
preview.attr( 'src', $( this ).select2().find(":selected").data("image") );
|
80 |
+
preview.attr( 'alt', $( this ).select2().find(":selected").data("alt") );
|
81 |
+
preview.fadeIn().css( 'visibility', 'visible' );
|
82 |
+
}
|
83 |
+
}else{
|
84 |
+
if ( $( this ).val() === "" ) {
|
85 |
+
preview.fadeOut(
|
86 |
+
'medium', function() {
|
87 |
+
preview.attr( 'src', '' );
|
88 |
+
}
|
89 |
+
);
|
90 |
+
} else {
|
91 |
+
preview.attr( 'src', $( this ).val() );
|
92 |
+
preview.fadeIn().css( 'visibility', 'visible' );
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
+
);
|
97 |
+
}
|
98 |
+
);
|
99 |
+
};
|
100 |
+
})( jQuery );
|
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Field Select Image
|
5 |
+
*
|
6 |
+
* @package Wordpress
|
7 |
+
* @subpackage ReduxFramework
|
8 |
+
* @since 3.1.2
|
9 |
+
* @author Kevin Provance <kprovance>
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
14 |
+
exit;
|
15 |
+
}
|
16 |
+
|
17 |
+
if ( ! class_exists( 'ReduxFramework_demolink_image_select' ) ) {
|
18 |
+
class ReduxFramework_demolink_image_select {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Field Constructor.
|
22 |
+
* Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
|
23 |
+
*
|
24 |
+
* @since ReduxFramework 1.0.0
|
25 |
+
*/
|
26 |
+
function __construct( $field = array(), $value = '', $parent ) {
|
27 |
+
$this->parent = $parent;
|
28 |
+
$this->field = $field;
|
29 |
+
$this->value = $value;
|
30 |
+
|
31 |
+
if ( empty( $this->extension_dir ) ) {
|
32 |
+
$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
|
33 |
+
$this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
|
34 |
+
}
|
35 |
+
// Set default args for this field to avoid bad indexes. Change this to anything you use.
|
36 |
+
$defaults = array(
|
37 |
+
'options' => array(),
|
38 |
+
'stylesheet' => '',
|
39 |
+
'output' => true,
|
40 |
+
'enqueue' => true,
|
41 |
+
'enqueue_frontend' => true
|
42 |
+
);
|
43 |
+
$this->field = wp_parse_args( $this->field, $defaults );
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Field Render Function.
|
48 |
+
* Takes the vars and outputs the HTML for the field in the settings
|
49 |
+
*
|
50 |
+
* @since ReduxFramework 1.0.0
|
51 |
+
*/
|
52 |
+
function render() {
|
53 |
+
|
54 |
+
// If options is NOT empty, the process
|
55 |
+
if ( ! empty( $this->field['options'] ) ) {
|
56 |
+
|
57 |
+
// Strip off the file ext
|
58 |
+
if ( isset( $this->value ) ) {
|
59 |
+
$name = explode( ".", $this->value );
|
60 |
+
$name = str_replace( '.' . end( $name ), '', $this->value );
|
61 |
+
$name = basename( $name );
|
62 |
+
//$this->value = trim( $name );
|
63 |
+
$filename = trim($name);
|
64 |
+
}
|
65 |
+
|
66 |
+
// beancounter
|
67 |
+
$x = 1;
|
68 |
+
|
69 |
+
// Process width
|
70 |
+
if ( ! empty( $this->field['width'] ) ) {
|
71 |
+
$width = ' style="width:' . $this->field['width'] . ';"';
|
72 |
+
} else {
|
73 |
+
$width = ' style="width: 40%;"';
|
74 |
+
}
|
75 |
+
|
76 |
+
// Process placeholder
|
77 |
+
$placeholder = ( isset( $this->field['placeholder'] ) ) ? esc_attr( $this->field['placeholder'] ) : __( 'Select an item', 'redux-framework' );
|
78 |
+
|
79 |
+
if ( isset( $this->field['select2'] ) ) { // if there are any let's pass them to js
|
80 |
+
$select2_params = json_encode( $this->field['select2'] );
|
81 |
+
$select2_params = htmlspecialchars( $select2_params, ENT_QUOTES );
|
82 |
+
|
83 |
+
echo '<input type="hidden" class="select2_params" value="' . $select2_params . '">';
|
84 |
+
}
|
85 |
+
|
86 |
+
// Begin the <select> tag
|
87 |
+
echo '<select data-id="' . $this->field['id'] . '" data-placeholder="' . $placeholder . '" name="' . $this->field['name'] . $this->field['name_suffix'] . '" class="redux-select-item redux-select-images ' . $this->field['class'] . '"' . $width . ' rows="6">';
|
88 |
+
echo '<option></option>';
|
89 |
+
|
90 |
+
|
91 |
+
// Enum through the options array
|
92 |
+
foreach ( $this->field['options'] as $k => $v ) {
|
93 |
+
if($v['upgreade']==1){
|
94 |
+
$selected = selected( $this->value, $v['value'], false );
|
95 |
+
|
96 |
+
// If selected returns something other than a blank space, we
|
97 |
+
// found our default/saved name. Save the array number in a
|
98 |
+
// variable to use later on when we want to extract its associted
|
99 |
+
// url.
|
100 |
+
if ( '' != $selected ) {
|
101 |
+
$arrNum = $x;
|
102 |
+
}
|
103 |
+
// No alt? Set it to title. We do this so the alt tag shows
|
104 |
+
// something. It also makes HTML/SEO purists happy.
|
105 |
+
if ( ! isset( $v['alt'] ) ) {
|
106 |
+
$v['alt'] = $v['title'];
|
107 |
+
}
|
108 |
+
if ( ! isset( $v['demo_link'] ) ) {
|
109 |
+
$v['demo_link'] = '';
|
110 |
+
}
|
111 |
+
// Add the option tag, with values.
|
112 |
+
echo '<option value="' . $v['value'] . '" ' . $selected . ' data-image="'. $v['img'].'" data-alt="'. $v['alt'] .'" data-demolink="'. $v['demo_link'] .'">' . $v['title'] . '</option>';
|
113 |
+
}else{
|
114 |
+
// No array? No problem!
|
115 |
+
if ( ! is_array( $v ) ) {
|
116 |
+
$v = array( 'img' => $v );
|
117 |
+
}
|
118 |
+
|
119 |
+
// No title set? Make it blank.
|
120 |
+
if ( ! isset( $v['title'] ) ) {
|
121 |
+
$v['title'] = '';
|
122 |
+
}
|
123 |
+
|
124 |
+
// No alt? Set it to title. We do this so the alt tag shows
|
125 |
+
// something. It also makes HTML/SEO purists happy.
|
126 |
+
if ( ! isset( $v['alt'] ) ) {
|
127 |
+
$v['alt'] = $v['title'];
|
128 |
+
}
|
129 |
+
|
130 |
+
// Set the selected entry
|
131 |
+
$selected = selected( $this->value, $v['img'], false );
|
132 |
+
|
133 |
+
// If selected returns something other than a blank space, we
|
134 |
+
// found our default/saved name. Save the array number in a
|
135 |
+
// variable to use later on when we want to extract its associted
|
136 |
+
// url.
|
137 |
+
if ( '' != $selected ) {
|
138 |
+
$arrNum = $x;
|
139 |
+
}
|
140 |
+
|
141 |
+
// Add the option tag, with values.
|
142 |
+
echo '<option value="' . $v['img'] . '" ' . $selected . '>' . $v['alt'] . '</option>';
|
143 |
+
}
|
144 |
+
// Add a bean
|
145 |
+
$x ++;
|
146 |
+
}
|
147 |
+
|
148 |
+
// Close the <select> tag
|
149 |
+
echo '</select>';
|
150 |
+
|
151 |
+
// Some space
|
152 |
+
echo '<br /><br />';
|
153 |
+
|
154 |
+
// Show the preview image.
|
155 |
+
echo '<div class="amp-theme-selector-img">';
|
156 |
+
|
157 |
+
// just in case. You never know.
|
158 |
+
if ( ! isset( $arrNum ) ) {
|
159 |
+
$this->value = '';
|
160 |
+
}
|
161 |
+
|
162 |
+
// Set the default image. To get the url from the default name,
|
163 |
+
// we save the array count from the for/each loop, when the default image
|
164 |
+
// is mark as selected. Since the for/each loop starts at one, we must
|
165 |
+
// substract one from the saved array number. We then pull the url
|
166 |
+
// out of the options array, and there we go.
|
167 |
+
if ( '' == $this->value ) {
|
168 |
+
echo '<img src="#" class="redux-preview-image" style="visibility:hidden;" id="image_' . $this->field['id'] . '">';
|
169 |
+
} else {
|
170 |
+
$demo="#";
|
171 |
+
if (isset($this->field['options'][ $arrNum - 1 ]['demo_link'])) {
|
172 |
+
$demo = $this->field['options'][ $arrNum - 1 ]['demo_link'];
|
173 |
+
}
|
174 |
+
echo '<img src=' . $this->field['options'][ $arrNum - 1 ]['img'] . ' class="redux-preview-image" id="image_' . $this->field['id'] . '" onclick="return window.open(\''.$demo.'\')">';
|
175 |
+
if (isset($this->field['options'][ $arrNum - 1 ]['demo_link'])) {
|
176 |
+
echo '<a href="'. $demo .'" id="theme-selected-demo-link" target="_blank">
|
177 |
+
Demo
|
178 |
+
</a>';
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
// Close the <div> tag.
|
183 |
+
echo '</div>';
|
184 |
+
} else {
|
185 |
+
|
186 |
+
// No options specified. Really?
|
187 |
+
echo '<strong>' . __( 'No items of this type were found.', 'redux-framework' ) . '</strong>';
|
188 |
+
}
|
189 |
+
} //function
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Enqueue Function.
|
193 |
+
* If this field requires any scripts, or css define this function and register/enqueue the scripts/css
|
194 |
+
*
|
195 |
+
* @since ReduxFramework 1.0.0
|
196 |
+
*/
|
197 |
+
function enqueue() {
|
198 |
+
wp_enqueue_style( 'select2-css' );
|
199 |
+
|
200 |
+
// wp_enqueue_script(
|
201 |
+
// 'redux-field-icon-select-js',
|
202 |
+
// $this->extension_url . 'field_demolink_image_select.js',
|
203 |
+
// array( 'jquery' ),
|
204 |
+
// time(),
|
205 |
+
// true
|
206 |
+
// );
|
207 |
+
// wp_enqueue_style(
|
208 |
+
// 'redux-field-icon-select-css',
|
209 |
+
// $this->extension_url . 'field_demolink_image_select.css',
|
210 |
+
// time(),
|
211 |
+
// true
|
212 |
+
// );
|
213 |
+
|
214 |
+
|
215 |
+
wp_enqueue_script(
|
216 |
+
'field-demolink-select-image-js',
|
217 |
+
$this->extension_url .'field_demolink_image_select.js',
|
218 |
+
array('jquery', 'select2-js', 'redux-js'),
|
219 |
+
time(),
|
220 |
+
true
|
221 |
+
);
|
222 |
+
|
223 |
+
if ($this->parent->args['dev_mode']) {
|
224 |
+
wp_enqueue_style(
|
225 |
+
'redux-field-select-image-css',
|
226 |
+
$this->extension_url .'field_demolink_image_select.css',
|
227 |
+
array(),
|
228 |
+
time(),
|
229 |
+
'all'
|
230 |
+
);
|
231 |
+
}
|
232 |
+
} //function
|
233 |
+
} //class
|
234 |
+
}
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.redux-container-demolink_image_select {
|
2 |
+
margin-top: 2px;
|
3 |
+
margin-left: 5px;
|
4 |
+
width: 100%;
|
5 |
+
margin-bottom: 0;
|
6 |
+
}
|
7 |
+
|
8 |
+
.redux-preview-image {
|
9 |
+
max-height: 250px;
|
10 |
+
max-width: 250px;
|
11 |
+
padding: 5px;
|
12 |
+
margin-top: 10px;
|
13 |
+
border: 1px solid #e3e3e3;
|
14 |
+
background: #f7f7f7;
|
15 |
+
-moz-border-radius: 3px;
|
16 |
+
-khtml-border-radius: 3px;
|
17 |
+
-webkit-border-radius: 3px;
|
18 |
+
border-radius: 3px;
|
19 |
+
}
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Redux Framework is free software: you can redistribute it and/or modify
|
4 |
+
* it under the terms of the GNU General Public License as published by
|
5 |
+
* the Free Software Foundation, either version 2 of the License, or
|
6 |
+
* any later version.
|
7 |
+
*
|
8 |
+
* Redux Framework is distributed in the hope that it will be useful,
|
9 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
11 |
+
* GNU General Public License for more details.
|
12 |
+
*
|
13 |
+
* You should have received a copy of the GNU General Public License
|
14 |
+
* along with Redux Framework. If not, see <http://www.gnu.org/licenses/>.
|
15 |
+
*
|
16 |
+
* @package ReduxFramework
|
17 |
+
* @author Dovy Paukstys (dovy)
|
18 |
+
* @version 3.0.0
|
19 |
+
*/
|
20 |
+
// Exit if accessed directly
|
21 |
+
if( !defined( 'ABSPATH' ) ) exit;
|
22 |
+
// Don't duplicate me!
|
23 |
+
if( !class_exists( 'ReduxFramework_extension_demolink_image_select' ) ) {
|
24 |
+
/**
|
25 |
+
* Main ReduxFramework demolink_image_select extension class
|
26 |
+
*
|
27 |
+
* @since 3.1.6
|
28 |
+
*/
|
29 |
+
class ReduxFramework_extension_demolink_image_select {
|
30 |
+
|
31 |
+
// Set the version number of your extension here
|
32 |
+
public static $version = '1.0.0';
|
33 |
+
// Set the name of your extension here
|
34 |
+
public $ext_name = 'Demolink Image Select';
|
35 |
+
|
36 |
+
// Set the minumum required version of Redux here (optional).
|
37 |
+
// Leave blank to require no minimum version.
|
38 |
+
// This allows you to specify a minimum required version of Redux in the event
|
39 |
+
// you do not want to support older versions.
|
40 |
+
public $min_redux_version = '3.0.0';
|
41 |
+
// Protected vars
|
42 |
+
protected $parent;
|
43 |
+
public $extension_url;
|
44 |
+
public $extension_dir;
|
45 |
+
public static $theInstance;
|
46 |
+
/**
|
47 |
+
* Class Constructor. Defines the args for the extions class
|
48 |
+
*
|
49 |
+
* @since 1.0.0
|
50 |
+
* @access public
|
51 |
+
* @param array $sections Panel sections.
|
52 |
+
* @param array $args Class constructor arguments.
|
53 |
+
* @param array $extra_tabs Extra panel tabs.
|
54 |
+
* @return void
|
55 |
+
*/
|
56 |
+
public function __construct( $parent ) {
|
57 |
+
|
58 |
+
$this->parent = $parent;
|
59 |
+
|
60 |
+
if (is_admin() && !$this->is_minimum_version()) {
|
61 |
+
return;
|
62 |
+
}
|
63 |
+
|
64 |
+
if ( empty( $this->extension_dir ) ) {
|
65 |
+
$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
|
66 |
+
$this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
|
67 |
+
}
|
68 |
+
|
69 |
+
$this->field_name = 'demolink_image_select';
|
70 |
+
self::$theInstance = $this;
|
71 |
+
add_filter( 'redux/'.$this->parent->args['opt_name'].'/field/class/'.$this->field_name, array( &$this, 'overload_field_path' ) ); // Adds the local field
|
72 |
+
}
|
73 |
+
public function getInstance() {
|
74 |
+
return self::$theInstance;
|
75 |
+
}
|
76 |
+
// Forces the use of the embeded field path vs what the core typically would use
|
77 |
+
public function overload_field_path($field) {
|
78 |
+
return dirname(__FILE__).'/'.$this->field_name.'/field_'.$this->field_name.'.php';
|
79 |
+
}
|
80 |
+
private function is_minimum_version () {
|
81 |
+
$redux_ver = ReduxFramework::$_version;
|
82 |
+
if ($this->min_redux_version != '') {
|
83 |
+
if (version_compare($redux_ver, $this->min_redux_version) < 0) {
|
84 |
+
$msg = '<strong>' . esc_html__( 'The', 'redux-framework') . ' ' . $this->ext_name . ' ' . esc_html__('extension requires', 'redux-framework') . ' Redux Framework ' . esc_html__('version', 'redux-framework') . ' ' . $this->min_redux_version . ' ' . esc_html__('or higher.','redux-framework' ) . '</strong> ' . esc_html__( 'You are currently running', 'redux-framework') . ' Redux Framework ' . esc_html__('version','redux-framework' ) . ' ' . $redux_ver . '.<br/><br/>' . esc_html__('This field will not render in your option panel, and featuress of this extension will not be available until the latest version of','redux-framework' ) . ' Redux Framework ' . esc_html__('has been installed.','redux-framework' );
|
85 |
+
|
86 |
+
$data = array(
|
87 |
+
'parent' => $this->parent,
|
88 |
+
'type' => 'error',
|
89 |
+
'msg' => $msg,
|
90 |
+
'id' => $this->ext_name . '_notice_' . self::$version,
|
91 |
+
'dismiss' => false
|
92 |
+
);
|
93 |
+
|
94 |
+
if (method_exists('Redux_Admin_Notices', 'set_notice')) {
|
95 |
+
Redux_Admin_Notices::set_notice($data);
|
96 |
+
} else {
|
97 |
+
echo '<div class="error">';
|
98 |
+
echo '<p>';
|
99 |
+
echo $msg;
|
100 |
+
echo '</p>';
|
101 |
+
echo '</div>';
|
102 |
+
}
|
103 |
+
return false;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
return true;
|
108 |
+
}
|
109 |
+
} // class
|
110 |
+
} // if
|
@@ -258,4 +258,8 @@ float:left;padding-bottom: 20px;
|
|
258 |
font-size: 15px;
|
259 |
margin-bottom: 0px;
|
260 |
padding-top: 25px;
|
261 |
-
background: #fcfcfc; }
|
|
|
|
|
|
|
|
258 |
font-size: 15px;
|
259 |
margin-bottom: 0px;
|
260 |
padding-top: 25px;
|
261 |
+
background: #fcfcfc; }
|
262 |
+
.ampforwp-new-element {
|
263 |
+
position: relative;
|
264 |
+
}
|
265 |
+
.subsection .ampforwp-new-element:after {content: "new";font-size: 9px;position: absolute;right: 8px;top: 6px;color: #fff;background: #31409e;text-transform: uppercase;border-radius: 7px;padding: 1px 5px 0px 6px;}
|
@@ -38,9 +38,11 @@ class AMP_Content {
|
|
38 |
$content = $this->content;
|
39 |
// First, embeds + the_content filter
|
40 |
$embed_handlers = $this->register_embed_handlers();
|
41 |
-
if( $this->args &&
|
42 |
-
|
43 |
-
|
|
|
|
|
44 |
}
|
45 |
else{
|
46 |
$content = apply_filters( 'the_content', $content );
|
38 |
$content = $this->content;
|
39 |
// First, embeds + the_content filter
|
40 |
$embed_handlers = $this->register_embed_handlers();
|
41 |
+
if( (!empty($this->args)) && (!empty($this->args['non-content'])) ){
|
42 |
+
if('non-content' == $this->args['non-content']){
|
43 |
+
$content = apply_filters( 'the_content', $content );
|
44 |
+
$content = apply_filters( 'amp_general_content', $content );
|
45 |
+
}
|
46 |
}
|
47 |
else{
|
48 |
$content = apply_filters( 'the_content', $content );
|
@@ -165,7 +165,9 @@ class AMP_Post_Template {
|
|
165 |
$post_modified_timestamp = get_post_modified_time( 'U', false, $this->post );
|
166 |
if(!empty($this->post)){
|
167 |
$post_author = get_userdata( $this->post->post_author );
|
168 |
-
|
|
|
|
|
169 |
}
|
170 |
else {
|
171 |
$post_author = '';
|
165 |
$post_modified_timestamp = get_post_modified_time( 'U', false, $this->post );
|
166 |
if(!empty($this->post)){
|
167 |
$post_author = get_userdata( $this->post->post_author );
|
168 |
+
if ( $post_author ) {
|
169 |
+
$post_author_name = $post_author->display_name;
|
170 |
+
}
|
171 |
}
|
172 |
else {
|
173 |
$post_author = '';
|
@@ -118,7 +118,8 @@ class AMP_Gallery_Embed_Handler extends AMP_Base_Embed_Handler {
|
|
118 |
'src' => $image['url'],
|
119 |
'width' => $image['width'],
|
120 |
'height' => $image['height'],
|
121 |
-
'layout' => '
|
|
|
122 |
)
|
123 |
);
|
124 |
$images[$key] = apply_filters('amp_gallery_images', $images[$key], $image);
|
@@ -130,6 +131,7 @@ class AMP_Gallery_Embed_Handler extends AMP_Base_Embed_Handler {
|
|
130 |
'height' => $this->args['height'],
|
131 |
'type' => 'slides',
|
132 |
'layout' => 'responsive',
|
|
|
133 |
),
|
134 |
implode( PHP_EOL, $images )
|
135 |
);
|
118 |
'src' => $image['url'],
|
119 |
'width' => $image['width'],
|
120 |
'height' => $image['height'],
|
121 |
+
'layout' => 'fill',
|
122 |
+
'class' => 'amp-carousel-img',
|
123 |
)
|
124 |
);
|
125 |
$images[$key] = apply_filters('amp_gallery_images', $images[$key], $image);
|
131 |
'height' => $this->args['height'],
|
132 |
'type' => 'slides',
|
133 |
'layout' => 'responsive',
|
134 |
+
'class' => 'collapsible-captions',
|
135 |
),
|
136 |
implode( PHP_EOL, $images )
|
137 |
);
|
@@ -11,14 +11,24 @@ define( 'AMP_PAGE_BUILDER_URL', plugin_dir_url(__FILE__) );
|
|
11 |
add_action('add_meta_boxes','ampforwp_pagebuilder_content_meta_register', 10 ,1);
|
12 |
function ampforwp_pagebuilder_content_meta_register($post_type){
|
13 |
global $redux_builder_amp;
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
|
24 |
function amp_content_pagebuilder_title_callback( $post ){
|
11 |
add_action('add_meta_boxes','ampforwp_pagebuilder_content_meta_register', 10 ,1);
|
12 |
function ampforwp_pagebuilder_content_meta_register($post_type){
|
13 |
global $redux_builder_amp;
|
14 |
+
|
15 |
+
$user_level = '';
|
16 |
+
$user_level = current_user_can( 'manage_options' );
|
17 |
+
|
18 |
+
if ( isset( $redux_builder_amp['amp-meta-permissions'] ) && $redux_builder_amp['amp-meta-permissions'] == 'all' ) {
|
19 |
+
$user_level = true;
|
20 |
+
}
|
21 |
+
|
22 |
+
if ( $user_level ) {
|
23 |
+
// Page builder for posts
|
24 |
+
if( $redux_builder_amp['amp-on-off-for-all-posts'] && $post_type == 'post' ) {
|
25 |
+
add_meta_box( 'pagebilder_content', __( 'AMP Page Builder', 'amp-page-builder' ), 'amp_content_pagebuilder_title_callback', 'post' , 'normal', 'default' );
|
26 |
+
}
|
27 |
+
// Page builder for pages
|
28 |
+
if ( $redux_builder_amp['amp-on-off-for-all-pages'] && $post_type == 'page' ) {
|
29 |
+
add_meta_box( 'pagebilder_content', __( 'AMP Page Builder', 'amp-page-builder' ), 'amp_content_pagebuilder_title_callback', 'page' , 'normal', 'default' );
|
30 |
+
}
|
31 |
+
}
|
32 |
}
|
33 |
|
34 |
function amp_content_pagebuilder_title_callback( $post ){
|
@@ -139,7 +139,9 @@ function amp_pagebuilder_content_styles(){
|
|
139 |
$container = $rowsData['cell_data'];
|
140 |
if(count($container)>0){
|
141 |
foreach($container as $contentArray){
|
142 |
-
|
|
|
|
|
143 |
}//foreach content closed
|
144 |
}//ic container check closed
|
145 |
|
139 |
$container = $rowsData['cell_data'];
|
140 |
if(count($container)>0){
|
141 |
foreach($container as $contentArray){
|
142 |
+
if(isset($moduleTemplate[$contentArray['type']]['front_css'])){
|
143 |
+
echo $moduleTemplate[$contentArray['type']]['front_css'];
|
144 |
+
}
|
145 |
}//foreach content closed
|
146 |
}//ic container check closed
|
147 |
|
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.8.3
|
7 |
-
Stable tag: 0.9.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -150,6 +150,36 @@ You can contact me using this url: http://ampforwp.com/contact/
|
|
150 |
|
151 |
== Changelog ==
|
152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
= 0.9.67.0 (6th November 2017) =
|
154 |
* View more details on https://ampforwp.com/one-signal-push-notifications-for-amp/
|
155 |
* OneSignal Push Notifications integrated #807
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.8.3
|
7 |
+
Stable tag: 0.9.68
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
150 |
|
151 |
== Changelog ==
|
152 |
|
153 |
+
= 0.9.68 (12th November 2017) =
|
154 |
+
* View More details on https://ampforwp.com/0-9-68-released-stability-update-74th-update/
|
155 |
+
* ADs are Optimize For Viewability, meaning it will try to load faster than the original AMP AD loading strategy.
|
156 |
+
* Content was disappearing issue was resolved #1392
|
157 |
+
* Featured Image from The Content option is connected to related post #1339
|
158 |
+
* Fix amp-web-push helper iframe configuration URL #1387
|
159 |
+
* Facebook Like button added to AMP #1327
|
160 |
+
* WPML support for AMP Improvement #1285
|
161 |
+
* Debug Errors fixed #1366
|
162 |
+
* Setting ad density for Facebook Instant Articles ads #1287
|
163 |
+
* Showing the number of comments in Single #1341
|
164 |
+
* Styling added to the sitewide ads and made sure that they are in the center. #1343
|
165 |
+
* One Signal buttons Translation added #1383
|
166 |
+
* Article type added to Structured data #1344 #1354
|
167 |
+
* The issue with the amp-carousel when RTL was enabled #1358
|
168 |
+
* amp-carousel with images of different sizes #1358
|
169 |
+
* a bug where Img is getting converted to amp-img if there's no height or width. which causing validation issue and image is not visible fixed.
|
170 |
+
* Instant Article should have a default value for number of posts, it was causing the memory issue with alot of posts #1390
|
171 |
+
* Notice if a post has no author data #1338
|
172 |
+
* Added a new redux extension select field in redux framework #1349
|
173 |
+
* Issues with galleries as well as gallery captions #1363
|
174 |
+
* Added a hook for adding anything in between the loops #1396
|
175 |
+
* Hide meta boxes as per the user level types #1340
|
176 |
+
* A Switch between the Date formats #1384
|
177 |
+
* Fix: Jannah theme lazy load issue #1362
|
178 |
+
* Issues with galleries as well as gallery captions #1363
|
179 |
+
* Create Dynamic url of amp according to the permalink structure #1318
|
180 |
+
* Minor code performance improvement.
|
181 |
+
* Archive titles in Design 3 frontend issue
|
182 |
+
|
183 |
= 0.9.67.0 (6th November 2017) =
|
184 |
* View more details on https://ampforwp.com/one-signal-push-notifications-for-amp/
|
185 |
* OneSignal Push Notifications integrated #807
|
@@ -69,19 +69,29 @@ function ampforwp_custom_post_content_sanitizer( $data, $post ) {
|
|
69 |
|
70 |
|
71 |
function ampforwp_custom_content_meta_register() {
|
72 |
-
|
73 |
-
if($redux_builder_amp['amp-on-off-for-all-posts']) {
|
74 |
-
add_meta_box( 'custom_content_editor', __( 'Custom AMP Editor', 'accelerated-mobile-pages' ), 'amp_content_editor_title_callback', 'post','normal', 'default' );
|
75 |
-
}
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
}
|
87 |
add_action('add_meta_boxes','ampforwp_custom_content_meta_register');
|
69 |
|
70 |
|
71 |
function ampforwp_custom_content_meta_register() {
|
72 |
+
global $redux_builder_amp;
|
|
|
|
|
|
|
73 |
|
74 |
+
$user_level = '';
|
75 |
+
$user_level = current_user_can( 'manage_options' );
|
76 |
+
|
77 |
+
if ( isset( $redux_builder_amp['amp-meta-permissions'] ) && $redux_builder_amp['amp-meta-permissions'] == 'all' ) {
|
78 |
+
$user_level = true;
|
79 |
+
}
|
80 |
|
81 |
+
if ( $user_level ) {
|
82 |
+
if($redux_builder_amp['amp-on-off-for-all-posts']) {
|
83 |
+
add_meta_box( 'custom_content_editor', __( 'Custom AMP Editor', 'accelerated-mobile-pages' ), 'amp_content_editor_title_callback', 'post','normal', 'default' );
|
84 |
+
}
|
85 |
+
|
86 |
+
if($redux_builder_amp['amp-on-off-for-all-pages']){
|
87 |
+
add_meta_box( 'custom_content_editor', __( 'Custom AMP Editor','accelerated-mobile-pages' ), 'amp_content_editor_title_callback', 'page','normal', 'default' );
|
88 |
+
}
|
89 |
+
|
90 |
+
// Assign Pagebuilder Meta Box // Legecy pagebuilder
|
91 |
+
if ( $redux_builder_amp['ampforwp-content-builder'] ) {
|
92 |
+
add_meta_box( 'custom_content_sidebar', __( 'AMP Page Builder', 'accelerated-mobile-pages' ), 'amp_content_sidebar_callback', 'page','side', 'default' );
|
93 |
+
}
|
94 |
+
}
|
95 |
|
96 |
}
|
97 |
add_action('add_meta_boxes','ampforwp_custom_content_meta_register');
|
@@ -41,6 +41,7 @@
|
|
41 |
<article class="amp-wp-article ampforwp-custom-index amp-wp-home">
|
42 |
|
43 |
<?php do_action('ampforwp_post_before_loop') ?>
|
|
|
44 |
|
45 |
<?php if ( is_archive() ) {
|
46 |
the_archive_title( '<h1 class="page-title">', '</h1>' );
|
@@ -61,7 +62,7 @@
|
|
61 |
}
|
62 |
}
|
63 |
} ?>
|
64 |
-
|
65 |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
|
66 |
|
67 |
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ;
|
@@ -120,7 +121,10 @@
|
|
120 |
echo wp_trim_words( strip_shortcodes( $content ) , $excertp_length ); }?></p>
|
121 |
</div>
|
122 |
</div>
|
123 |
-
<?php
|
|
|
|
|
|
|
124 |
<div class="amp-wp-content pagination-holder">
|
125 |
|
126 |
<div id="pagination">
|
41 |
<article class="amp-wp-article ampforwp-custom-index amp-wp-home">
|
42 |
|
43 |
<?php do_action('ampforwp_post_before_loop') ?>
|
44 |
+
<?php $count = 1; ?>
|
45 |
|
46 |
<?php if ( is_archive() ) {
|
47 |
the_archive_title( '<h1 class="page-title">', '</h1>' );
|
62 |
}
|
63 |
}
|
64 |
} ?>
|
65 |
+
<?php do_action('ampforwp_between_loop',$count); ?>
|
66 |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
|
67 |
|
68 |
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ;
|
121 |
echo wp_trim_words( strip_shortcodes( $content ) , $excertp_length ); }?></p>
|
122 |
</div>
|
123 |
</div>
|
124 |
+
<?php
|
125 |
+
do_action('ampforwp_between_loop',$count,$this);
|
126 |
+
$count++;
|
127 |
+
endwhile; ?>
|
128 |
<div class="amp-wp-content pagination-holder">
|
129 |
|
130 |
<div id="pagination">
|
@@ -14,9 +14,13 @@ if (!comments_open() || ( isset($redux_builder_amp['wordpress-comments-support']
|
|
14 |
'post_id' => $postID,
|
15 |
'status' => 'approve' //Change this to the type of comments to be displayed
|
16 |
));
|
17 |
-
if ( $comments ) {
|
|
|
|
|
|
|
18 |
<div class="amp-wp-content comments_list">
|
19 |
-
<h3><?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-view-comments-text'] , 'View Comments' )
|
|
|
20 |
<ul>
|
21 |
<?php
|
22 |
// Display the list of comments
|
14 |
'post_id' => $postID,
|
15 |
'status' => 'approve' //Change this to the type of comments to be displayed
|
16 |
));
|
17 |
+
if ( $comments ) {
|
18 |
+
$comment_nums = '';
|
19 |
+
$comment_nums = get_comments_number();
|
20 |
+
$comment_nums = " ($comment_nums) " ?>
|
21 |
<div class="amp-wp-content comments_list">
|
22 |
+
<h3><?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-view-comments-text'] , 'View Comments' ). $comment_nums?>
|
23 |
+
</h3>
|
24 |
<ul>
|
25 |
<?php
|
26 |
// Display the list of comments
|
@@ -75,14 +75,14 @@
|
|
75 |
$related_post_permalink = trailingslashit( $related_post_permalink );
|
76 |
$related_post_permalink = user_trailingslashit( $related_post_permalink . AMPFORWP_AMP_QUERY_VAR );
|
77 |
?>
|
78 |
-
<li class="<?php if (
|
79 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
80 |
-
<?php if (
|
81 |
-
|
82 |
-
|
83 |
-
$
|
84 |
-
|
85 |
-
|
86 |
</a>
|
87 |
<div class="related_link">
|
88 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
|
75 |
$related_post_permalink = trailingslashit( $related_post_permalink );
|
76 |
$related_post_permalink = user_trailingslashit( $related_post_permalink . AMPFORWP_AMP_QUERY_VAR );
|
77 |
?>
|
78 |
+
<li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
79 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
80 |
+
<?php if ( ampforwp_has_post_thumbnail() ) {
|
81 |
+
$thumb_url = ampforwp_get_post_thumbnail();
|
82 |
+
if($thumb_url){ ?>
|
83 |
+
<amp-img src="<?php echo $thumb_url ?>" width="150" height="150" layout="responsive"></amp-img>
|
84 |
+
<?php }
|
85 |
+
}?>
|
86 |
</a>
|
87 |
<div class="related_link">
|
88 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
|
@@ -9,6 +9,18 @@
|
|
9 |
?>
|
10 |
<?php do_action('ampforwp_before_social_icons_hook',$this); ?>
|
11 |
<div class="ampforwp-social-icons">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
13 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="50" height="28"></amp-social-share>
|
14 |
<?php } ?>
|
9 |
?>
|
10 |
<?php do_action('ampforwp_before_social_icons_hook',$this); ?>
|
11 |
<div class="ampforwp-social-icons">
|
12 |
+
<?php if( true == $redux_builder_amp['ampforwp-facebook-like-button'] ) {
|
13 |
+
$facebook_like_url = '';
|
14 |
+
$facebook_like_url = $redux_builder_amp['ampforwp-facebook-like-url'];
|
15 |
+
if( $facebook_like_url ){ ?>
|
16 |
+
<amp-facebook-like width=90 height=28
|
17 |
+
layout="fixed"
|
18 |
+
data-size="large"
|
19 |
+
data-layout="button_count"
|
20 |
+
data-href="<?php echo esc_url($facebook_like_url); ?>">
|
21 |
+
</amp-facebook-like>
|
22 |
+
<?php }
|
23 |
+
} ?>
|
24 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
25 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="50" height="28"></amp-social-share>
|
26 |
<?php } ?>
|
@@ -21,8 +21,9 @@
|
|
21 |
<article class="amp-wp-article ampforwp-custom-index amp-wp-home">
|
22 |
|
23 |
<?php do_action('ampforwp_post_before_loop') ?>
|
24 |
-
|
25 |
<?php
|
|
|
26 |
if ( get_query_var( 'paged' ) ) {
|
27 |
$paged = get_query_var('paged');
|
28 |
} elseif ( get_query_var( 'page' ) ) {
|
@@ -46,10 +47,12 @@
|
|
46 |
$blog_title = ampforwp_get_blog_details('title');
|
47 |
if($blog_title){ ?>
|
48 |
<h1 class="page-title"><?php echo $blog_title ?> </h1>
|
49 |
-
<?php }
|
|
|
|
|
50 |
if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post(); ?>
|
51 |
<div class="amp-wp-content amp-wp-article-header amp-loop-list">
|
52 |
-
|
53 |
<h1 class="amp-wp-title">
|
54 |
<?php $ampforwp_post_url = get_permalink(); ?>
|
55 |
<a href="<?php echo user_trailingslashit( trailingslashit( $ampforwp_post_url ) . AMPFORWP_AMP_QUERY_VAR );?>"><?php the_title() ?></a>
|
@@ -107,8 +110,12 @@
|
|
107 |
echo wp_trim_words( strip_shortcodes( $content ) , $excertp_length ); }?></p>
|
108 |
</div>
|
109 |
</div>
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
112 |
<div class="amp-wp-content pagination-holder">
|
113 |
|
114 |
<div id="pagination">
|
21 |
<article class="amp-wp-article ampforwp-custom-index amp-wp-home">
|
22 |
|
23 |
<?php do_action('ampforwp_post_before_loop') ?>
|
24 |
+
|
25 |
<?php
|
26 |
+
$count = 1;
|
27 |
if ( get_query_var( 'paged' ) ) {
|
28 |
$paged = get_query_var('paged');
|
29 |
} elseif ( get_query_var( 'page' ) ) {
|
47 |
$blog_title = ampforwp_get_blog_details('title');
|
48 |
if($blog_title){ ?>
|
49 |
<h1 class="page-title"><?php echo $blog_title ?> </h1>
|
50 |
+
<?php }
|
51 |
+
|
52 |
+
|
53 |
if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post(); ?>
|
54 |
<div class="amp-wp-content amp-wp-article-header amp-loop-list">
|
55 |
+
|
56 |
<h1 class="amp-wp-title">
|
57 |
<?php $ampforwp_post_url = get_permalink(); ?>
|
58 |
<a href="<?php echo user_trailingslashit( trailingslashit( $ampforwp_post_url ) . AMPFORWP_AMP_QUERY_VAR );?>"><?php the_title() ?></a>
|
110 |
echo wp_trim_words( strip_shortcodes( $content ) , $excertp_length ); }?></p>
|
111 |
</div>
|
112 |
</div>
|
113 |
+
<?php
|
114 |
+
do_action('ampforwp_between_loop',$count,$this);
|
115 |
+
$count++;
|
116 |
+
|
117 |
+
endwhile; ?>
|
118 |
+
|
119 |
<div class="amp-wp-content pagination-holder">
|
120 |
|
121 |
<div id="pagination">
|
@@ -30,6 +30,7 @@
|
|
30 |
|
31 |
<?php do_action('ampforwp_post_before_loop') ?>
|
32 |
<?php
|
|
|
33 |
if ( get_query_var( 'paged' ) ) {
|
34 |
$paged = get_query_var('paged');
|
35 |
} elseif ( get_query_var( 'page' ) ) {
|
@@ -92,7 +93,10 @@
|
|
92 |
echo wp_trim_words( strip_shortcodes( $content ) , $excertp_length ); }?></p>
|
93 |
</div>
|
94 |
</div>
|
95 |
-
<?php
|
|
|
|
|
|
|
96 |
<div class="amp-wp-content pagination-holder">
|
97 |
|
98 |
<div id="pagination">
|
30 |
|
31 |
<?php do_action('ampforwp_post_before_loop') ?>
|
32 |
<?php
|
33 |
+
$count = 1;
|
34 |
if ( get_query_var( 'paged' ) ) {
|
35 |
$paged = get_query_var('paged');
|
36 |
} elseif ( get_query_var( 'page' ) ) {
|
93 |
echo wp_trim_words( strip_shortcodes( $content ) , $excertp_length ); }?></p>
|
94 |
</div>
|
95 |
</div>
|
96 |
+
<?php
|
97 |
+
do_action('ampforwp_between_loop',$count,$this);
|
98 |
+
$count++;
|
99 |
+
endwhile; ?>
|
100 |
<div class="amp-wp-content pagination-holder">
|
101 |
|
102 |
<div id="pagination">
|
@@ -163,6 +163,7 @@ header, amp-sidebar, article, footer{ direction: rtl;}
|
|
163 |
.amp-wp-byline amp-img{ margin:0px 0px 0px 6px;}
|
164 |
.comment-author{float: right;}
|
165 |
.amp-ad-wrapper,.amp-wp-article amp-ad{ direction: ltr; }
|
|
|
166 |
<?php } ?>
|
167 |
<?php if ($redux_builder_amp['ampforwp-callnow-button']) { ?>
|
168 |
.callnow{ position: relative; top: -27px; right: 100px; }
|
@@ -186,4 +187,8 @@ if( !is_home() && $redux_builder_amp['ampforwp-bread-crumb'] == 1 ) { ?>
|
|
186 |
.widget-wrapper li { list-style-position: inside; }
|
187 |
.amp-menu > li > a > amp-img, .sub-menu > li > a > amp-img { display: inline-block; margin-right: 4px; }
|
188 |
.menu-item amp-img {width: 16px; height: 11px; display: inline-block; margin-right: 5px;}
|
189 |
-
|
|
|
|
|
|
|
|
163 |
.amp-wp-byline amp-img{ margin:0px 0px 0px 6px;}
|
164 |
.comment-author{float: right;}
|
165 |
.amp-ad-wrapper,.amp-wp-article amp-ad{ direction: ltr; }
|
166 |
+
amp-carousel{direction: ltr;}
|
167 |
<?php } ?>
|
168 |
<?php if ($redux_builder_amp['ampforwp-callnow-button']) { ?>
|
169 |
.callnow{ position: relative; top: -27px; right: 100px; }
|
187 |
.widget-wrapper li { list-style-position: inside; }
|
188 |
.amp-menu > li > a > amp-img, .sub-menu > li > a > amp-img { display: inline-block; margin-right: 4px; }
|
189 |
.menu-item amp-img {width: 16px; height: 11px; display: inline-block; margin-right: 5px;}
|
190 |
+
.amp-carousel-container {position: relative;width: 100%;height: 100%;}
|
191 |
+
.amp-carousel-img img {object-fit: contain;}
|
192 |
+
<?php // Ads (sitewide)
|
193 |
+
if( ( isset($redux_builder_amp['enable-amp-ads-1'] ) && $redux_builder_amp['enable-amp-ads-1'] ) || ( isset($redux_builder_amp['enable-amp-ads-2'] ) && $redux_builder_amp['enable-amp-ads-2'] ) ){ ?> .amp-ad-wrapper {text-align: center} .amp-ad-wrapper.amp_ad_1{padding-top:20px} .amp-ad-wrapper,.amp-wp-article amp-ad{ direction: ltr; } <?php }
|
194 |
+
echo $redux_builder_amp['css_editor']; } ?>
|
@@ -68,6 +68,8 @@
|
|
68 |
} ?>
|
69 |
|
70 |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
|
|
|
|
|
71 |
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ;
|
72 |
|
73 |
$ampforwp_amp_post_url = user_trailingslashit( $ampforwp_amp_post_url );
|
@@ -123,7 +125,10 @@
|
|
123 |
<div class="cb"></div>
|
124 |
</div>
|
125 |
|
126 |
-
<?php
|
|
|
|
|
|
|
127 |
|
128 |
<div class="amp-wp-content pagination-holder">
|
129 |
|
68 |
} ?>
|
69 |
|
70 |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();
|
71 |
+
$count = "";
|
72 |
+
$count = 1;
|
73 |
$ampforwp_amp_post_url = trailingslashit( get_permalink() ) . AMPFORWP_AMP_QUERY_VAR ;
|
74 |
|
75 |
$ampforwp_amp_post_url = user_trailingslashit( $ampforwp_amp_post_url );
|
125 |
<div class="cb"></div>
|
126 |
</div>
|
127 |
|
128 |
+
<?php
|
129 |
+
do_action('ampforwp_between_loop',$count,$this);
|
130 |
+
$count++;
|
131 |
+
endwhile; ?>
|
132 |
|
133 |
<div class="amp-wp-content pagination-holder">
|
134 |
|
@@ -14,9 +14,13 @@ if (!comments_open() || ( isset($redux_builder_amp['wordpress-comments-support']
|
|
14 |
'post_id' => $postID,
|
15 |
'status' => 'approve' //Change this to the type of comments to be displayed
|
16 |
));
|
17 |
-
if ( $comments ) {
|
|
|
|
|
|
|
18 |
<div class="amp-wp-content comments_list">
|
19 |
-
<h3><?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-view-comments-text'], 'View Comments' )
|
|
|
20 |
<ul>
|
21 |
<?php
|
22 |
// Display the list of comments
|
14 |
'post_id' => $postID,
|
15 |
'status' => 'approve' //Change this to the type of comments to be displayed
|
16 |
));
|
17 |
+
if ( $comments ) {
|
18 |
+
$comment_nums = '';
|
19 |
+
$comment_nums = get_comments_number();
|
20 |
+
$comment_nums = " ($comment_nums) " ?>
|
21 |
<div class="amp-wp-content comments_list">
|
22 |
+
<h3><?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-view-comments-text'], 'View Comments' ) . $comment_nums ?>
|
23 |
+
</h3>
|
24 |
<ul>
|
25 |
<?php
|
26 |
// Display the list of comments
|
@@ -71,17 +71,14 @@
|
|
71 |
$related_post_permalink = trailingslashit( $related_post_permalink );
|
72 |
$related_post_permalink = user_trailingslashit( $related_post_permalink . AMPFORWP_AMP_QUERY_VAR ) ;
|
73 |
?>
|
74 |
-
<li class="<?php if (
|
75 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
<?php if ( has_post_thumbnail() ) { ?>
|
83 |
-
<amp-img src="<?php echo esc_url( $thumb_url_2 ); ?>" width="150" height="150" layout="responsive"></amp-img>
|
84 |
-
<?php } ?>
|
85 |
</a>
|
86 |
<div class="related_link">
|
87 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
|
71 |
$related_post_permalink = trailingslashit( $related_post_permalink );
|
72 |
$related_post_permalink = user_trailingslashit( $related_post_permalink . AMPFORWP_AMP_QUERY_VAR ) ;
|
73 |
?>
|
74 |
+
<li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
75 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
76 |
+
<?php if ( ampforwp_has_post_thumbnail() ) {
|
77 |
+
$thumb_url = ampforwp_get_post_thumbnail();
|
78 |
+
if($thumb_url){ ?>
|
79 |
+
<amp-img src="<?php echo esc_url( $thumb_url ); ?>" width="150" height="150" layout="responsive"></amp-img>
|
80 |
+
<?php }
|
81 |
+
}?>
|
|
|
|
|
|
|
82 |
</a>
|
83 |
<div class="related_link">
|
84 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
|
@@ -9,6 +9,18 @@ if ( is_single() ) {
|
|
9 |
?>
|
10 |
<?php do_action('ampforwp_before_social_icons_hook',$this); ?>
|
11 |
<div class="amp-wp-content post-pagination-meta ampforwp-social-icons-wrapper ampforwp-social-icons">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
13 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="50" height="28"></amp-social-share>
|
14 |
<?php } ?>
|
9 |
?>
|
10 |
<?php do_action('ampforwp_before_social_icons_hook',$this); ?>
|
11 |
<div class="amp-wp-content post-pagination-meta ampforwp-social-icons-wrapper ampforwp-social-icons">
|
12 |
+
<?php if( true == $redux_builder_amp['ampforwp-facebook-like-button'] ) {
|
13 |
+
$facebook_like_url = '';
|
14 |
+
$facebook_like_url = $redux_builder_amp['ampforwp-facebook-like-url'];
|
15 |
+
if( $facebook_like_url ){ ?>
|
16 |
+
<amp-facebook-like width=90 height=28
|
17 |
+
layout="fixed"
|
18 |
+
data-size="large"
|
19 |
+
data-layout="button_count"
|
20 |
+
data-href="<?php echo esc_url($facebook_like_url); ?>">
|
21 |
+
</amp-facebook-like>
|
22 |
+
<?php }
|
23 |
+
} ?>
|
24 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
25 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="50" height="28"></amp-social-share>
|
26 |
<?php } ?>
|
@@ -17,6 +17,7 @@
|
|
17 |
<?php do_action('ampforwp_home_above_loop') ?>
|
18 |
<main>
|
19 |
<?php do_action('ampforwp_post_before_loop') ?>
|
|
|
20 |
|
21 |
<?php
|
22 |
if ( get_query_var( 'paged' ) ) {
|
@@ -111,7 +112,10 @@
|
|
111 |
<div class="cb"></div>
|
112 |
</div>
|
113 |
|
114 |
-
<?php
|
|
|
|
|
|
|
115 |
|
116 |
<div class="amp-wp-content pagination-holder">
|
117 |
|
17 |
<?php do_action('ampforwp_home_above_loop') ?>
|
18 |
<main>
|
19 |
<?php do_action('ampforwp_post_before_loop') ?>
|
20 |
+
<?php $count = 1; ?>
|
21 |
|
22 |
<?php
|
23 |
if ( get_query_var( 'paged' ) ) {
|
112 |
<div class="cb"></div>
|
113 |
</div>
|
114 |
|
115 |
+
<?php
|
116 |
+
do_action('ampforwp_between_loop',$count,$this);
|
117 |
+
$count++;
|
118 |
+
endwhile; ?>
|
119 |
|
120 |
<div class="amp-wp-content pagination-holder">
|
121 |
|
@@ -26,6 +26,7 @@
|
|
26 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
27 |
<main>
|
28 |
<?php do_action('ampforwp_post_before_loop') ?>
|
|
|
29 |
<?php
|
30 |
if ( get_query_var( 'paged' ) ) {
|
31 |
$paged = get_query_var('paged');
|
@@ -77,7 +78,10 @@
|
|
77 |
</div>
|
78 |
<div class="cb"></div>
|
79 |
</div>
|
80 |
-
<?php
|
|
|
|
|
|
|
81 |
<div class="amp-wp-content pagination-holder">
|
82 |
|
83 |
<div id="pagination">
|
26 |
<?php do_action( 'ampforwp_after_header', $this ); ?>
|
27 |
<main>
|
28 |
<?php do_action('ampforwp_post_before_loop') ?>
|
29 |
+
<?php $count = 1; ?>
|
30 |
<?php
|
31 |
if ( get_query_var( 'paged' ) ) {
|
32 |
$paged = get_query_var('paged');
|
78 |
</div>
|
79 |
<div class="cb"></div>
|
80 |
</div>
|
81 |
+
<?php
|
82 |
+
do_action('ampforwp_between_loop',$count,$this);
|
83 |
+
$count++;
|
84 |
+
endwhile; ?>
|
85 |
<div class="amp-wp-content pagination-holder">
|
86 |
|
87 |
<div id="pagination">
|
@@ -240,7 +240,7 @@ table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit
|
|
240 |
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); }
|
241 |
.hide-meta-info{ display: none; }
|
242 |
<?php }?>
|
243 |
-
<?php if( $redux_builder_amp['amp-enable-notifications'] == 1 || $redux_builder_amp['ampforwp-cta-subsection-notification-sticky'] == 1 ){ ?>
|
244 |
/* Notifications */
|
245 |
#amp-user-notification1 p { display: inline-block; }
|
246 |
amp-user-notification { padding: 5px; text-align: center; background: #fff; border-top: 1px solid; }
|
@@ -278,6 +278,7 @@ main .amp-archive-heading { direction:rtl }
|
|
278 |
.comment-author { float:right; margin-left:5px; }
|
279 |
.amp-ad-wrapper, .amp-wp-article amp-ad{ direction: ltr; }
|
280 |
.toggle-navigationv2 ul li a { padding: 15px 8px; width: 95%;}
|
|
|
281 |
<?php } ?>
|
282 |
.amp-wp-tax-tag a, a, .amp-wp-author, .headerlogo a, [class*=icono-] { color: <?php echo sanitize_hex_color( $header_background_color ); ?>;; }
|
283 |
body a {color: <?php echo $redux_builder_amp['amp-opt-color-rgba-link-design2']['color'];?> }
|
@@ -327,4 +328,8 @@ amp-user-notification button { background-color: <?php echo sanitize_hex_color(
|
|
327 |
<?php } ?>
|
328 |
.amp-menu > li > a > amp-img, .sub-menu > li > a > amp-img { display: inline-block; margin-right: 4px; }
|
329 |
.menu-item amp-img {width: 16px; height: 11px; display: inline-block; margin-right: 5px;}
|
330 |
-
|
|
|
|
|
|
|
|
240 |
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); }
|
241 |
.hide-meta-info{ display: none; }
|
242 |
<?php }?>
|
243 |
+
<?php if( $redux_builder_amp['amp-enable-notifications'] == 1 || isset($redux_builder_amp['ampforwp-cta-subsection-notification-sticky']) && $redux_builder_amp['ampforwp-cta-subsection-notification-sticky'] == 1 ){ ?>
|
244 |
/* Notifications */
|
245 |
#amp-user-notification1 p { display: inline-block; }
|
246 |
amp-user-notification { padding: 5px; text-align: center; background: #fff; border-top: 1px solid; }
|
278 |
.comment-author { float:right; margin-left:5px; }
|
279 |
.amp-ad-wrapper, .amp-wp-article amp-ad{ direction: ltr; }
|
280 |
.toggle-navigationv2 ul li a { padding: 15px 8px; width: 95%;}
|
281 |
+
amp-carousel{direction: ltr;}
|
282 |
<?php } ?>
|
283 |
.amp-wp-tax-tag a, a, .amp-wp-author, .headerlogo a, [class*=icono-] { color: <?php echo sanitize_hex_color( $header_background_color ); ?>;; }
|
284 |
body a {color: <?php echo $redux_builder_amp['amp-opt-color-rgba-link-design2']['color'];?> }
|
328 |
<?php } ?>
|
329 |
.amp-menu > li > a > amp-img, .sub-menu > li > a > amp-img { display: inline-block; margin-right: 4px; }
|
330 |
.menu-item amp-img {width: 16px; height: 11px; display: inline-block; margin-right: 5px;}
|
331 |
+
.amp-carousel-container {position: relative;width: 100%;height: 100%;}
|
332 |
+
.amp-carousel-img img {object-fit: contain;}
|
333 |
+
<?php // Ads (sitewide)
|
334 |
+
if( ( isset($redux_builder_amp['enable-amp-ads-1'] ) && $redux_builder_amp['enable-amp-ads-1'] ) || ( isset($redux_builder_amp['enable-amp-ads-2'] ) && $redux_builder_amp['enable-amp-ads-2'] ) ){ ?> .amp-ad-wrapper{ text-align: center } .amp-ad-wrapper{ text-align: center; margin-left: -13px; } .amp-ad-wrapper, .amp-wp-article amp-ad{ direction: ltr; } .amp-ad-2{ margin-bottom: 50px; } .amp_home_body .amp_ad_1{ margin-top: 10px; margin-bottom: -20px; }<?php }
|
335 |
+
echo $redux_builder_amp['css_editor']; } ?>
|
@@ -51,6 +51,7 @@ if ( get_query_var( 'paged' ) ) {
|
|
51 |
|
52 |
<main>
|
53 |
<?php do_action('ampforwp_post_before_loop') ?>
|
|
|
54 |
<?php
|
55 |
|
56 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
@@ -142,7 +143,10 @@ if ( get_query_var( 'paged' ) ) {
|
|
142 |
<div class="cb"></div>
|
143 |
</div>
|
144 |
|
145 |
-
<?php
|
|
|
|
|
|
|
146 |
|
147 |
<div class="amp-wp-content pagination-holder">
|
148 |
|
51 |
|
52 |
<main>
|
53 |
<?php do_action('ampforwp_post_before_loop') ?>
|
54 |
+
<?php $count = 1; ?>
|
55 |
<?php
|
56 |
|
57 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
143 |
<div class="cb"></div>
|
144 |
</div>
|
145 |
|
146 |
+
<?php
|
147 |
+
do_action('ampforwp_between_loop',$count,$this);
|
148 |
+
$count++;
|
149 |
+
endwhile; ?>
|
150 |
|
151 |
<div class="amp-wp-content pagination-holder">
|
152 |
|
@@ -13,9 +13,13 @@ if (!comments_open() || ( isset($redux_builder_amp['wordpress-comments-support']
|
|
13 |
'post_id' => $postID,
|
14 |
'status' => 'approve' //Change this to the type of comments to be displayed
|
15 |
));
|
16 |
-
if ( $comments ) {
|
|
|
|
|
|
|
17 |
<div class="amp-wp-content comments_list">
|
18 |
-
<h3><?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-view-comments-text'], 'View Comments' )
|
|
|
19 |
<ul>
|
20 |
<?php
|
21 |
// Display the list of comments
|
13 |
'post_id' => $postID,
|
14 |
'status' => 'approve' //Change this to the type of comments to be displayed
|
15 |
));
|
16 |
+
if ( $comments ) {
|
17 |
+
$comment_nums = '';
|
18 |
+
$comment_nums = get_comments_number();
|
19 |
+
$comment_nums = " ($comment_nums) " ?>
|
20 |
<div class="amp-wp-content comments_list">
|
21 |
+
<h3><?php global $redux_builder_amp; echo ampforwp_translation($redux_builder_amp['amp-translator-view-comments-text'], 'View Comments' ). $comment_nums ?>
|
22 |
+
</h3>
|
23 |
<ul>
|
24 |
<?php
|
25 |
// Display the list of comments
|
@@ -73,18 +73,15 @@
|
|
73 |
$related_post_permalink = trailingslashit($related_post_permalink);
|
74 |
$related_post_permalink = user_trailingslashit( $related_post_permalink . AMPFORWP_AMP_QUERY_VAR );
|
75 |
?>
|
76 |
-
<li class="<?php if (
|
77 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
<amp-img src="<?php echo esc_url( $thumb_url_2 ); ?>" width="150" height="150" layout="responsive"></amp-img>
|
86 |
-
<?php } ?>
|
87 |
-
</a>
|
88 |
<div class="related_link">
|
89 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
|
90 |
<?php if(has_excerpt()){
|
73 |
$related_post_permalink = trailingslashit($related_post_permalink);
|
74 |
$related_post_permalink = user_trailingslashit( $related_post_permalink . AMPFORWP_AMP_QUERY_VAR );
|
75 |
?>
|
76 |
+
<li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
|
77 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
|
78 |
+
<?php if ( ampforwp_has_post_thumbnail() ) {
|
79 |
+
$thumb_url = ampforwp_get_post_thumbnail();
|
80 |
+
if($thumb_url){?>
|
81 |
+
<amp-img src="<?php echo esc_url( $thumb_url ); ?>" width="150" height="150" layout="responsive"></amp-img>
|
82 |
+
<?php }
|
83 |
+
}?>
|
84 |
+
</a>
|
|
|
|
|
|
|
85 |
<div class="related_link">
|
86 |
<a href="<?php echo esc_url( $related_post_permalink ); ?>"><?php the_title(); ?></a>
|
87 |
<?php if(has_excerpt()){
|
@@ -10,6 +10,18 @@
|
|
10 |
<?php do_action('ampforwp_before_social_icons_hook',$this); ?>
|
11 |
<div class="amp-wp-content ampforwp-social-icons-wrapper ampforwp-social-icons">
|
12 |
<i class="icono-share"></i>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
14 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="40" height="40"></amp-social-share>
|
15 |
<?php } ?>
|
10 |
<?php do_action('ampforwp_before_social_icons_hook',$this); ?>
|
11 |
<div class="amp-wp-content ampforwp-social-icons-wrapper ampforwp-social-icons">
|
12 |
<i class="icono-share"></i>
|
13 |
+
<?php if( true == $redux_builder_amp['ampforwp-facebook-like-button'] ) {
|
14 |
+
$facebook_like_url = '';
|
15 |
+
$facebook_like_url = $redux_builder_amp['ampforwp-facebook-like-url'];
|
16 |
+
if( $facebook_like_url ){ ?>
|
17 |
+
<amp-facebook-like width=90 height=28
|
18 |
+
layout="fixed"
|
19 |
+
data-size="large"
|
20 |
+
data-layout="button_count"
|
21 |
+
data-href="<?php echo esc_url($facebook_like_url); ?>">
|
22 |
+
</amp-facebook-like>
|
23 |
+
<?php }
|
24 |
+
} ?>
|
25 |
<?php if($redux_builder_amp['enable-single-facebook-share'] == true) { ?>
|
26 |
<amp-social-share type="facebook" data-param-app_id="<?php echo $redux_builder_amp['amp-facebook-app-id']; ?>" width="40" height="40"></amp-social-share>
|
27 |
<?php } ?>
|
@@ -69,7 +69,7 @@ if ( get_query_var( 'paged' ) ) {
|
|
69 |
<amp-img src=<?php echo $thumb_url ?> width=450 height=270></amp-img>
|
70 |
<?php }
|
71 |
}?>
|
72 |
-
<a href="<?php echo
|
73 |
<div class="featured_title">
|
74 |
<div class="featured_time"><?php
|
75 |
$post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
|
@@ -87,6 +87,7 @@ if ( get_query_var( 'paged' ) ) {
|
|
87 |
<?php do_action('ampforwp_home_above_loop') ?>
|
88 |
<main>
|
89 |
<?php do_action('ampforwp_post_before_loop') ?>
|
|
|
90 |
<?php
|
91 |
|
92 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
@@ -107,8 +108,7 @@ if ( get_query_var( 'paged' ) ) {
|
|
107 |
if($blog_title){ ?>
|
108 |
<h1 class="amp-wp-content page-title"><?php echo $blog_title ?> </h1>
|
109 |
<?php }
|
110 |
-
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 ( ! ampforwp_has_post_thumbnail() ){?>amp-loop-list-noimg<?php } ?>">
|
114 |
<?php if ( ampforwp_has_post_thumbnail() ) {
|
@@ -116,7 +116,7 @@ if ( get_query_var( 'paged' ) ) {
|
|
116 |
if($thumb_url){
|
117 |
?>
|
118 |
<div class="home-post_image">
|
119 |
-
<a href="<?php echo
|
120 |
<amp-img
|
121 |
layout="responsive"
|
122 |
src=<?php echo esc_url( $thumb_url ); ?>
|
@@ -135,7 +135,7 @@ if ( get_query_var( 'paged' ) ) {
|
|
135 |
<li class="amp-cat-<?php echo $category->term_id;?>"><?php echo $category->cat_name ?></li>
|
136 |
<?php } ?>
|
137 |
</ul>
|
138 |
-
<h2 class="amp-wp-title"> <a href="<?php echo
|
139 |
|
140 |
|
141 |
<?php
|
@@ -167,7 +167,10 @@ if ( get_query_var( 'paged' ) ) {
|
|
167 |
<div class="cb"></div>
|
168 |
</div>
|
169 |
|
170 |
-
<?php
|
|
|
|
|
|
|
171 |
|
172 |
<div class="amp-wp-content pagination-holder">
|
173 |
|
69 |
<amp-img src=<?php echo $thumb_url ?> width=450 height=270></amp-img>
|
70 |
<?php }
|
71 |
}?>
|
72 |
+
<a href="<?php echo ampforwp_url_controller( get_the_permalink() ); ?>">
|
73 |
<div class="featured_title">
|
74 |
<div class="featured_time"><?php
|
75 |
$post_date = human_time_diff( get_the_time('U', get_the_ID() ), current_time('timestamp') ) .' '. ampforwp_translation( $redux_builder_amp['amp-translator-ago-date-text'],'ago' );
|
87 |
<?php do_action('ampforwp_home_above_loop') ?>
|
88 |
<main>
|
89 |
<?php do_action('ampforwp_post_before_loop') ?>
|
90 |
+
<?php $count = 1; ?>
|
91 |
<?php
|
92 |
|
93 |
$exclude_ids = get_option('ampforwp_exclude_post');
|
108 |
if($blog_title){ ?>
|
109 |
<h1 class="amp-wp-content page-title"><?php echo $blog_title ?> </h1>
|
110 |
<?php }
|
111 |
+
if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post(); ?>
|
|
|
112 |
|
113 |
<div class="amp-wp-content amp-loop-list <?php if ( ! ampforwp_has_post_thumbnail() ){?>amp-loop-list-noimg<?php } ?>">
|
114 |
<?php if ( ampforwp_has_post_thumbnail() ) {
|
116 |
if($thumb_url){
|
117 |
?>
|
118 |
<div class="home-post_image">
|
119 |
+
<a href="<?php echo ampforwp_url_controller( get_the_permalink() ); ?>">
|
120 |
<amp-img
|
121 |
layout="responsive"
|
122 |
src=<?php echo esc_url( $thumb_url ); ?>
|
135 |
<li class="amp-cat-<?php echo $category->term_id;?>"><?php echo $category->cat_name ?></li>
|
136 |
<?php } ?>
|
137 |
</ul>
|
138 |
+
<h2 class="amp-wp-title"> <a href="<?php echo ampforwp_url_controller( get_the_permalink() ); ?>"> <?php the_title(); ?></a></h2>
|
139 |
|
140 |
|
141 |
<?php
|
167 |
<div class="cb"></div>
|
168 |
</div>
|
169 |
|
170 |
+
<?php
|
171 |
+
do_action('ampforwp_between_loop',$count,$this);
|
172 |
+
$count++;
|
173 |
+
endwhile; ?>
|
174 |
|
175 |
<div class="amp-wp-content pagination-holder">
|
176 |
|
@@ -31,6 +31,7 @@
|
|
31 |
|
32 |
<main>
|
33 |
<?php do_action('ampforwp_post_before_loop') ?>
|
|
|
34 |
<?php
|
35 |
if ( get_query_var( 'paged' ) ) {
|
36 |
$paged = get_query_var('paged');
|
@@ -102,7 +103,10 @@
|
|
102 |
<div class="cb"></div>
|
103 |
</div>
|
104 |
|
105 |
-
<?php
|
|
|
|
|
|
|
106 |
|
107 |
<div class="amp-wp-content pagination-holder">
|
108 |
|
31 |
|
32 |
<main>
|
33 |
<?php do_action('ampforwp_post_before_loop') ?>
|
34 |
+
<?php $count = 1; ?>
|
35 |
<?php
|
36 |
if ( get_query_var( 'paged' ) ) {
|
37 |
$paged = get_query_var('paged');
|
103 |
<div class="cb"></div>
|
104 |
</div>
|
105 |
|
106 |
+
<?php
|
107 |
+
do_action('ampforwp_between_loop',$count,$this);
|
108 |
+
$count++;
|
109 |
+
endwhile; ?>
|
110 |
|
111 |
<div class="amp-wp-content pagination-holder">
|
112 |
|
@@ -164,6 +164,7 @@ h1.amp-wp-title{ margin: 0; color: #333333; font-size: 48px; line-height: 58px;
|
|
164 |
.custom-amp-socialsharing-line{background:#00b900}
|
165 |
.custom-amp-social-sharing-vk{background:#45668e}
|
166 |
.custom-amp-social-sharing-odnoklassniki{background:#ed812b}
|
|
|
167 |
.amp-wp-tax-tag { list-style: none; display: inline-block; }
|
168 |
figure{ margin: 0 0 20px 0; }
|
169 |
figure amp-img{ max-width:100%; }
|
@@ -281,7 +282,8 @@ amp-lightbox{ background: rgba(0, 0, 0,0.85); }
|
|
281 |
#searchsubmit{opacity:0}
|
282 |
.featured_time{ font-size: 12px; color: #fff; opacity: 0.8; padding-left: 20px; }
|
283 |
.archives_body main{ margin-top:30px }
|
284 |
-
.archives_body .page-title{
|
|
|
285 |
<?php if(is_home() && $redux_builder_amp['amp-frontpage-select-option']==0){?>
|
286 |
/* AMP carousel */
|
287 |
.amp-carousel-button-prev, .amp-carousel-button-next{ top:30px;border-radius:60px; }
|
@@ -314,7 +316,7 @@ table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit
|
|
314 |
table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
|
315 |
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); }
|
316 |
<?php } ?>
|
317 |
-
<?php if( $redux_builder_amp['amp-enable-notifications'] == 1 || $redux_builder_amp['ampforwp-cta-subsection-notification-sticky'] == 1 ){?>
|
318 |
/* Notifications */
|
319 |
#amp-user-notification1 p{ display: inline-block; }
|
320 |
amp-user-notification{ padding: 5px; text-align: center; background: #fff; border-top: 1px solid; }
|
@@ -353,6 +355,7 @@ main .amp-wp-content{ direction: rtl; }
|
|
353 |
.amp_author_area_wrapper strong{ float: right; }
|
354 |
.amp-menu li.menu-item-has-children:after { left: 0; right: auto; }
|
355 |
amp-sidebar { direction: rtl; }
|
|
|
356 |
<?php } ?>
|
357 |
|
358 |
a { color: <?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']; ?> }
|
@@ -440,4 +443,8 @@ if( !is_home() && $redux_builder_amp['ampforwp-bread-crumb'] == 1 ) { ?>
|
|
440 |
<?php } ?>
|
441 |
.amp-menu > li > a > amp-img, .sub-menu > li > a > amp-img { display: inline-block; margin-right: 4px; }
|
442 |
.menu-item amp-img {width: 16px; height: 11px; display: inline-block; margin-right: 5px; }
|
443 |
-
|
|
|
|
|
|
|
|
164 |
.custom-amp-socialsharing-line{background:#00b900}
|
165 |
.custom-amp-social-sharing-vk{background:#45668e}
|
166 |
.custom-amp-social-sharing-odnoklassniki{background:#ed812b}
|
167 |
+
.ampforwp-social-icons amp-facebook-like{border-radius: 60px;position: relative;top: -6px;}
|
168 |
.amp-wp-tax-tag { list-style: none; display: inline-block; }
|
169 |
figure{ margin: 0 0 20px 0; }
|
170 |
figure amp-img{ max-width:100%; }
|
282 |
#searchsubmit{opacity:0}
|
283 |
.featured_time{ font-size: 12px; color: #fff; opacity: 0.8; padding-left: 20px; }
|
284 |
.archives_body main{ margin-top:30px }
|
285 |
+
.archives_body .page-title, .taxonomy-description{padding: 0 15px}
|
286 |
+
.taxonomy-description p{margin-top: 5px;font-size: 14px;line-height: 1.5;}
|
287 |
<?php if(is_home() && $redux_builder_amp['amp-frontpage-select-option']==0){?>
|
288 |
/* AMP carousel */
|
289 |
.amp-carousel-button-prev, .amp-carousel-button-next{ top:30px;border-radius:60px; }
|
316 |
table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
|
317 |
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); }
|
318 |
<?php } ?>
|
319 |
+
<?php if( $redux_builder_amp['amp-enable-notifications'] == 1 || isset($redux_builder_amp['ampforwp-cta-subsection-notification-sticky']) && $redux_builder_amp['ampforwp-cta-subsection-notification-sticky'] == 1 ){?>
|
320 |
/* Notifications */
|
321 |
#amp-user-notification1 p{ display: inline-block; }
|
322 |
amp-user-notification{ padding: 5px; text-align: center; background: #fff; border-top: 1px solid; }
|
355 |
.amp_author_area_wrapper strong{ float: right; }
|
356 |
.amp-menu li.menu-item-has-children:after { left: 0; right: auto; }
|
357 |
amp-sidebar { direction: rtl; }
|
358 |
+
amp-carousel{direction: ltr;}
|
359 |
<?php } ?>
|
360 |
|
361 |
a { color: <?php echo $redux_builder_amp['amp-opt-color-rgba-colorscheme']['color']; ?> }
|
443 |
<?php } ?>
|
444 |
.amp-menu > li > a > amp-img, .sub-menu > li > a > amp-img { display: inline-block; margin-right: 4px; }
|
445 |
.menu-item amp-img {width: 16px; height: 11px; display: inline-block; margin-right: 5px; }
|
446 |
+
.amp-carousel-container {position: relative;width: 100%;height: 100%;}
|
447 |
+
.amp-carousel-img img {object-fit: contain;}
|
448 |
+
<?php // Ads (sitewide)
|
449 |
+
if( ( isset($redux_builder_amp['enable-amp-ads-1'] ) && $redux_builder_amp['enable-amp-ads-1'] ) || ( isset($redux_builder_amp['enable-amp-ads-2'] ) && $redux_builder_amp['enable-amp-ads-2'] ) ){ ?> .amp-ad-wrapper{ text-align: center } .amp_ad_1{ margin-top: 15px; margin-bottom: 10px; } .single-post .amp_ad_1{ margin-bottom: -15px; } .amp-ad-2{ margin-bottom: -5px; margin-top: 20px; } .amp-ad-wrapper{ text-align: center; margin-left: -13px; }.amp-ad-wrapper, .amp-wp-article amp-ad{ direction: ltr; } <?php }
|
450 |
+
echo $redux_builder_amp['css_editor']; } ?>
|
@@ -104,6 +104,8 @@
|
|
104 |
94. OneSignal Push Notifications
|
105 |
95. Modify menu link attributes for SiteNavigationElement Schema Markup #1229 #1345
|
106 |
96. ampforwp_is_front_page() ampforwp_is_home() and ampforwp_is_blog is created
|
|
|
|
|
107 |
*/
|
108 |
// Adding AMP-related things to the main theme
|
109 |
global $redux_builder_amp;
|
@@ -239,7 +241,6 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
239 |
} else {
|
240 |
$amp_url = amp_get_permalink( get_queried_object_id() );
|
241 |
}
|
242 |
-
|
243 |
global $post;
|
244 |
$ampforwp_amp_post_on_off_meta = get_post_meta( get_the_ID(),'ampforwp-amp-on-off',true);
|
245 |
if( is_singular() && $ampforwp_amp_post_on_off_meta === 'hide-amp' ) {
|
@@ -276,21 +277,39 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
276 |
$amp_url = untrailingslashit($current_search_url);
|
277 |
}
|
278 |
|
279 |
-
// WPML AMPHTML #1285
|
280 |
-
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
281 |
-
if(is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){
|
282 |
-
Global $sitepress_settings;
|
283 |
-
if($sitepress_settings[ 'language_negotiation_type' ] == 3){
|
284 |
-
$wpml_url =get_permalink( get_queried_object_id() );
|
285 |
-
$explode_url = explode('/', $wpml_url);
|
286 |
-
$append_amp = 'amp';
|
287 |
-
array_splice( $explode_url, 5, 0, $append_amp );
|
288 |
-
$impode_url = implode('/', $explode_url);
|
289 |
-
$amp_url = untrailingslashit($impode_url);
|
290 |
-
}
|
291 |
-
}
|
292 |
-
|
293 |
$amp_url = ampforwp_url_purifier($amp_url);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
$amp_url = apply_filters('ampforwp_modify_rel_canonical',$amp_url);
|
295 |
|
296 |
if( $supported_amp_post_types) {
|
@@ -452,6 +471,12 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
452 |
}
|
453 |
}
|
454 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
return $data;
|
456 |
}
|
457 |
|
@@ -512,7 +537,8 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
512 |
|
513 |
function ampforwp_header_advert() {
|
514 |
global $redux_builder_amp;
|
515 |
-
|
|
|
516 |
if($redux_builder_amp['enable-amp-ads-1'] == true) {
|
517 |
if($redux_builder_amp['enable-amp-ads-select-1'] == 1) {
|
518 |
$advert_width = '300';
|
@@ -538,7 +564,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
538 |
}
|
539 |
$output = '<div class="amp-ad-wrapper amp_ad_1">';
|
540 |
$output .= '<amp-ad class="amp-ad-1"
|
541 |
-
type="adsense"
|
542 |
width='. $advert_width .' height='. $advert_height . '
|
543 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-1'].'"
|
544 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-1'] .'">';
|
@@ -553,7 +579,8 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
553 |
|
554 |
function ampforwp_footer_advert() {
|
555 |
global $redux_builder_amp;
|
556 |
-
|
|
|
557 |
if($redux_builder_amp['enable-amp-ads-2'] == true) {
|
558 |
if($redux_builder_amp['enable-amp-ads-select-2'] == 1) {
|
559 |
$advert_width = '300';
|
@@ -579,7 +606,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
579 |
}
|
580 |
$output = '<div class="amp-ad-wrapper">';
|
581 |
$output .= '<amp-ad class="amp-ad-2"
|
582 |
-
type="adsense"
|
583 |
width='. $advert_width .' height='. $advert_height . '
|
584 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-2'].'"
|
585 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-2'] .'">';
|
@@ -595,7 +622,8 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
595 |
|
596 |
function ampforwp_before_post_content_advert() {
|
597 |
global $redux_builder_amp;
|
598 |
-
|
|
|
599 |
if($redux_builder_amp['enable-amp-ads-3'] == true) {
|
600 |
if($redux_builder_amp['enable-amp-ads-select-3'] == 1) {
|
601 |
$advert_width = '300';
|
@@ -621,7 +649,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
621 |
}
|
622 |
$output = '<div class="amp-ad-wrapper">';
|
623 |
$output .= '<amp-ad class="amp-ad-3"
|
624 |
-
type="adsense"
|
625 |
width='. $advert_width .' height='. $advert_height . '
|
626 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-3'].'"
|
627 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-3'] .'">';
|
@@ -637,7 +665,8 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
637 |
// add_action('ampforwp_inside_post_content_after','ampforwp_after_post_content_advert');
|
638 |
function ampforwp_after_post_content_advert() {
|
639 |
global $redux_builder_amp;
|
640 |
-
|
|
|
641 |
if($redux_builder_amp['enable-amp-ads-4'] == true) {
|
642 |
if($redux_builder_amp['enable-amp-ads-select-4'] == 1) {
|
643 |
$advert_width = '300';
|
@@ -663,7 +692,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
663 |
}
|
664 |
$output = '<div class="amp-ad-wrapper">';
|
665 |
$output .= '<amp-ad class="amp-ad-4"
|
666 |
-
type="adsense"
|
667 |
width='. $advert_width .' height='. $advert_height . '
|
668 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-4'].'"
|
669 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-4'] .'">';
|
@@ -680,7 +709,8 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
680 |
|
681 |
function ampforwp_below_the_title_advert() {
|
682 |
global $redux_builder_amp;
|
683 |
-
|
|
|
684 |
if($redux_builder_amp['enable-amp-ads-5'] == true) {
|
685 |
if($redux_builder_amp['enable-amp-ads-select-5'] == 1) {
|
686 |
$advert_width = '300';
|
@@ -706,7 +736,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
706 |
}
|
707 |
$output = '<div class="amp-ad-wrapper">';
|
708 |
$output .= '<amp-ad class="amp-ad-5"
|
709 |
-
type="adsense"
|
710 |
width='. $advert_width .' height='. $advert_height . '
|
711 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-5'].'"
|
712 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-5'] .'">';
|
@@ -724,7 +754,8 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
724 |
|
725 |
function ampforwp_above_related_post_advert() {
|
726 |
global $redux_builder_amp;
|
727 |
-
|
|
|
728 |
if($redux_builder_amp['enable-amp-ads-6'] == true) {
|
729 |
if($redux_builder_amp['enable-amp-ads-select-6'] == 1) {
|
730 |
$advert_width = '300';
|
@@ -750,7 +781,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
750 |
}
|
751 |
$output = '<div class="amp-ad-wrapper">';
|
752 |
$output .= '<amp-ad class="amp-ad-6"
|
753 |
-
type="adsense"
|
754 |
width='. $advert_width .' height='. $advert_height . '
|
755 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-6'].'"
|
756 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-6'] .'">';
|
@@ -760,7 +791,17 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
760 |
}
|
761 |
}
|
762 |
|
763 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
764 |
// 10. Analytics Area
|
765 |
add_action('amp_post_template_footer','ampforwp_analytics',11);
|
766 |
function ampforwp_analytics() {
|
@@ -995,17 +1036,8 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
995 |
$content = preg_replace('/readability=[^>]*/', '', $content);
|
996 |
// removing color from span tag
|
997 |
$content = preg_replace('/<span(.*?)(color=".*?")(.*?)>/', '<span$1$3>', $content);
|
998 |
-
// removing sl-processed
|
999 |
-
$content = preg_replace('
|
1000 |
-
$content = preg_replace('/<a (href=".*?")(.*?)(rel=".*?")(.*?)(sl-processed=".*?")>/', '<a $1$3>', $content);
|
1001 |
-
// Removing text-align, center, font-size from the a tag
|
1002 |
-
$content = preg_replace('/<a (href=".*?")(.*?)(rel=".*?").*?(text-align:=".*?").*?(center=".*?").*?(font-size:=".*?")>/', '<a $1 $3>', $content);
|
1003 |
-
// Removing _blank="" from the a tag
|
1004 |
-
$content = preg_replace('/<a (href=".*?")(.*?)(_blank=".*?")>/', '<a $1 $2>', $content);
|
1005 |
-
// removing text-align:center from p tag
|
1006 |
-
$content = preg_replace('/<p(.*?)(text-align:=".*?")(.*?)(center=".*?")(.*?)>/', '<p$1$5>', $content);
|
1007 |
-
// removing paraid, paraeid from p tag
|
1008 |
-
$content = preg_replace('/<p(.*?)(class=".*?")(.*?)paraid=".*?" paraeid=".*?">/', '<p$1$2>', $content);
|
1009 |
|
1010 |
return $content;
|
1011 |
}
|
@@ -1024,7 +1056,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
1024 |
}
|
1025 |
|
1026 |
// 11.5 Strip unwanted codes the_content of Frontpage
|
1027 |
-
|
1028 |
function ampforwp_strip_invalid_content_frontpage(){
|
1029 |
if ( is_front_page() || is_home() ) {
|
1030 |
add_filter( 'the_content', 'ampforwp_the_content_filter_frontpage', 20 );
|
@@ -1182,7 +1214,14 @@ function ampforwp_title_custom_meta() {
|
|
1182 |
|
1183 |
$post_types = ampforwp_get_all_post_types();
|
1184 |
|
1185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1186 |
|
1187 |
foreach ( $post_types as $post_type ) {
|
1188 |
|
@@ -1292,7 +1331,14 @@ function ampforwp_mobile_redirection() {
|
|
1292 |
global $redux_builder_amp;
|
1293 |
$post_types = ampforwp_get_all_post_types();
|
1294 |
|
1295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1296 |
|
1297 |
foreach ( $post_types as $post_type ) {
|
1298 |
|
@@ -1581,6 +1627,8 @@ function ampforwp_remove_schema_data() {
|
|
1581 |
remove_filter('the_content', 'sfsi_social_buttons_below');
|
1582 |
// Removing WordPress Social Share Buttons #1272
|
1583 |
remove_filter ('the_content', 'FTGSB');
|
|
|
|
|
1584 |
}
|
1585 |
|
1586 |
// 22. Removing author links from comments Issue #180
|
@@ -3850,7 +3898,7 @@ function ampforwp_supported_post_types($supported_types){
|
|
3850 |
global $redux_builder_amp;
|
3851 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
3852 |
if( is_plugin_active( 'amp-custom-post-type/amp-custom-post-type.php' ) ) {
|
3853 |
-
if ( $redux_builder_amp['ampforwp-custom-type'] ) {
|
3854 |
foreach($redux_builder_amp['ampforwp-custom-type'] as $custom_post){
|
3855 |
$supported_types[] = $custom_post;
|
3856 |
}
|
@@ -3895,15 +3943,15 @@ function is_category_amp_disabled(){
|
|
3895 |
|
3896 |
add_action( 'admin_bar_menu', 'ampforwp_visit_amp_in_admin_bar',999 );
|
3897 |
|
3898 |
-
function ampforwp_visit_amp_in_admin_bar($admin_bar) {
|
3899 |
-
|
3900 |
-
|
3901 |
-
|
3902 |
-
|
3903 |
-
|
3904 |
-
|
3905 |
-
|
3906 |
-
|
3907 |
}
|
3908 |
|
3909 |
// Things to be added in the Body Tag #1064
|
@@ -4380,17 +4428,87 @@ add_filter('amp_gallery_images','ampforwp_new_gallery_images', 10, 2);
|
|
4380 |
function ampforwp_new_gallery_images($images, $image){
|
4381 |
//Check if the attachment has caption or not
|
4382 |
if(isset($image['caption']) && $image['caption'] != '' ){
|
|
|
|
|
|
|
|
|
|
|
4383 |
$caption = $image['caption'];
|
4384 |
-
$figcaption = '<p class="wp-caption-text">'. wp_kses_data( $caption ) . '</p>';
|
4385 |
// Append the caption with image
|
4386 |
-
return '<div class="ampforwp-gallery-item">'. $images .
|
4387 |
}
|
4388 |
else{
|
4389 |
// If there is no caption
|
4390 |
-
return '<div class="ampforwp-gallery-item">'. $images . '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4391 |
}
|
4392 |
}
|
4393 |
-
|
4394 |
// 86. minify the content of pages
|
4395 |
add_filter('ampforwp_the_content_last_filter','ampforwp_minify_html_output');
|
4396 |
function ampforwp_minify_html_output($content_buffer){
|
@@ -4479,7 +4597,9 @@ if( !function_exists('ampforwp_has_post_thumbnail')){
|
|
4479 |
return true;
|
4480 |
}
|
4481 |
elseif(isset($redux_builder_amp['ampforwp-featured-image-from-content']) && $redux_builder_amp['ampforwp-featured-image-from-content'] == true){
|
4482 |
-
|
|
|
|
|
4483 |
}
|
4484 |
else
|
4485 |
return false;
|
@@ -4700,7 +4820,7 @@ if( ! function_exists( ' ampforwp_onesignal_notifications ' ) ){
|
|
4700 |
// HTTPS sites
|
4701 |
$onesignal_domain = trailingslashit( esc_url( home_url() ) ) ;
|
4702 |
$onesignal_app_id = $redux_builder_amp['ampforwp-one-signal-app-id'];
|
4703 |
-
$helper_iframe_url = $onesignal_domain .'
|
4704 |
|
4705 |
$permission_dialog_url = $onesignal_domain .'amp-permission-dialog.html?appId=' . $onesignal_app_id;
|
4706 |
|
@@ -4739,12 +4859,14 @@ if( ! function_exists(' ampforwp_onesignal_notifications_widget') ){
|
|
4739 |
layout="fixed"
|
4740 |
src="data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Vic2NyaWJlLWljb24iIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMS44NCAxOS44ODdIMS4yMnMtLjk0Ny0uMDk0LS45NDctLjk5NWMwLS45LjgwNi0uOTQ4LjgwNi0uOTQ4czMuMTctMS41MTcgMy4xNy0yLjYwOGMwLTEuMDktLjUyLTEuODUtLjUyLTYuMzA1czIuODUtNy44NyA2LjI2LTcuODdjMCAwIC40NzMtMS4xMzQgMS44NS0xLjEzNCAxLjMyNSAwIDEuOCAxLjEzNyAxLjggMS4xMzcgMy40MTMgMCA2LjI2IDMuNDE4IDYuMjYgNy44NyAwIDQuNDYtLjQ3NyA1LjIyLS40NzcgNi4zMSAwIDEuMDkgMy4xNzYgMi42MDcgMy4xNzYgMi42MDdzLjgxLjA0Ni44MS45NDdjMCAuODUzLS45OTYuOTk1LS45OTYuOTk1SDExLjg0ek04IDIwLjk3N2g3LjExcy0uNDkgMi45ODctMy41MyAyLjk4N1M4IDIwLjk3OCA4IDIwLjk3OHoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=">
|
4741 |
</amp-img>
|
4742 |
-
Subscribe to updates
|
4743 |
</button>
|
4744 |
</amp-web-push-widget>
|
4745 |
<!-- An unsubscription widget -->
|
4746 |
<amp-web-push-widget visibility="subscribed" layout="fixed" width="230" height="45">
|
4747 |
-
<button class="unsubscribe" on="tap:amp-web-push.unsubscribe">
|
|
|
|
|
4748 |
</amp-web-push-widget>
|
4749 |
<?php }
|
4750 |
}
|
@@ -4838,4 +4960,30 @@ function ampforwp_is_blog(){
|
|
4838 |
$get_blog_details = ampforwp_get_blog_details();
|
4839 |
|
4840 |
return $get_blog_details ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4841 |
}
|
104 |
94. OneSignal Push Notifications
|
105 |
95. Modify menu link attributes for SiteNavigationElement Schema Markup #1229 #1345
|
106 |
96. ampforwp_is_front_page() ampforwp_is_home() and ampforwp_is_blog is created
|
107 |
+
97. Change the format of the post date on Loops #1384
|
108 |
+
98. Create Dynamic url of amp according to the permalink structure #1318
|
109 |
*/
|
110 |
// Adding AMP-related things to the main theme
|
111 |
global $redux_builder_amp;
|
241 |
} else {
|
242 |
$amp_url = amp_get_permalink( get_queried_object_id() );
|
243 |
}
|
|
|
244 |
global $post;
|
245 |
$ampforwp_amp_post_on_off_meta = get_post_meta( get_the_ID(),'ampforwp-amp-on-off',true);
|
246 |
if( is_singular() && $ampforwp_amp_post_on_off_meta === 'hide-amp' ) {
|
277 |
$amp_url = untrailingslashit($current_search_url);
|
278 |
}
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
$amp_url = ampforwp_url_purifier($amp_url);
|
281 |
+
|
282 |
+
|
283 |
+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
284 |
+
if( get_option('permalink_structure') && is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' )){
|
285 |
+
global $sitepress_settings, $wp;
|
286 |
+
if($sitepress_settings[ 'language_negotiation_type' ] == 3){
|
287 |
+
if( is_singular() ){
|
288 |
+
$wpml_url =get_permalink( get_queried_object_id() );
|
289 |
+
$explode_url = explode('/', $wpml_url);
|
290 |
+
$append_amp = 'amp';
|
291 |
+
array_splice( $explode_url, 5, 0, $append_amp );
|
292 |
+
$impode_url = implode('/', $explode_url);
|
293 |
+
$amp_url = untrailingslashit($impode_url);
|
294 |
+
}
|
295 |
+
if ( is_home() || is_archive() ){
|
296 |
+
global $wp;
|
297 |
+
$current_archive_url = home_url( $wp->request );
|
298 |
+
$explode_path = explode("/",$current_archive_url);
|
299 |
+
$inserted = array(AMPFORWP_AMP_QUERY_VAR);
|
300 |
+
$query_arg_array = $wp->query_vars;
|
301 |
+
if( array_key_exists( 'paged' , $query_arg_array ) ) {
|
302 |
+
array_splice( $explode_path, -3, 0, $inserted );
|
303 |
+
}
|
304 |
+
else{
|
305 |
+
array_splice( $explode_path, -1, 0, $inserted );
|
306 |
+
}
|
307 |
+
$impode_url = implode('/', $explode_path);
|
308 |
+
$amp_url = $impode_url;
|
309 |
+
}
|
310 |
+
}
|
311 |
+
}
|
312 |
+
|
313 |
$amp_url = apply_filters('ampforwp_modify_rel_canonical',$amp_url);
|
314 |
|
315 |
if( $supported_amp_post_types) {
|
471 |
}
|
472 |
}
|
473 |
}
|
474 |
+
// Facebook Like Script
|
475 |
+
if( isset($redux_builder_amp['ampforwp-facebook-like-button'] ) && true == $redux_builder_amp['ampforwp-facebook-like-button'] && is_single() ){
|
476 |
+
if(empty($data['amp_component_scripts']['amp-facebook-like'])){
|
477 |
+
$data['amp_component_scripts']['amp-facebook-like'] = 'https://cdn.ampproject.org/v0/amp-facebook-like-0.1.js';
|
478 |
+
}
|
479 |
+
}
|
480 |
return $data;
|
481 |
}
|
482 |
|
537 |
|
538 |
function ampforwp_header_advert() {
|
539 |
global $redux_builder_amp;
|
540 |
+
$optimize = '';
|
541 |
+
$optimize = ampforwp_ad_optimize();
|
542 |
if($redux_builder_amp['enable-amp-ads-1'] == true) {
|
543 |
if($redux_builder_amp['enable-amp-ads-select-1'] == 1) {
|
544 |
$advert_width = '300';
|
564 |
}
|
565 |
$output = '<div class="amp-ad-wrapper amp_ad_1">';
|
566 |
$output .= '<amp-ad class="amp-ad-1"
|
567 |
+
type="adsense" '. $optimize .'
|
568 |
width='. $advert_width .' height='. $advert_height . '
|
569 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-1'].'"
|
570 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-1'] .'">';
|
579 |
|
580 |
function ampforwp_footer_advert() {
|
581 |
global $redux_builder_amp;
|
582 |
+
$optimize = '';
|
583 |
+
$optimize = ampforwp_ad_optimize();
|
584 |
if($redux_builder_amp['enable-amp-ads-2'] == true) {
|
585 |
if($redux_builder_amp['enable-amp-ads-select-2'] == 1) {
|
586 |
$advert_width = '300';
|
606 |
}
|
607 |
$output = '<div class="amp-ad-wrapper">';
|
608 |
$output .= '<amp-ad class="amp-ad-2"
|
609 |
+
type="adsense" '. $optimize .'
|
610 |
width='. $advert_width .' height='. $advert_height . '
|
611 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-2'].'"
|
612 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-2'] .'">';
|
622 |
|
623 |
function ampforwp_before_post_content_advert() {
|
624 |
global $redux_builder_amp;
|
625 |
+
$optimize = '';
|
626 |
+
$optimize = ampforwp_ad_optimize();
|
627 |
if($redux_builder_amp['enable-amp-ads-3'] == true) {
|
628 |
if($redux_builder_amp['enable-amp-ads-select-3'] == 1) {
|
629 |
$advert_width = '300';
|
649 |
}
|
650 |
$output = '<div class="amp-ad-wrapper">';
|
651 |
$output .= '<amp-ad class="amp-ad-3"
|
652 |
+
type="adsense" '. $optimize .'
|
653 |
width='. $advert_width .' height='. $advert_height . '
|
654 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-3'].'"
|
655 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-3'] .'">';
|
665 |
// add_action('ampforwp_inside_post_content_after','ampforwp_after_post_content_advert');
|
666 |
function ampforwp_after_post_content_advert() {
|
667 |
global $redux_builder_amp;
|
668 |
+
$optimize = '';
|
669 |
+
$optimize = ampforwp_ad_optimize();
|
670 |
if($redux_builder_amp['enable-amp-ads-4'] == true) {
|
671 |
if($redux_builder_amp['enable-amp-ads-select-4'] == 1) {
|
672 |
$advert_width = '300';
|
692 |
}
|
693 |
$output = '<div class="amp-ad-wrapper">';
|
694 |
$output .= '<amp-ad class="amp-ad-4"
|
695 |
+
type="adsense" '. $optimize .'
|
696 |
width='. $advert_width .' height='. $advert_height . '
|
697 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-4'].'"
|
698 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-4'] .'">';
|
709 |
|
710 |
function ampforwp_below_the_title_advert() {
|
711 |
global $redux_builder_amp;
|
712 |
+
$optimize = '';
|
713 |
+
$optimize = ampforwp_ad_optimize();
|
714 |
if($redux_builder_amp['enable-amp-ads-5'] == true) {
|
715 |
if($redux_builder_amp['enable-amp-ads-select-5'] == 1) {
|
716 |
$advert_width = '300';
|
736 |
}
|
737 |
$output = '<div class="amp-ad-wrapper">';
|
738 |
$output .= '<amp-ad class="amp-ad-5"
|
739 |
+
type="adsense" '. $optimize .'
|
740 |
width='. $advert_width .' height='. $advert_height . '
|
741 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-5'].'"
|
742 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-5'] .'">';
|
754 |
|
755 |
function ampforwp_above_related_post_advert() {
|
756 |
global $redux_builder_amp;
|
757 |
+
$optimize = '';
|
758 |
+
$optimize = ampforwp_ad_optimize();
|
759 |
if($redux_builder_amp['enable-amp-ads-6'] == true) {
|
760 |
if($redux_builder_amp['enable-amp-ads-select-6'] == 1) {
|
761 |
$advert_width = '300';
|
781 |
}
|
782 |
$output = '<div class="amp-ad-wrapper">';
|
783 |
$output .= '<amp-ad class="amp-ad-6"
|
784 |
+
type="adsense" '. $optimize .'
|
785 |
width='. $advert_width .' height='. $advert_height . '
|
786 |
data-ad-client="'. $redux_builder_amp['enable-amp-ads-text-feild-client-6'].'"
|
787 |
data-ad-slot="'. $redux_builder_amp['enable-amp-ads-text-feild-slot-6'] .'">';
|
791 |
}
|
792 |
}
|
793 |
|
794 |
+
// Ads Optimize For Viewability
|
795 |
+
if( !function_exists('ampforwp_ad_optimize')){
|
796 |
+
function ampforwp_ad_optimize(){
|
797 |
+
global $redux_builder_amp;
|
798 |
+
$optimized_code = '';
|
799 |
+
if( isset( $redux_builder_amp['ampforwp-ads-data-loading-strategy'] ) && true == $redux_builder_amp['ampforwp-ads-data-loading-strategy']){
|
800 |
+
$optimized_code = 'data-loading-strategy="prefer-viewability-over-views"';
|
801 |
+
}
|
802 |
+
return $optimized_code;
|
803 |
+
}
|
804 |
+
}
|
805 |
// 10. Analytics Area
|
806 |
add_action('amp_post_template_footer','ampforwp_analytics',11);
|
807 |
function ampforwp_analytics() {
|
1036 |
$content = preg_replace('/readability=[^>]*/', '', $content);
|
1037 |
// removing color from span tag
|
1038 |
$content = preg_replace('/<span(.*?)(color=".*?")(.*?)>/', '<span$1$3>', $content);
|
1039 |
+
// removing sl-processed attribute
|
1040 |
+
$content = preg_replace('/(<[^>]+) sl-processed=".*?"/', '$1', $content);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1041 |
|
1042 |
return $content;
|
1043 |
}
|
1056 |
}
|
1057 |
|
1058 |
// 11.5 Strip unwanted codes the_content of Frontpage
|
1059 |
+
// add_action( 'pre_amp_render_post','ampforwp_strip_invalid_content_frontpage');
|
1060 |
function ampforwp_strip_invalid_content_frontpage(){
|
1061 |
if ( is_front_page() || is_home() ) {
|
1062 |
add_filter( 'the_content', 'ampforwp_the_content_filter_frontpage', 20 );
|
1214 |
|
1215 |
$post_types = ampforwp_get_all_post_types();
|
1216 |
|
1217 |
+
$user_level = '';
|
1218 |
+
$user_level = current_user_can( 'manage_options' );
|
1219 |
+
|
1220 |
+
if ( isset( $redux_builder_amp['amp-meta-permissions'] ) && $redux_builder_amp['amp-meta-permissions'] == 'all' ) {
|
1221 |
+
$user_level = true;
|
1222 |
+
}
|
1223 |
+
|
1224 |
+
if ( $post_types && $user_level ) { // If there are any custom public post types.
|
1225 |
|
1226 |
foreach ( $post_types as $post_type ) {
|
1227 |
|
1331 |
global $redux_builder_amp;
|
1332 |
$post_types = ampforwp_get_all_post_types();
|
1333 |
|
1334 |
+
$user_level = '';
|
1335 |
+
$user_level = current_user_can( 'manage_options' );
|
1336 |
+
|
1337 |
+
if ( isset( $redux_builder_amp['amp-meta-permissions'] ) && $redux_builder_amp['amp-meta-permissions'] == 'all' ) {
|
1338 |
+
$user_level = true;
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
if ( $post_types && $user_level ) { // If there are any custom public post types.
|
1342 |
|
1343 |
foreach ( $post_types as $post_type ) {
|
1344 |
|
1627 |
remove_filter('the_content', 'sfsi_social_buttons_below');
|
1628 |
// Removing WordPress Social Share Buttons #1272
|
1629 |
remove_filter ('the_content', 'FTGSB');
|
1630 |
+
// Jannah Theme Lazy Load Compatibility
|
1631 |
+
remove_filter( 'wp_get_attachment_image_attributes', 'jannah_lazyload_image_attributes', 8, 3 );
|
1632 |
}
|
1633 |
|
1634 |
// 22. Removing author links from comments Issue #180
|
3898 |
global $redux_builder_amp;
|
3899 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
3900 |
if( is_plugin_active( 'amp-custom-post-type/amp-custom-post-type.php' ) ) {
|
3901 |
+
if ( isset($redux_builder_amp['ampforwp-custom-type']) && $redux_builder_amp['ampforwp-custom-type'] ) {
|
3902 |
foreach($redux_builder_amp['ampforwp-custom-type'] as $custom_post){
|
3903 |
$supported_types[] = $custom_post;
|
3904 |
}
|
3943 |
|
3944 |
add_action( 'admin_bar_menu', 'ampforwp_visit_amp_in_admin_bar',999 );
|
3945 |
|
3946 |
+
function ampforwp_visit_amp_in_admin_bar($admin_bar) {
|
3947 |
+
$args = array(
|
3948 |
+
'parent' => 'site-name',
|
3949 |
+
'id' => 'view-amp',
|
3950 |
+
'title' => 'Visit AMP',
|
3951 |
+
'href' => ampforwp_url_controller( get_home_url() ),
|
3952 |
+
'meta' => false
|
3953 |
+
);
|
3954 |
+
$admin_bar->add_node( $args );
|
3955 |
}
|
3956 |
|
3957 |
// Things to be added in the Body Tag #1064
|
4428 |
function ampforwp_new_gallery_images($images, $image){
|
4429 |
//Check if the attachment has caption or not
|
4430 |
if(isset($image['caption']) && $image['caption'] != '' ){
|
4431 |
+
add_filter('amp_post_template_data','ampforwp_carousel_bind_script');
|
4432 |
+
add_action('amp_post_template_css', 'ampforwp_additional_style_carousel_caption');
|
4433 |
+
// To enable the carousel magic
|
4434 |
+
add_action('ampforwp_after_header','ampforwp_carousel_class_magic', 999, 1);
|
4435 |
+
add_action('below_the_header_design_1','ampforwp_carousel_class_magic', 999, 1);
|
4436 |
$caption = $image['caption'];
|
|
|
4437 |
// Append the caption with image
|
4438 |
+
return '<figure><div class="ampforwp-gallery-item amp-carousel-container">'. $images . ' </div><figcaption :openbrack:class:closebrack:="expanded? \'expanded\' : \'\'" on="tap:AMP.setState({expanded: !expanded})" tabindex="0" role="button" >'. wp_kses_data( $caption ) . '<span :openbrack:text:closebrack:="expanded ? \'less\' : \'more\'">more</span> </figcaption></figure>';
|
4439 |
}
|
4440 |
else{
|
4441 |
// If there is no caption
|
4442 |
+
return '<div class="ampforwp-gallery-item amp-carousel-container">'. $images . '</div>';
|
4443 |
+
}
|
4444 |
+
}
|
4445 |
+
if( ! function_exists( 'ampforwp_additional_style_carousel_caption' ) ){
|
4446 |
+
function ampforwp_additional_style_carousel_caption(){ ?>
|
4447 |
+
.collapsible-captions {--caption-height: 32px; --image-height: 100%; --caption-padding:1rem; --button-size: 28px; --caption-color: #f5f5f5;; --caption-bg-color: #111;}
|
4448 |
+
.collapsible-captions * {
|
4449 |
+
/* disable chrome touch highlight */
|
4450 |
+
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
|
4451 |
+
box-sizing: border-box;
|
4452 |
+
}
|
4453 |
+
.collapsible-captions .amp-carousel-container {position: relative; width: 100%;}
|
4454 |
+
.collapsible-captions amp-img img {object-fit: contain; }
|
4455 |
+
.collapsible-captions figure { margin: 0; padding: 0; }
|
4456 |
+
/* single line caption */
|
4457 |
+
.collapsible-captions figcaption { position: absolute; bottom: 0;width: 100%;
|
4458 |
+
/* inital height is one line */
|
4459 |
+
max-height: var(--caption-height);
|
4460 |
+
line-height: var(--caption-height);
|
4461 |
+
padding: 0 var(--button-size) 0 5px;
|
4462 |
+
/* cut text after first line and show an ellipsis */
|
4463 |
+
white-space: nowrap;
|
4464 |
+
overflow: hidden;
|
4465 |
+
text-overflow: ellipsis;
|
4466 |
+
/* animate expansion */
|
4467 |
+
transition: max-height 200ms cubic-bezier(0.4, 0, 0.2, 1);
|
4468 |
+
/* overlay the carousel icons */
|
4469 |
+
z-index: 1000;
|
4470 |
+
/* some styling */
|
4471 |
+
color: var(--caption-color);
|
4472 |
+
background: rgba(0, 0, 0, 0.6);
|
4473 |
+
}
|
4474 |
+
/* expanded caption */
|
4475 |
+
.collapsible-captions figcaption.expanded {
|
4476 |
+
/* add padding and show all of the text */
|
4477 |
+
line-height: inherit;
|
4478 |
+
white-space: normal;
|
4479 |
+
text-overflow: auto;
|
4480 |
+
max-height: 100px;
|
4481 |
+
/* show scrollbar in case caption is larger than image */
|
4482 |
+
overflow: auto;
|
4483 |
+
}
|
4484 |
+
/* don't show focus highlights in chrome */
|
4485 |
+
.collapsible-captions figcaption:focus { outline: none; border: none; }
|
4486 |
+
/* the expand/collapse icon */
|
4487 |
+
.collapsible-captions figcaption span { display: block; position: absolute;
|
4488 |
+
top: calc((var(--caption-height) - var(--button-size)) / 2);
|
4489 |
+
right: 2px; width: var(--button-size); height: var(--button-size);
|
4490 |
+
line-height: var(--button-size); text-align: center; font-size: 12px; color: inherit;
|
4491 |
+
cursor: pointer; }
|
4492 |
+
figcaption{ margin-bottom: 20px; }
|
4493 |
+
<?php }
|
4494 |
+
}
|
4495 |
+
// amp-bind for carousel with captions
|
4496 |
+
if( !function_exists('ampforwp_carousel_bind_script')){
|
4497 |
+
function ampforwp_carousel_bind_script($data){
|
4498 |
+
if ( empty( $data['amp_component_scripts']['amp-bind'] ) ) {
|
4499 |
+
$data['amp_component_scripts']['amp-bind'] = 'https://cdn.ampproject.org/v0/amp-bind-0.1.js';
|
4500 |
+
}
|
4501 |
+
return $data;
|
4502 |
+
}
|
4503 |
+
}
|
4504 |
+
if( !function_exists( 'ampforwp_carousel_class_magic' ) ){
|
4505 |
+
function ampforwp_carousel_class_magic($data){
|
4506 |
+
$content = $data->get('post_amp_content');
|
4507 |
+
$content = str_replace(array(':openbrack:',':closebrack:'), array('[',']'), $content);
|
4508 |
+
$data->set('post_amp_content',$content);
|
4509 |
+
return $data;
|
4510 |
}
|
4511 |
}
|
|
|
4512 |
// 86. minify the content of pages
|
4513 |
add_filter('ampforwp_the_content_last_filter','ampforwp_minify_html_output');
|
4514 |
function ampforwp_minify_html_output($content_buffer){
|
4597 |
return true;
|
4598 |
}
|
4599 |
elseif(isset($redux_builder_amp['ampforwp-featured-image-from-content']) && $redux_builder_amp['ampforwp-featured-image-from-content'] == true){
|
4600 |
+
if( ampforwp_get_featured_image_from_content() || ampforwp_get_featured_image_from_content('url') ){
|
4601 |
+
return true;
|
4602 |
+
}
|
4603 |
}
|
4604 |
else
|
4605 |
return false;
|
4820 |
// HTTPS sites
|
4821 |
$onesignal_domain = trailingslashit( esc_url( home_url() ) ) ;
|
4822 |
$onesignal_app_id = $redux_builder_amp['ampforwp-one-signal-app-id'];
|
4823 |
+
$helper_iframe_url = $onesignal_domain .'amp-helper-frame.html?appId=' . $onesignal_app_id;
|
4824 |
|
4825 |
$permission_dialog_url = $onesignal_domain .'amp-permission-dialog.html?appId=' . $onesignal_app_id;
|
4826 |
|
4859 |
layout="fixed"
|
4860 |
src="data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3Vic2NyaWJlLWljb24iIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMS44NCAxOS44ODdIMS4yMnMtLjk0Ny0uMDk0LS45NDctLjk5NWMwLS45LjgwNi0uOTQ4LjgwNi0uOTQ4czMuMTctMS41MTcgMy4xNy0yLjYwOGMwLTEuMDktLjUyLTEuODUtLjUyLTYuMzA1czIuODUtNy44NyA2LjI2LTcuODdjMCAwIC40NzMtMS4xMzQgMS44NS0xLjEzNCAxLjMyNSAwIDEuOCAxLjEzNyAxLjggMS4xMzcgMy40MTMgMCA2LjI2IDMuNDE4IDYuMjYgNy44NyAwIDQuNDYtLjQ3NyA1LjIyLS40NzcgNi4zMSAwIDEuMDkgMy4xNzYgMi42MDcgMy4xNzYgMi42MDdzLjgxLjA0Ni44MS45NDdjMCAuODUzLS45OTYuOTk1LS45OTYuOTk1SDExLjg0ek04IDIwLjk3N2g3LjExcy0uNDkgMi45ODctMy41MyAyLjk4N1M4IDIwLjk3OCA4IDIwLjk3OHoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=">
|
4861 |
</amp-img>
|
4862 |
+
<?php echo ampforwp_translation( $redux_builder_amp['ampforwp-onesignal-translator-subscribe'], 'Subscribe to updates' ); ?>
|
4863 |
</button>
|
4864 |
</amp-web-push-widget>
|
4865 |
<!-- An unsubscription widget -->
|
4866 |
<amp-web-push-widget visibility="subscribed" layout="fixed" width="230" height="45">
|
4867 |
+
<button class="unsubscribe" on="tap:amp-web-push.unsubscribe">
|
4868 |
+
<?php echo ampforwp_translation( $redux_builder_amp['ampforwp-onesignal-translator-unsubscribe'], 'Unsubscribe from updates' ); ?>
|
4869 |
+
</button>
|
4870 |
</amp-web-push-widget>
|
4871 |
<?php }
|
4872 |
}
|
4960 |
$get_blog_details = ampforwp_get_blog_details();
|
4961 |
|
4962 |
return $get_blog_details ;
|
4963 |
+
}
|
4964 |
+
// 97. Change the format of the post date on Loops #1384
|
4965 |
+
add_filter('ampforwp_modify_post_date', 'ampforwp_full_post_date_loops');
|
4966 |
+
if( ! function_exists( 'ampforwp_full_post_date_loops' ) ){
|
4967 |
+
function ampforwp_full_post_date_loops($date){
|
4968 |
+
global $redux_builder_amp;
|
4969 |
+
if(isset($redux_builder_amp['ampforwp-full-post-date']) && true == $redux_builder_amp['ampforwp-full-post-date'] ){
|
4970 |
+
$date = get_the_date();
|
4971 |
+
}
|
4972 |
+
return $date;
|
4973 |
+
}
|
4974 |
+
}
|
4975 |
+
|
4976 |
+
// 98. Create Dynamic url of amp according to the permalink structure #1318
|
4977 |
+
function ampforwp_url_controller($url){
|
4978 |
+
$new_url = "";
|
4979 |
+
$get_permalink_structure = "";
|
4980 |
+
|
4981 |
+
$get_permalink_structure = get_option('permalink_structure');
|
4982 |
+
if ( $get_permalink_structure ) {
|
4983 |
+
$new_url = user_trailingslashit( trailingslashit( $url ) . AMPFORWP_AMP_QUERY_VAR);
|
4984 |
+
} else {
|
4985 |
+
$new_url = add_query_arg( 'amp', '1', $url );
|
4986 |
+
}
|
4987 |
+
|
4988 |
+
return esc_url( $new_url );
|
4989 |
}
|
@@ -258,6 +258,12 @@ function ampforwp_fbia_wrap_elements( $DOMDocument ){
|
|
258 |
return $instant_article_ad_id;
|
259 |
}
|
260 |
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
function get_ia_analytics_code(){
|
262 |
global $redux_builder_amp;
|
263 |
$instant_article_analytics_code = $redux_builder_amp['fb-instant-article-analytics-code'];
|
258 |
return $instant_article_ad_id;
|
259 |
}
|
260 |
|
261 |
+
function get_ia_ad_density(){
|
262 |
+
global $redux_builder_amp;
|
263 |
+
$instant_article_ad_density = $redux_builder_amp['fb-instant-article-ad-density'];
|
264 |
+
return $instant_article_ad_density;
|
265 |
+
}
|
266 |
+
|
267 |
function get_ia_analytics_code(){
|
268 |
global $redux_builder_amp;
|
269 |
$instant_article_analytics_code = $redux_builder_amp['fb-instant-article-analytics-code'];
|
@@ -6,9 +6,9 @@
|
|
6 |
<link rel="canonical" href="<?php the_permalink(); ?>">
|
7 |
<meta property="op:markup_version" content="v1.0">
|
8 |
<?php if (isset($redux_builder_amp['fb-instant-article-ads']) && $redux_builder_amp['fb-instant-article-ads'] ){ ?>
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
</head>
|
13 |
<body>
|
14 |
<article>
|
6 |
<link rel="canonical" href="<?php the_permalink(); ?>">
|
7 |
<meta property="op:markup_version" content="v1.0">
|
8 |
<?php if (isset($redux_builder_amp['fb-instant-article-ads']) && $redux_builder_amp['fb-instant-article-ads'] ){ ?>
|
9 |
+
<!-- automatic ad placement -->
|
10 |
+
<meta property="fb:use_automatic_ad_placement" content="enable=true ad_density=<?php echo get_ia_ad_density(); ?>">
|
11 |
+
<?php } ?>
|
12 |
</head>
|
13 |
<body>
|
14 |
<article>
|
@@ -18,32 +18,28 @@ function ampforwp_structured_data_type( $metadata ){
|
|
18 |
if ( empty( $set_sd_page ) ) {
|
19 |
$set_sd_page = 'BlogPosting';
|
20 |
}
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
$post_types = ampforwp_get_all_post_types();
|
23 |
|
24 |
if ( $post_types ) { // If there are any custom public post types.
|
25 |
foreach ( $post_types as $post_type ) {
|
26 |
-
|
27 |
-
if($post->post_type == 'post'){
|
28 |
-
$metadata['@type'] = $set_sd_post;
|
29 |
-
}
|
30 |
-
|
31 |
-
if($post->post_type == 'page'){
|
32 |
-
$metadata['@type'] = $set_sd_page;
|
33 |
-
}
|
34 |
|
35 |
if( $post->post_type == 'page' || $post->post_type == 'post' ){
|
36 |
continue;
|
37 |
}
|
38 |
-
|
39 |
-
|
40 |
if ( empty( $redux_builder_amp['ampforwp-sd-type-'.$post_type.''] ) ) {
|
41 |
$redux_builder_amp['ampforwp-sd-type-'.$post_type.''] = 'BlogPosting';
|
42 |
}
|
43 |
$metadata['@type'] = $redux_builder_amp['ampforwp-sd-type-'.$post_type.''];
|
44 |
}
|
45 |
-
|
46 |
-
|
47 |
}
|
48 |
}
|
49 |
|
18 |
if ( empty( $set_sd_page ) ) {
|
19 |
$set_sd_page = 'BlogPosting';
|
20 |
}
|
21 |
+
if($post->post_type == 'post'){
|
22 |
+
$metadata['@type'] = $set_sd_post;
|
23 |
+
}
|
24 |
+
|
25 |
+
if($post->post_type == 'page'){
|
26 |
+
$metadata['@type'] = $set_sd_page;
|
27 |
+
}
|
28 |
$post_types = ampforwp_get_all_post_types();
|
29 |
|
30 |
if ( $post_types ) { // If there are any custom public post types.
|
31 |
foreach ( $post_types as $post_type ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
if( $post->post_type == 'page' || $post->post_type == 'post' ){
|
34 |
continue;
|
35 |
}
|
36 |
+
|
37 |
+
if($post->post_type == $post_type){
|
38 |
if ( empty( $redux_builder_amp['ampforwp-sd-type-'.$post_type.''] ) ) {
|
39 |
$redux_builder_amp['ampforwp-sd-type-'.$post_type.''] = 'BlogPosting';
|
40 |
}
|
41 |
$metadata['@type'] = $redux_builder_amp['ampforwp-sd-type-'.$post_type.''];
|
42 |
}
|
|
|
|
|
43 |
}
|
44 |
}
|
45 |
|