Version Description
- May 8, 2016 =
- NEW - Users can now load a custom version of ajax-load-more.css from {/alm} folder in current theme directory.
- NEW - Class definitions for alm shortcode and css enqueue script. More to come.
- FIX - Removed unnecessary ob_end_clean() function from alm_query_posts() that was causing php notices for some users.
- FIX - Fixed meta_query issue with EXISTS and NOT EXISTS meta_compare values.
- FIX - Issue with meta_key parameter and orderby.
- UPDATE - Updated $.fn.almUpdateCurrentPage() function to allow for multiple instances of Paging.
- UPDATE - Various Admin UI bug fixes/enhancements.
Download this release
Release Info
Developer | dcooney |
Plugin | WordPress Infinite Scroll – Ajax Load More |
Version | 2.10.1 |
Comparing to | |
See all releases |
Code changes from version 2.10.0.1 to 2.10.1
- README.txt +15 -4
- admin/admin.php +66 -59
- admin/css/admin.css +6 -3
- admin/includes/cta/dyk.php +8 -1
- admin/views/repeater-templates.php +2 -2
- ajax-load-more.php +95 -673
- core/classes/class.alm-enqueue.php +62 -0
- core/classes/class.alm-shortcode.php +650 -0
- core/functions.php +20 -9
- core/js/ajax-load-more.js +19 -19
- core/js/ajax-load-more.min.js +95 -1428
- lang/ajax-load-more.pot +50 -50
README.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: dcooney
|
|
3 |
Donate link: https://connekthq.com/donate/
|
4 |
Tags: infinite scroll, scroll, infinite, lazy load, lazy loading, pagination, ajax pagination, ajax, ajax posts, ajax load posts, loop, query, dynamic, shortcode builder, wp_query, search, tags, category, post types, taxonomy, meta_query, archives, date, infinite scrolling, woocommerce
|
5 |
Requires at least: 3.6
|
6 |
-
Tested up to: 4.5
|
7 |
-
Stable tag: 2.10.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -326,11 +326,22 @@ How to install Ajax Load More.
|
|
326 |
|
327 |
== Changelog ==
|
328 |
|
329 |
-
= 2.10.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
* FIX - JavaScript fix for 'Unexpected token' error is Safari and IE with alm.AjaxLoadMore.success() function.
|
331 |
* FIX - Fixed canonical URL issue on home/front pages.
|
332 |
|
333 |
-
|
|
|
334 |
* NEW - Converted the Ajax return content type from HTML to JSON.
|
335 |
* NEW - Adding transition_speed shortcode parameter.
|
336 |
* NEW - Added alm_button_label filter to modify default button text.
|
3 |
Donate link: https://connekthq.com/donate/
|
4 |
Tags: infinite scroll, scroll, infinite, lazy load, lazy loading, pagination, ajax pagination, ajax, ajax posts, ajax load posts, loop, query, dynamic, shortcode builder, wp_query, search, tags, category, post types, taxonomy, meta_query, archives, date, infinite scrolling, woocommerce
|
5 |
Requires at least: 3.6
|
6 |
+
Tested up to: 4.5.2
|
7 |
+
Stable tag: 2.10.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
326 |
|
327 |
== Changelog ==
|
328 |
|
329 |
+
= 2.10.1 - May 8, 2016 =
|
330 |
+
* NEW - Users can now load a custom version of ajax-load-more.css from {/alm} folder in current theme directory.
|
331 |
+
* NEW - Class definitions for alm shortcode and css enqueue script. More to come.
|
332 |
+
* FIX - Removed unnecessary ob_end_clean() function from alm_query_posts() that was causing php notices for some users.
|
333 |
+
* FIX - Fixed meta_query issue with EXISTS and NOT EXISTS meta_compare values.
|
334 |
+
* FIX - Issue with meta_key parameter and orderby.
|
335 |
+
* UPDATE - Updated $.fn.almUpdateCurrentPage() function to allow for multiple instances of Paging.
|
336 |
+
* UPDATE - Various Admin UI bug fixes/enhancements.
|
337 |
+
|
338 |
+
|
339 |
+
= 2.10.0.1 - April 11, 2016 =
|
340 |
* FIX - JavaScript fix for 'Unexpected token' error is Safari and IE with alm.AjaxLoadMore.success() function.
|
341 |
* FIX - Fixed canonical URL issue on home/front pages.
|
342 |
|
343 |
+
|
344 |
+
= 2.10.0 - April 10, 2016 =
|
345 |
* NEW - Converted the Ajax return content type from HTML to JSON.
|
346 |
* NEW - Adding transition_speed shortcode parameter.
|
347 |
* NEW - Added alm_button_label filter to modify default button text.
|
admin/admin.php
CHANGED
@@ -21,70 +21,76 @@ add_action( 'wp_ajax_alm_layouts_get', 'alm_layouts_get' ); // Get layout
|
|
21 |
|
22 |
function alm_license_activation(){
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
if($type === 'activate'){
|
39 |
-
$action = 'activate_license';
|
40 |
-
}else{
|
41 |
-
$action = 'deactivate_license';
|
42 |
-
}
|
43 |
-
|
44 |
-
$api_params = array(
|
45 |
-
'edd_action'=> $action,
|
46 |
-
'license' => $license,
|
47 |
-
'item_id' => $item, // the ID of our product in EDD
|
48 |
-
'url' => home_url()
|
49 |
-
);
|
50 |
-
|
51 |
-
// Call the custom API.
|
52 |
-
//$response = wp_remote_get( add_query_arg( $api_params, $url ), array( 'timeout' => 15, 'sslverify' => false ) );
|
53 |
-
|
54 |
-
// Updated 2.8.7
|
55 |
-
$response = wp_remote_post( ALM_STORE_URL, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
|
56 |
-
|
57 |
-
// make sure the response came back okay
|
58 |
-
if ( is_wp_error( $response ) )
|
59 |
-
return false;
|
60 |
-
|
61 |
-
|
62 |
-
$license_data = $response['body'];
|
63 |
-
$license_data = json_decode($license_data); // decode the license data
|
64 |
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
$return["msg"] = $msg;
|
81 |
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
-
|
|
|
|
|
88 |
}
|
89 |
|
90 |
|
@@ -155,6 +161,7 @@ function alm_admin_vars() { ?>
|
|
155 |
<?php }
|
156 |
|
157 |
|
|
|
158 |
/*
|
159 |
* alm_set_admin_nonce
|
160 |
* Create admin nonce on Repeater Template page only
|
21 |
|
22 |
function alm_license_activation(){
|
23 |
|
24 |
+
if (current_user_can( 'edit_theme_options' )){
|
25 |
+
|
26 |
+
$nonce = $_GET["nonce"];
|
27 |
+
$type = $_GET["type"]; // activate / deactivate
|
28 |
+
$item = $_GET["item"];
|
29 |
+
$license = $_GET["license"];
|
30 |
+
$url = $_GET["url"];
|
31 |
+
$upgrade = $_GET["upgrade"];
|
32 |
+
$option_status = $_GET["status"];
|
33 |
+
$option_key = $_GET["key"];
|
34 |
+
|
35 |
+
// Check our nonce, if they don't match then bounce!
|
36 |
+
if (! wp_verify_nonce( $nonce, 'alm_repeater_nonce' ))
|
37 |
+
die('Error - unable to verify nonce, please try again.');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
+
// data to send in our API request
|
40 |
+
if($type === 'activate'){
|
41 |
+
$action = 'activate_license';
|
42 |
+
}else{
|
43 |
+
$action = 'deactivate_license';
|
44 |
+
}
|
45 |
|
46 |
+
$api_params = array(
|
47 |
+
'edd_action'=> $action,
|
48 |
+
'license' => $license,
|
49 |
+
'item_id' => $item, // the ID of our product in EDD
|
50 |
+
'url' => home_url()
|
51 |
+
);
|
52 |
+
|
53 |
+
// Call the custom API.
|
54 |
+
//$response = wp_remote_get( add_query_arg( $api_params, $url ), array( 'timeout' => 15, 'sslverify' => false ) );
|
55 |
+
|
56 |
+
// Updated 2.8.7
|
57 |
+
$response = wp_remote_post( ALM_STORE_URL, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
|
|
|
58 |
|
59 |
+
// make sure the response came back okay
|
60 |
+
if ( is_wp_error( $response ) )
|
61 |
+
return false;
|
62 |
+
|
63 |
+
|
64 |
+
$license_data = $response['body'];
|
65 |
+
$license_data = json_decode($license_data); // decode the license data
|
66 |
+
|
67 |
|
68 |
+
$return["success"] = $license_data->success;
|
69 |
+
|
70 |
+
$msg = '';
|
71 |
+
if($type === 'activate'){
|
72 |
+
$return["license_limit"] = $license_data->license_limit;
|
73 |
+
$return["expires"] = $license_data->expires;
|
74 |
+
$return["site_count"] = $license_data->site_count;
|
75 |
+
$return["activations_left"] = $license_data->activations_left;
|
76 |
+
$return["license"] = $license_data->license;
|
77 |
+
$return["item_name"] = $license_data->item_name;
|
78 |
+
if($license_data->activations_left === 0 && $license_data->success === false){
|
79 |
+
$msg = '<strong>Sorry, but you are out of available licenses <em>('. $license_data->license_limit .' / '. $license_data->site_count .')</em>.</strong> Please visit the <a href="'.$upgrade.'" target="_blank">'.$license_data->item_name.'</a> page to add additional licenses.';
|
80 |
+
}
|
81 |
+
}
|
82 |
+
$return["msg"] = $msg;
|
83 |
+
|
84 |
+
update_option( $option_status, $license_data->license);
|
85 |
+
update_option( $option_key, $license );
|
86 |
+
|
87 |
+
echo json_encode($return);
|
88 |
+
|
89 |
+
die();
|
90 |
|
91 |
+
} else {
|
92 |
+
echo __('You don\'t belong here.', ALM_NAME);
|
93 |
+
}
|
94 |
}
|
95 |
|
96 |
|
161 |
<?php }
|
162 |
|
163 |
|
164 |
+
|
165 |
/*
|
166 |
* alm_set_admin_nonce
|
167 |
* Create admin nonce on Repeater Template page only
|
admin/css/admin.css
CHANGED
@@ -668,6 +668,9 @@ a.layout-hover{
|
|
668 |
.ajax-load-more .repeaters input[type=text]{
|
669 |
padding: 9px 10px;
|
670 |
}
|
|
|
|
|
|
|
671 |
|
672 |
.ajax-load-more input.disabled-input{
|
673 |
opacity: 0.5;
|
@@ -2106,18 +2109,18 @@ table.highlight{
|
|
2106 |
text-align: center;
|
2107 |
margin: 15px 0 0 !important;
|
2108 |
display: block;
|
2109 |
-
font-size:
|
2110 |
font-weight: 700;
|
2111 |
text-transform: none !important;
|
2112 |
text-align: center;
|
2113 |
-
/* text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1); */
|
2114 |
}
|
2115 |
.alm-add-template a{
|
2116 |
background: #efefef;
|
2117 |
border: 1px solid #e1e1e1;
|
2118 |
color: #333;
|
2119 |
display: inline-block;
|
2120 |
-
padding:
|
|
|
2121 |
-webkit-border-radius: 3px;
|
2122 |
-moz-border-radius: 3px;
|
2123 |
border-radius: 3px;
|
668 |
.ajax-load-more .repeaters input[type=text]{
|
669 |
padding: 9px 10px;
|
670 |
}
|
671 |
+
.ajax-load-more input[type=number]{
|
672 |
+
height: auto;
|
673 |
+
}
|
674 |
|
675 |
.ajax-load-more input.disabled-input{
|
676 |
opacity: 0.5;
|
2109 |
text-align: center;
|
2110 |
margin: 15px 0 0 !important;
|
2111 |
display: block;
|
2112 |
+
font-size: 15px !important;
|
2113 |
font-weight: 700;
|
2114 |
text-transform: none !important;
|
2115 |
text-align: center;
|
|
|
2116 |
}
|
2117 |
.alm-add-template a{
|
2118 |
background: #efefef;
|
2119 |
border: 1px solid #e1e1e1;
|
2120 |
color: #333;
|
2121 |
display: inline-block;
|
2122 |
+
padding: 11px 16px 13px;
|
2123 |
+
line-height: 1;
|
2124 |
-webkit-border-radius: 3px;
|
2125 |
-moz-border-radius: 3px;
|
2126 |
border-radius: 3px;
|
admin/includes/cta/dyk.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<div class="cta dyk">
|
2 |
<h3><?php _e('Did you know?', 'ajax-load-more'); ?></h3>
|
3 |
<?php
|
4 |
-
$random = rand(1,
|
5 |
?>
|
6 |
<?php if($random == 1){ ?>
|
7 |
<img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/shortcode-editor.jpg"><br/>
|
@@ -23,4 +23,11 @@
|
|
23 |
<p><a target="blank" style="font-weight: 700;" href="https://connekthq.com/plugins/ajax-load-more/add-ons/previous-post/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=PreviousPost">Learn More »</a></p>
|
24 |
<?php } ?>
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
</div>
|
1 |
<div class="cta dyk">
|
2 |
<h3><?php _e('Did you know?', 'ajax-load-more'); ?></h3>
|
3 |
<?php
|
4 |
+
$random = rand(1, 4);
|
5 |
?>
|
6 |
<?php if($random == 1){ ?>
|
7 |
<img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/shortcode-editor.jpg"><br/>
|
23 |
<p><a target="blank" style="font-weight: 700;" href="https://connekthq.com/plugins/ajax-load-more/add-ons/previous-post/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=PreviousPost">Learn More »</a></p>
|
24 |
<?php } ?>
|
25 |
|
26 |
+
<?php if($random == 4){ ?>
|
27 |
+
<img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/comments-add-on.jpg"><br/>
|
28 |
+
<p class="addon-intro">You can lazy load your comments with Ajax Load More!</p>
|
29 |
+
<p>The <a target="blank" style="font-weight: 700;" href="https://connekthq.com/plugins/ajax-load-more/add-ons/comments/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=COmments">Comments</a> add-on will load and display blog comments using the core Ajax Load More infinite scroll functionality.</p>
|
30 |
+
<p><a target="blank" style="font-weight: 700;" href="https://connekthq.com/plugins/ajax-load-more/add-ons/comments/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=COmments">Learn More »</a></p>
|
31 |
+
<?php } ?>
|
32 |
+
|
33 |
</div>
|
admin/views/repeater-templates.php
CHANGED
@@ -247,8 +247,7 @@
|
|
247 |
</div>
|
248 |
|
249 |
<div class="cnkt-sidebar">
|
250 |
-
|
251 |
-
<div class="cta">
|
252 |
<h3><?php _e('Templating Help', 'ajax-load-more'); ?></h3>
|
253 |
<div class="item">
|
254 |
<p><strong><?php _e('What is a repeater template?', 'ajax-load-more'); ?></strong></p>
|
@@ -265,6 +264,7 @@
|
|
265 |
</ul>
|
266 |
</div>
|
267 |
</div>
|
|
|
268 |
</div>
|
269 |
|
270 |
</div>
|
247 |
</div>
|
248 |
|
249 |
<div class="cnkt-sidebar">
|
250 |
+
<div class="cta">
|
|
|
251 |
<h3><?php _e('Templating Help', 'ajax-load-more'); ?></h3>
|
252 |
<div class="item">
|
253 |
<p><strong><?php _e('What is a repeater template?', 'ajax-load-more'); ?></strong></p>
|
264 |
</ul>
|
265 |
</div>
|
266 |
</div>
|
267 |
+
<?php include_once( ALM_PATH . 'admin/includes/cta/writeable.php'); ?>
|
268 |
</div>
|
269 |
|
270 |
</div>
|
ajax-load-more.php
CHANGED
@@ -2,51 +2,21 @@
|
|
2 |
/*
|
3 |
Plugin Name: Ajax Load More
|
4 |
Plugin URI: http://connekthq.com/plugins/ajax-load-more
|
5 |
-
Description:
|
6 |
Text Domain: ajax-load-more
|
7 |
Author: Darren Cooney
|
8 |
Twitter: @KaptonKaos
|
9 |
Author URI: http://connekthq.com
|
10 |
-
Version: 2.10.
|
11 |
License: GPL
|
12 |
Copyright: Darren Cooney & Connekt Media
|
13 |
-
|
14 |
*/
|
15 |
|
16 |
-
|
17 |
-
define('ALM_VERSION', '2.10.
|
18 |
-
define('ALM_RELEASE', '
|
19 |
-
define('ALM_STORE_URL', 'https://connekthq.com');
|
20 |
-
|
21 |
-
if (!defined('ALM_ALTERNATING_ITEM_NAME'))
|
22 |
-
define('ALM_ALTERNATING_ITEM_NAME', '14456' );
|
23 |
-
|
24 |
-
if (!defined('ALM_CACHE_ITEM_NAME'))
|
25 |
-
define('ALM_CACHE_ITEM_NAME', '4878' );
|
26 |
-
|
27 |
-
if (!defined('ALM_COMMENTS_ITEM_NAME'))
|
28 |
-
define('ALM_COMMENTS_ITEM_NAME', '12172' );
|
29 |
-
|
30 |
-
if (!defined('ALM_UNLIMITED_ITEM_NAME'))
|
31 |
-
define('ALM_UNLIMITED_ITEM_NAME', '3118' );
|
32 |
-
|
33 |
-
if (!defined('ALM_LAYOUTS_ITEM_NAME'))
|
34 |
-
define('ALM_LAYOUTS_ITEM_NAME', '11398' );
|
35 |
-
|
36 |
-
if (!defined('ALM_PAGING_ITEM_NAME'))
|
37 |
-
define('ALM_PAGING_ITEM_NAME', '6898' );
|
38 |
-
|
39 |
-
if (!defined('ALM_PRELOADED_ITEM_NAME'))
|
40 |
-
define('ALM_PRELOADED_ITEM_NAME', '4293' );
|
41 |
-
|
42 |
-
if (!defined('ALM_PREV_POST_ITEM_NAME'))
|
43 |
-
define('ALM_PREV_POST_ITEM_NAME', '9686');
|
44 |
-
|
45 |
-
if (!defined('ALM_SEO_ITEM_NAME'))
|
46 |
-
define('ALM_SEO_ITEM_NAME', '3482');
|
47 |
|
48 |
-
if (!defined('ALM_THEME_REPEATERS_ITEM_NAME'))
|
49 |
-
define('ALM_THEME_REPEATERS_ITEM_NAME', '8860');
|
50 |
|
51 |
|
52 |
/*
|
@@ -80,7 +50,15 @@ function alm_install($network_wide) {
|
|
80 |
register_activation_hook( __FILE__, 'alm_install' );
|
81 |
add_action( 'wpmu_new_blog', 'alm_install' );
|
82 |
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
function alm_create_table(){
|
85 |
|
86 |
global $wpdb;
|
@@ -129,19 +107,14 @@ function alm_create_table(){
|
|
129 |
}
|
130 |
|
131 |
|
132 |
-
|
133 |
if( !class_exists('AjaxLoadMore') ):
|
|
|
134 |
class AjaxLoadMore {
|
135 |
-
|
136 |
-
public $counter = 0;
|
137 |
|
138 |
function __construct(){
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
define('ALM_ADMIN_URL', plugins_url('admin/', __FILE__));
|
143 |
-
define('ALM_NAME', '_ajax_load_more');
|
144 |
-
define('ALM_TITLE', 'Ajax Load More');
|
145 |
|
146 |
add_action( 'wp_ajax_alm_query_posts', array(&$this, 'alm_query_posts') );
|
147 |
add_action( 'wp_ajax_nopriv_alm_query_posts', array(&$this, 'alm_query_posts') );
|
@@ -151,33 +124,62 @@ if( !class_exists('AjaxLoadMore') ):
|
|
151 |
add_action( 'after_setup_theme', array(&$this, 'alm_image_sizes') );
|
152 |
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'alm_action_links') );
|
153 |
add_filter( 'plugin_row_meta', array(&$this, 'alm_plugin_meta_links'), 10, 2 );
|
154 |
-
add_shortcode( 'ajax_load_more', array(&$this, 'alm_shortcode') );
|
155 |
-
|
156 |
-
|
157 |
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
|
168 |
/*
|
169 |
-
*
|
170 |
* Load these files before the theme loads
|
171 |
*
|
172 |
* @since 2.0.0
|
173 |
*/
|
174 |
|
175 |
-
function
|
176 |
-
|
|
|
|
|
|
|
|
|
|
|
177 |
include_once('admin/editor/editor.php');
|
178 |
include_once('admin/admin.php');
|
179 |
-
}
|
180 |
-
|
|
|
181 |
|
182 |
|
183 |
|
@@ -188,7 +190,7 @@ if( !class_exists('AjaxLoadMore') ):
|
|
188 |
* @since 2.2.3
|
189 |
*/
|
190 |
|
191 |
-
function alm_action_links( $links ) {
|
192 |
$links[] = '<a href="'. get_admin_url(null, 'admin.php?page=ajax-load-more') .'">'.__('Settings', 'ajax-load-more').'</a>';
|
193 |
return $links;
|
194 |
}
|
@@ -202,7 +204,7 @@ if( !class_exists('AjaxLoadMore') ):
|
|
202 |
* @since 2.7.2.1
|
203 |
*/
|
204 |
|
205 |
-
function alm_plugin_meta_links( $links, $file ) {
|
206 |
if ( strpos( $file, 'ajax-load-more.php' ) !== false ) {
|
207 |
$new_links = array(
|
208 |
'<a href="admin.php?page=ajax-load-more-shortcode-builder">Shortcode Builder</a>',
|
@@ -218,13 +220,13 @@ if( !class_exists('AjaxLoadMore') ):
|
|
218 |
|
219 |
|
220 |
/*
|
221 |
-
*
|
222 |
-
* Add
|
223 |
*
|
224 |
* @since 2.8.3
|
225 |
*/
|
226 |
|
227 |
-
function alm_image_sizes(){
|
228 |
add_image_size( 'alm-thumbnail', 150, 150, true); // Custom ALM thumbnail size
|
229 |
}
|
230 |
|
@@ -237,19 +239,23 @@ if( !class_exists('AjaxLoadMore') ):
|
|
237 |
* @since 2.0.0
|
238 |
*/
|
239 |
|
240 |
-
function alm_enqueue_scripts(){
|
241 |
$options = get_option( 'alm_settings' );
|
242 |
|
243 |
-
// Load JS
|
244 |
-
|
245 |
//wp_register_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.js', __FILE__ ), array('jquery'), ALM_VERSION, true );
|
246 |
-
wp_register_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.min.js', __FILE__ ), array('jquery'), ALM_VERSION, true );
|
247 |
-
|
248 |
|
249 |
-
// Load CSS
|
250 |
-
if(!isset($options['_alm_disable_css']) || $options['_alm_disable_css'] != '1'){
|
251 |
-
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
253 |
}
|
254 |
|
255 |
// Prevent loading of unnessasry posts - move user to top of page
|
@@ -261,8 +267,7 @@ if( !class_exists('AjaxLoadMore') ):
|
|
261 |
}
|
262 |
|
263 |
wp_localize_script(
|
264 |
-
'ajax-load-more',
|
265 |
-
'alm_localize',
|
266 |
array(
|
267 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
268 |
'alm_nonce' => wp_create_nonce( "ajax_load_more_nonce" ),
|
@@ -282,595 +287,10 @@ if( !class_exists('AjaxLoadMore') ):
|
|
282 |
* @since 2.0.0
|
283 |
*/
|
284 |
|
285 |
-
function alm_shortcode($atts) {
|
286 |
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
$slug = '';
|
291 |
-
if(!is_archive()){
|
292 |
-
// If not an archive page, set the post slug
|
293 |
-
$slug = $post->post_name;
|
294 |
-
}
|
295 |
-
|
296 |
-
$this->counter++; // Shotcode counter
|
297 |
-
|
298 |
-
// Custom CSS for Layouts
|
299 |
-
if(has_action('alm_layouts_custom_css')){
|
300 |
-
do_action('alm_layouts_custom_css', $this->counter);
|
301 |
-
}
|
302 |
-
|
303 |
-
extract(shortcode_atts(array(
|
304 |
-
'comments' => false,
|
305 |
-
'comments_per_page' => '5',
|
306 |
-
'comments_type' => 'comment',
|
307 |
-
'comments_style' => 'ol',
|
308 |
-
'comments_template' => 'none',
|
309 |
-
'comments_callback' => '',
|
310 |
-
'comments_post_id' => 'null',
|
311 |
-
'previous_post' => false,
|
312 |
-
'previous_post_id' => 'null',
|
313 |
-
'previous_post_taxonomy' => '',
|
314 |
-
'cache' => 'false',
|
315 |
-
'cache_id' => '',
|
316 |
-
'paging' => 'false',
|
317 |
-
'paging_controls' => 'false',
|
318 |
-
'paging_show_at_most' => '7',
|
319 |
-
'paging_classes' => '',
|
320 |
-
'preloaded' => 'false',
|
321 |
-
'preloaded_amount' => '5',
|
322 |
-
'seo' => 'false',
|
323 |
-
'repeater' => 'default',
|
324 |
-
'theme_repeater' => 'null',
|
325 |
-
'alternate' => false,
|
326 |
-
'alternate_sequence' => '',
|
327 |
-
'alternate_sequence_max' => '0',
|
328 |
-
'alternate_repeater' => 'null',
|
329 |
-
'alternate_theme_repeater' => 'null',
|
330 |
-
'post_type' => 'post',
|
331 |
-
'post_format' => '',
|
332 |
-
'category' => '',
|
333 |
-
'category__not_in' => '',
|
334 |
-
'tag' => '',
|
335 |
-
'tag__not_in' => '',
|
336 |
-
'taxonomy' => '',
|
337 |
-
'taxonomy_terms' => '',
|
338 |
-
'taxonomy_operator' => '',
|
339 |
-
'taxonomy_relation' => '',
|
340 |
-
'meta_key' => '',
|
341 |
-
'meta_value' => '',
|
342 |
-
'meta_compare' => '',
|
343 |
-
'meta_relation' => '',
|
344 |
-
'meta_type' => '',
|
345 |
-
'year' => '',
|
346 |
-
'month' => '',
|
347 |
-
'day' => '',
|
348 |
-
'author' => '',
|
349 |
-
'search' => '',
|
350 |
-
'custom_args' => '',
|
351 |
-
'post_status' => '',
|
352 |
-
'order' => 'DESC',
|
353 |
-
'orderby' => 'date',
|
354 |
-
'post__in' => '',
|
355 |
-
'post__not_in' => '',
|
356 |
-
'exclude' => '',
|
357 |
-
'offset' => '0',
|
358 |
-
'posts_per_page' => '5',
|
359 |
-
'scroll' => 'true',
|
360 |
-
'scroll_distance' => '150',
|
361 |
-
'max_pages' => '5',
|
362 |
-
'pause_override' => 'false',
|
363 |
-
'pause' => 'false',
|
364 |
-
'destroy_after' => '',
|
365 |
-
'transition' => 'slide',
|
366 |
-
'transition_speed' => '250',
|
367 |
-
'transition_container' => 'true',
|
368 |
-
'images_loaded' => 'false',
|
369 |
-
'button_label' => apply_filters('alm_button_label', __('Older Posts', 'ajax-load-more')),
|
370 |
-
'button_loading_label' => '',
|
371 |
-
'container_type' => '',
|
372 |
-
'css_classes' => '',
|
373 |
-
), $atts));
|
374 |
-
|
375 |
-
|
376 |
-
// Enqueue core Ajax Load More JS
|
377 |
-
wp_enqueue_script( 'ajax-load-more' );
|
378 |
-
|
379 |
-
|
380 |
-
// Enqueue add-on JS
|
381 |
-
if(has_action('alm_seo_installed') && $seo === 'true'){
|
382 |
-
wp_enqueue_script( 'ajax-load-more-seo' );
|
383 |
-
}
|
384 |
-
if(has_action('alm_paging_installed') && $paging === 'true'){
|
385 |
-
wp_enqueue_script( 'ajax-load-more-paging' );
|
386 |
-
}
|
387 |
-
if(has_action('alm_prev_post_installed') && $previous_post === 'true'){
|
388 |
-
wp_enqueue_script( 'ajax-load-more-previous-post' );
|
389 |
-
}
|
390 |
-
if(has_action('alm_layouts_installed')){
|
391 |
-
wp_enqueue_script( 'ajax-load-more-layouts' );
|
392 |
-
}
|
393 |
-
|
394 |
-
if($previous_post === 'true')
|
395 |
-
$previous_post === true;
|
396 |
-
|
397 |
-
if($seo === "true" || $previous_post)
|
398 |
-
$transition_container = "true";
|
399 |
-
|
400 |
-
|
401 |
-
// Get container elements (ul | div)
|
402 |
-
|
403 |
-
$container_element = 'ul';
|
404 |
-
if($options['_alm_container_type'] == '2' || $previous_post)
|
405 |
-
$container_element = 'div';
|
406 |
-
|
407 |
-
// override shortcode param
|
408 |
-
if($container_type){
|
409 |
-
$container_element = $container_type;
|
410 |
-
}
|
411 |
-
|
412 |
-
// Previous post override
|
413 |
-
if($previous_post){
|
414 |
-
$posts_per_page = 1;
|
415 |
-
$container_element = 'div';
|
416 |
-
}
|
417 |
-
|
418 |
-
// Comments
|
419 |
-
if($comments === 'true'){
|
420 |
-
$container_element = $comments_style;
|
421 |
-
}
|
422 |
-
|
423 |
-
// Get extra classnames
|
424 |
-
$classname = '';
|
425 |
-
if(isset($options['_alm_classname']))
|
426 |
-
$classname = ' '.$options['_alm_classname'];
|
427 |
-
|
428 |
-
// Get button color
|
429 |
-
$btn_color = '';
|
430 |
-
if(isset($options['_alm_btn_color']))
|
431 |
-
$btn_color = ' '.$options['_alm_btn_color'];
|
432 |
-
|
433 |
-
// Get paging color
|
434 |
-
$paging_color = '';
|
435 |
-
if(isset($options['_alm_paging_color']) && has_action('alm_paging_installed'))
|
436 |
-
$paging_color = ' paging-'.$options['_alm_paging_color'];
|
437 |
-
|
438 |
-
// Get Layouts activated
|
439 |
-
$alm_layouts = '';
|
440 |
-
if(has_action('alm_layouts_installed'))
|
441 |
-
$alm_layouts = ' alm-layouts';
|
442 |
-
|
443 |
-
// Get btn classnames
|
444 |
-
$button_classname = '';
|
445 |
-
if(isset($options['_alm_btn_classname']))
|
446 |
-
$button_classname = $options['_alm_btn_classname'];
|
447 |
-
|
448 |
-
|
449 |
-
// Language support
|
450 |
-
$lang = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : ''; // WPML - http://wpml.org
|
451 |
-
if (function_exists('pll_current_language')) // Polylang - https://wordpress.org/plugins/polylang/
|
452 |
-
$lang = pll_current_language();
|
453 |
-
if (function_exists('qtrans_getLanguage')) // qTranslate - https://wordpress.org/plugins/qtranslate/
|
454 |
-
$lang = qtrans_getLanguage();
|
455 |
-
|
456 |
-
$wp_posts_per_page = get_option( 'posts_per_page' ); // Posts per page - settings -> reading
|
457 |
-
|
458 |
-
/* If $wp_posts_per_page > than shortcode value then $posts_per_page to $wp_posts_per_page */
|
459 |
-
if(has_action('alm_seo_installed') && $wp_posts_per_page > $posts_per_page && $seo === 'true')
|
460 |
-
$posts_per_page = $wp_posts_per_page;
|
461 |
-
|
462 |
-
$paging_container_class = '';
|
463 |
-
if($paging === 'true'){
|
464 |
-
$paging_container_class = ' alm-paging-wrap';
|
465 |
-
$preloaded = "false";
|
466 |
-
}
|
467 |
-
|
468 |
-
// Start ALM object
|
469 |
-
$ajaxloadmore = '';
|
470 |
-
|
471 |
-
$ajaxloadmore .= apply_filters('alm_before_container', ''); // ALM Core Filter Hook
|
472 |
-
|
473 |
-
// Build canonical URL
|
474 |
-
// - Check the page/post type and then get the correct base url for the page.
|
475 |
-
|
476 |
-
// Date
|
477 |
-
if(is_date()){
|
478 |
-
// Is archive page
|
479 |
-
$archive_year = get_the_date('Y');
|
480 |
-
$archive_month = get_the_date('m');
|
481 |
-
$archive_day = get_the_date('d');
|
482 |
-
if(is_year()){
|
483 |
-
$canonicalURL = get_year_link( $archive_year );
|
484 |
-
}
|
485 |
-
if(is_month()){
|
486 |
-
$canonicalURL = get_month_link( $archive_year, $archive_month );
|
487 |
-
}
|
488 |
-
if(is_day()){
|
489 |
-
$canonicalURL = get_month_link( $archive_year, $archive_month, $archive_day );
|
490 |
-
}
|
491 |
-
}
|
492 |
-
// Frontpage
|
493 |
-
elseif(is_front_page() || is_home()){
|
494 |
-
$canonicalURL = get_home_url().'/';
|
495 |
-
}
|
496 |
-
// Category
|
497 |
-
elseif(is_category()){
|
498 |
-
$cur_cat_id = get_cat_id( single_cat_title('',false) );
|
499 |
-
$canonicalURL = get_category_link($cur_cat_id);
|
500 |
-
}
|
501 |
-
// Tag
|
502 |
-
elseif(is_tag()){
|
503 |
-
$cur_tag_id = get_query_var('tag_id');
|
504 |
-
$canonicalURL = get_tag_link($cur_tag_id);
|
505 |
-
}
|
506 |
-
// Author
|
507 |
-
elseif(is_author()){
|
508 |
-
$author_id = get_the_author_meta('ID');
|
509 |
-
$canonicalURL = get_author_posts_url($author_id);
|
510 |
-
}
|
511 |
-
// Taxonomy
|
512 |
-
elseif(is_tax()){
|
513 |
-
$tax_term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy' ));
|
514 |
-
$tax_id = $tax_term->term_id;
|
515 |
-
$canonicalURL = get_term_link($tax_id);
|
516 |
-
}
|
517 |
-
// post_type
|
518 |
-
elseif(is_post_type_archive()){
|
519 |
-
$post_type_archive = get_post_type();
|
520 |
-
$canonicalURL = get_post_type_archive_link($post_type_archive);
|
521 |
-
}
|
522 |
-
else{
|
523 |
-
$canonicalURL = get_permalink();
|
524 |
-
}
|
525 |
-
// End build canonical URL
|
526 |
-
|
527 |
-
|
528 |
-
// ALM Wrapper
|
529 |
-
$ajaxloadmore .= '<div id="ajax-load-more" class="ajax-load-more-wrap'. $btn_color .''. $paging_color .''. $alm_layouts .'" data-id="" data-canonical-url="'. $canonicalURL .'" data-slug="'. $slug .'">';
|
530 |
-
|
531 |
-
|
532 |
-
// Previous Post
|
533 |
-
// - Set other add-on params to false
|
534 |
-
if($previous_post){
|
535 |
-
$preloaded = false;
|
536 |
-
$seo = false;
|
537 |
-
$paging = false;
|
538 |
-
$cache = false;
|
539 |
-
$comments = false;
|
540 |
-
}
|
541 |
-
|
542 |
-
// Comments
|
543 |
-
// - Set other add-on params to false
|
544 |
-
if($comments){
|
545 |
-
$previous_post = false;
|
546 |
-
$preloaded = false;
|
547 |
-
$seo = false;
|
548 |
-
$paging = false;
|
549 |
-
$cache = false;
|
550 |
-
}
|
551 |
-
|
552 |
-
|
553 |
-
// ********************************
|
554 |
-
// Preloaded Add-on
|
555 |
-
// Retreive preloaded posts and append to ajax load more object
|
556 |
-
if(has_action('alm_preload_installed') && $preloaded === 'true'){
|
557 |
-
|
558 |
-
$preload_offset = $offset;
|
559 |
-
|
560 |
-
// If SEO, set $preloaded_amount to $posts_per_page
|
561 |
-
if(has_action('alm_seo_installed') && $seo === 'true'){
|
562 |
-
$preloaded_amount = $posts_per_page;
|
563 |
-
}
|
564 |
-
|
565 |
-
// If Paging, set $preloaded_amount to $posts_per_page
|
566 |
-
if($paging === 'true'){
|
567 |
-
$preloaded_amount = $posts_per_page;
|
568 |
-
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
|
569 |
-
if($paged > 1){
|
570 |
-
$preload_offset = $preloaded_amount * ($paged-2);
|
571 |
-
}
|
572 |
-
}
|
573 |
-
|
574 |
-
$preloaded_arr = array( // Create preload data array
|
575 |
-
'post_type' => $post_type,
|
576 |
-
'post_format' => $post_format,
|
577 |
-
'category' => $category,
|
578 |
-
'category__not_in' => $category__not_in,
|
579 |
-
'tag' => $tag,
|
580 |
-
'tag__not_in' => $tag__not_in,
|
581 |
-
'taxonomy' => $taxonomy,
|
582 |
-
'taxonomy_terms' => $taxonomy_terms,
|
583 |
-
'taxonomy_operator' => $taxonomy_operator,
|
584 |
-
'taxonomy_relation' => $taxonomy_relation,
|
585 |
-
'meta_key' => $meta_key,
|
586 |
-
'meta_value' => $meta_value,
|
587 |
-
'meta_compare' => $meta_compare,
|
588 |
-
'meta_relation' => $meta_relation,
|
589 |
-
'meta_type' => $meta_type,
|
590 |
-
'year' => $year,
|
591 |
-
'month' => $month,
|
592 |
-
'day' => $day,
|
593 |
-
'author' => $author,
|
594 |
-
'post__in' => $post__in,
|
595 |
-
'post__not_in' => $post__not_in,
|
596 |
-
'search' => $search,
|
597 |
-
'custom_args' => $custom_args,
|
598 |
-
'post_status' => $post_status,
|
599 |
-
'order' => $order,
|
600 |
-
'orderby' => $orderby,
|
601 |
-
'exclude' => $exclude,
|
602 |
-
'offset' => $preload_offset,
|
603 |
-
'posts_per_page' => $preloaded_amount,
|
604 |
-
'lang' => $lang,
|
605 |
-
'css_classes' => $css_classes,
|
606 |
-
);
|
607 |
-
|
608 |
-
$type = alm_get_repeater_type($repeater);
|
609 |
-
|
610 |
-
$args = apply_filters('alm_preload_args', $preloaded_arr); // Create preloaded $args
|
611 |
-
$args = apply_filters('alm_modify_query_args', $args, $slug); // ALM Core Filter Hook
|
612 |
-
|
613 |
-
$alm_preload_query = new WP_Query($args);
|
614 |
-
$alm_total_posts = $alm_preload_query->found_posts - $offset;
|
615 |
-
$output = '';
|
616 |
-
$noscript = '';
|
617 |
-
|
618 |
-
|
619 |
-
// Alternating Templates
|
620 |
-
if($alternate === 'true' && has_action('alm_alternating_installed')){
|
621 |
-
$alternate_sequence_array = '';
|
622 |
-
if($alternate_sequence === 'even'){
|
623 |
-
$alternate_sequence_array = 'even';
|
624 |
-
}else{
|
625 |
-
$alternate_sequence_array = explode(',', $alternate_sequence);
|
626 |
-
}
|
627 |
-
$global_repeater = $repeater;
|
628 |
-
$global_type = $type;
|
629 |
-
$global_theme_repeater = $theme_repeater;
|
630 |
-
}
|
631 |
-
|
632 |
-
|
633 |
-
if ($alm_preload_query->have_posts()) :
|
634 |
-
$alm_loop_count = 0; // Count var
|
635 |
-
$alm_page = 0; // Set page to 0
|
636 |
-
$alm_found_posts = $alm_total_posts;
|
637 |
-
$alm_current = 0;
|
638 |
-
while ($alm_preload_query->have_posts()) : $alm_preload_query->the_post();
|
639 |
-
$alm_loop_count++;
|
640 |
-
$alm_current++;
|
641 |
-
$alm_item = $alm_loop_count; // Get current item in loop
|
642 |
-
|
643 |
-
// Alternating Templates
|
644 |
-
if($alternate === 'true' && has_action('alm_alternating_installed')){
|
645 |
-
if (function_exists('alm_alternate_is_in_array')) {
|
646 |
-
if(alm_alternate_is_in_array($alm_current, $alternate_sequence_array)){ // If $alm_current is found in array
|
647 |
-
if($alternate_theme_repeater != 'null' && has_filter('alm_get_theme_repeater')){
|
648 |
-
$theme_repeater = $alternate_theme_repeater;
|
649 |
-
}else{
|
650 |
-
$repeater = $alternate_repeater;
|
651 |
-
$type = alm_get_repeater_type($repeater);
|
652 |
-
}
|
653 |
-
}else{ // Reset $repeater values
|
654 |
-
$repeater = $global_repeater;
|
655 |
-
$type = $global_type;
|
656 |
-
$theme_repeater = $global_theme_repeater;
|
657 |
-
}
|
658 |
-
}
|
659 |
-
}
|
660 |
-
|
661 |
-
$output .= apply_filters('alm_preload_inc', $repeater, $type, $theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current);
|
662 |
-
|
663 |
-
endwhile; wp_reset_query();
|
664 |
-
|
665 |
-
if(has_action('alm_seo_installed') && $seo === 'true'){ // If SEO, add noscript paging
|
666 |
-
// Create noscript paging for SEO if preload and seo are enabled
|
667 |
-
$noscript = alm_paging_no_script($alm_preload_query);
|
668 |
-
}
|
669 |
-
|
670 |
-
endif;
|
671 |
-
$preloaded_output = '<'.$container_element.' class="alm-listing alm-preloaded'. $classname .' '. $css_classes .'" data-total-posts="'. $alm_total_posts .'">';
|
672 |
-
if($seo === "true"){
|
673 |
-
$preloaded_output .= '<div class="alm-reveal alm-seo" data-page="1" data-url="'.$canonicalURL.'">';
|
674 |
-
}
|
675 |
-
$preloaded_output .= $output;
|
676 |
-
if($seo === "true"){
|
677 |
-
$preloaded_output .= '</div>';
|
678 |
-
}
|
679 |
-
$preloaded_output .= '</'.$container_element.'>';
|
680 |
-
|
681 |
-
if(has_action('alm_seo_installed')){ // If SEO, add noscript paging
|
682 |
-
$preloaded_output .= $noscript;
|
683 |
-
}
|
684 |
-
|
685 |
-
// Reset templates (custom and theme) if $alternate is true
|
686 |
-
if($alternate === 'true' && has_action('alm_alternating_installed')){
|
687 |
-
$repeater = $global_repeater;
|
688 |
-
$type = $global_type;
|
689 |
-
$theme_repeater = $theme_repeater;
|
690 |
-
}
|
691 |
-
|
692 |
-
$ajaxloadmore .= $preloaded_output; // Add $preloaded_output data to $ajaxloadmore
|
693 |
-
}
|
694 |
-
// End Preload Posts
|
695 |
-
// ********************************
|
696 |
-
|
697 |
-
$listing_class = 'alm-listing';
|
698 |
-
|
699 |
-
// If comments
|
700 |
-
if($comments === 'true'){
|
701 |
-
$listing_class = 'commentlist alm-comments';
|
702 |
-
}
|
703 |
-
|
704 |
-
$ajaxloadmore .= '<'.$container_element.' class="'.$listing_class.' alm-ajax'. $paging_container_class .' '. $classname . ' '. $css_classes .'"'; // Build ALM container
|
705 |
-
|
706 |
-
|
707 |
-
// Alternating Templates Add-on
|
708 |
-
if(has_action('alm_alternating_installed') && $alternate === 'true'){
|
709 |
-
$alternate_return = apply_filters(
|
710 |
-
'alm_alternating_templates_shortcode',
|
711 |
-
$alternate,
|
712 |
-
$alternate_sequence,
|
713 |
-
$alternate_sequence_max,
|
714 |
-
$alternate_repeater,
|
715 |
-
$alternate_theme_repeater
|
716 |
-
);
|
717 |
-
$ajaxloadmore .= $alternate_return;
|
718 |
-
}
|
719 |
-
|
720 |
-
// Cache Add-on
|
721 |
-
if(has_action('alm_cache_installed') && $cache === 'true'){
|
722 |
-
$cache_return = apply_filters(
|
723 |
-
'alm_cache_shortcode',
|
724 |
-
$cache,
|
725 |
-
$cache_id,
|
726 |
-
$options
|
727 |
-
);
|
728 |
-
$ajaxloadmore .= $cache_return;
|
729 |
-
}
|
730 |
-
|
731 |
-
// Comments Add-on
|
732 |
-
if(has_action('alm_comments_installed') && $comments === 'true'){
|
733 |
-
$comments_return = apply_filters(
|
734 |
-
'alm_comments_shortcode',
|
735 |
-
$comments,
|
736 |
-
$comments_per_page,
|
737 |
-
$comments_type,
|
738 |
-
$comments_style,
|
739 |
-
$comments_template,
|
740 |
-
$comments_callback,
|
741 |
-
$comments_post_id
|
742 |
-
);
|
743 |
-
$ajaxloadmore .= $comments_return;
|
744 |
-
}
|
745 |
-
|
746 |
-
|
747 |
-
// Paging Add-on
|
748 |
-
if(has_action('alm_paging_installed') && $paging === 'true'){
|
749 |
-
$paging_return = apply_filters(
|
750 |
-
'alm_paging_shortcode',
|
751 |
-
$paging,
|
752 |
-
$paging_controls,
|
753 |
-
$paging_show_at_most,
|
754 |
-
$paging_classes,
|
755 |
-
$options
|
756 |
-
);
|
757 |
-
$ajaxloadmore .= $paging_return;
|
758 |
-
}
|
759 |
-
|
760 |
-
|
761 |
-
// Preloaded Add-on
|
762 |
-
if(has_action('alm_preload_installed') && $preloaded === 'true'){
|
763 |
-
$ajaxloadmore .= ' data-preloaded="'.$preloaded.'"';
|
764 |
-
$ajaxloadmore .= ' data-preloaded-amount="'.$preloaded_amount.'"';
|
765 |
-
}
|
766 |
-
|
767 |
-
|
768 |
-
// SEO Add-on
|
769 |
-
if(has_action('alm_seo_installed') && $seo === 'true'){
|
770 |
-
$seo_return = apply_filters(
|
771 |
-
'alm_seo_shortcode',
|
772 |
-
$seo,
|
773 |
-
$preloaded,
|
774 |
-
$options
|
775 |
-
);
|
776 |
-
$ajaxloadmore .= $seo_return;
|
777 |
-
}
|
778 |
-
|
779 |
-
|
780 |
-
// Previous Post Post Add-on
|
781 |
-
if(has_action('alm_prev_post_installed') && $previous_post){
|
782 |
-
$prev_post_return = apply_filters(
|
783 |
-
'alm_prev_post_shortcode',
|
784 |
-
$previous_post_id,
|
785 |
-
$previous_post_taxonomy,
|
786 |
-
$options
|
787 |
-
);
|
788 |
-
$ajaxloadmore .= $prev_post_return;
|
789 |
-
}
|
790 |
-
|
791 |
-
|
792 |
-
$ajaxloadmore .= ' data-repeater="'.$repeater.'"';
|
793 |
-
if($theme_repeater != 'null'){
|
794 |
-
$ajaxloadmore .= ' data-theme-repeater="'.$theme_repeater.'"';
|
795 |
-
}
|
796 |
-
$ajaxloadmore .= ' data-post-type="'.$post_type.'"';
|
797 |
-
$ajaxloadmore .= ' data-post-format="'.$post_format.'"';
|
798 |
-
$ajaxloadmore .= ' data-category="'.$category.'"';
|
799 |
-
$ajaxloadmore .= ' data-category-not-in="'.$category__not_in.'"';
|
800 |
-
$ajaxloadmore .= ' data-tag="'.$tag.'"';
|
801 |
-
$ajaxloadmore .= ' data-tag-not-in="'.$tag__not_in.'"';
|
802 |
-
$ajaxloadmore .= ' data-taxonomy="'.$taxonomy.'"';
|
803 |
-
$ajaxloadmore .= ' data-taxonomy-terms="'.$taxonomy_terms.'"';
|
804 |
-
$ajaxloadmore .= ' data-taxonomy-operator="'.$taxonomy_operator.'"';
|
805 |
-
$ajaxloadmore .= ' data-taxonomy-relation="'.$taxonomy_relation.'"';
|
806 |
-
$ajaxloadmore .= ' data-meta-key="'.$meta_key.'"';
|
807 |
-
$ajaxloadmore .= ' data-meta-value="'.$meta_value.'"';
|
808 |
-
$ajaxloadmore .= ' data-meta-compare="'.$meta_compare.'"';
|
809 |
-
$ajaxloadmore .= ' data-meta-relation="'.$meta_relation.'"';
|
810 |
-
$ajaxloadmore .= ' data-meta-type="'.$meta_type.'"';
|
811 |
-
$ajaxloadmore .= ' data-year="'.$year.'"';
|
812 |
-
$ajaxloadmore .= ' data-month="'.$month.'"';
|
813 |
-
$ajaxloadmore .= ' data-day="'.$day.'"';
|
814 |
-
$ajaxloadmore .= ' data-author="'.$author.'"';
|
815 |
-
$ajaxloadmore .= ' data-post-in="'.$post__in.'"';
|
816 |
-
$ajaxloadmore .= ' data-post-not-in="'.$post__not_in.'"';
|
817 |
-
$ajaxloadmore .= ' data-exclude="'.$exclude.'"';
|
818 |
-
$ajaxloadmore .= ' data-search="'.$search.'"';
|
819 |
-
$ajaxloadmore .= ' data-custom-args="'.$custom_args.'"';
|
820 |
-
$ajaxloadmore .= ' data-post-status="'.$post_status.'"';
|
821 |
-
$ajaxloadmore .= ' data-order="'.$order.'"';
|
822 |
-
$ajaxloadmore .= ' data-orderby="'.$orderby.'"';
|
823 |
-
$ajaxloadmore .= ' data-offset="'.$offset.'"';
|
824 |
-
$ajaxloadmore .= ' data-posts-per-page="'.$posts_per_page.'"';
|
825 |
-
$ajaxloadmore .= ' data-lang="'.$lang.'"';
|
826 |
-
$ajaxloadmore .= ' data-scroll="'.$scroll.'"';
|
827 |
-
$ajaxloadmore .= ' data-scroll-distance="'.$scroll_distance.'"';
|
828 |
-
$ajaxloadmore .= ' data-max-pages="'.$max_pages.'"';
|
829 |
-
$ajaxloadmore .= ' data-pause-override="'.$pause_override.'"';
|
830 |
-
$ajaxloadmore .= ' data-pause="'.$pause.'"';
|
831 |
-
$ajaxloadmore .= ' data-button-label="'.$button_label.'"';
|
832 |
-
if(!empty($button_loading_label)){
|
833 |
-
$ajaxloadmore .= ' data-button-loading-label="'.$button_loading_label.'"';
|
834 |
-
}
|
835 |
-
$ajaxloadmore .= ' data-button-class="'.$button_classname.'"';
|
836 |
-
$ajaxloadmore .= ' data-destroy-after="'.$destroy_after.'"';
|
837 |
-
$ajaxloadmore .= ' data-transition="'.$transition.'"';
|
838 |
-
if($transition_speed !== '250')
|
839 |
-
$ajaxloadmore .= ' data-transition-speed="'.$transition_speed.'"';
|
840 |
-
if($transition_container === 'false')
|
841 |
-
$ajaxloadmore .= ' data-transition-container="'.$transition_container.'"';
|
842 |
-
$ajaxloadmore .= ' data-images-loaded="'.$images_loaded.'"';
|
843 |
-
|
844 |
-
$ajaxloadmore .= '>';
|
845 |
-
|
846 |
-
|
847 |
-
// Previous Post Add-on
|
848 |
-
// - Get first post and append to ajax load more object
|
849 |
-
if(has_action('alm_prev_post_installed') && $previous_post){
|
850 |
-
$repeater_type = preg_split('/(?=\d)/', $repeater, 2); // split $repeater at number to retrieve type
|
851 |
-
$repeater_type = $repeater_type[0]; // (default | repeater | template_)
|
852 |
-
if($theme_repeater != 'null' && has_filter('alm_get_theme_repeater')){
|
853 |
-
$repeater_type = null;
|
854 |
-
}
|
855 |
-
// Get next post include and build the output from the next post filter
|
856 |
-
$previous_post_output = '<div class="alm-reveal alm-previous-post post-'. $previous_post_id .'" data-url="'. get_permalink($previous_post_id) .'" data-title="'. get_the_title($previous_post_id) .'" data-id="'. $previous_post_id .'">'; // Set the post id .alm-reveal div
|
857 |
-
$previous_post_output .= apply_filters('alm_prev_post_inc', $repeater, $repeater_type, $theme_repeater, $previous_post_id, $post_type);
|
858 |
-
$previous_post_output .= '</div>';
|
859 |
-
$ajaxloadmore .= $previous_post_output; // Add $next_post_output data to $ajaxloadmore
|
860 |
-
|
861 |
-
}
|
862 |
-
// End Previous Post
|
863 |
-
|
864 |
-
|
865 |
-
$ajaxloadmore .= '</'.$container_element.'>';
|
866 |
-
|
867 |
-
$ajaxloadmore .= apply_filters('alm_before_button', ''); // ALM Core Filter Hook
|
868 |
-
|
869 |
-
$ajaxloadmore .= '</div>';
|
870 |
-
|
871 |
-
$ajaxloadmore .= apply_filters('alm_after_container', ''); // ALM Core Filter Hook
|
872 |
-
|
873 |
-
return $ajaxloadmore; // End ALM object
|
874 |
}
|
875 |
|
876 |
|
@@ -882,7 +302,7 @@ if( !class_exists('AjaxLoadMore') ):
|
|
882 |
* @since 2.0.0
|
883 |
*/
|
884 |
|
885 |
-
function alm_query_posts() {
|
886 |
|
887 |
$nonce = $_GET['nonce'];
|
888 |
$options = get_option( 'alm_settings' );
|
@@ -1088,7 +508,7 @@ if( !class_exists('AjaxLoadMore') ):
|
|
1088 |
}
|
1089 |
|
1090 |
// Meta Query
|
1091 |
-
if(!empty($meta_key) && !empty($meta_value)){
|
1092 |
|
1093 |
// Parse multiple meta query
|
1094 |
$meta_query_total = count(explode(":", $meta_key)); // Total meta_query objects
|
@@ -1131,8 +551,10 @@ if( !class_exists('AjaxLoadMore') ):
|
|
1131 |
|
1132 |
// Meta_key, used for ordering by meta value
|
1133 |
if(!empty($meta_key)){
|
1134 |
-
$
|
1135 |
-
|
|
|
|
|
1136 |
}
|
1137 |
|
1138 |
// Author
|
@@ -1277,7 +699,6 @@ if( !class_exists('AjaxLoadMore') ):
|
|
1277 |
endwhile; wp_reset_query();
|
1278 |
|
1279 |
$data = ob_get_clean();
|
1280 |
-
ob_end_clean();
|
1281 |
|
1282 |
// If Cache is enabled and seo_start_page is 1 (meaning, a user has not requested /page/12/)
|
1283 |
// - Only create cached files if the user visits pages in order 1, 2, 3 etc.
|
@@ -1318,10 +739,11 @@ if( !class_exists('AjaxLoadMore') ):
|
|
1318 |
*/
|
1319 |
|
1320 |
function AjaxLoadMore(){
|
1321 |
-
global $ajax_load_more;
|
1322 |
-
|
|
|
1323 |
$ajax_load_more = new AjaxLoadMore();
|
1324 |
-
|
1325 |
return $ajax_load_more;
|
1326 |
}
|
1327 |
// initialize
|
2 |
/*
|
3 |
Plugin Name: Ajax Load More
|
4 |
Plugin URI: http://connekthq.com/plugins/ajax-load-more
|
5 |
+
Description: The ultimate solution to add infinite scroll functionality to your website.
|
6 |
Text Domain: ajax-load-more
|
7 |
Author: Darren Cooney
|
8 |
Twitter: @KaptonKaos
|
9 |
Author URI: http://connekthq.com
|
10 |
+
Version: 2.10.1
|
11 |
License: GPL
|
12 |
Copyright: Darren Cooney & Connekt Media
|
|
|
13 |
*/
|
14 |
|
15 |
+
|
16 |
+
define('ALM_VERSION', '2.10.1');
|
17 |
+
define('ALM_RELEASE', 'May 8, 2016');
|
18 |
+
define('ALM_STORE_URL', 'https://connekthq.com');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
|
|
|
|
20 |
|
21 |
|
22 |
/*
|
50 |
register_activation_hook( __FILE__, 'alm_install' );
|
51 |
add_action( 'wpmu_new_blog', 'alm_install' );
|
52 |
|
53 |
+
|
54 |
+
|
55 |
+
/*
|
56 |
+
* alm_create_table
|
57 |
+
*
|
58 |
+
* Create new table and repeater template
|
59 |
+
*
|
60 |
+
* @since 2.0.0
|
61 |
+
*/
|
62 |
function alm_create_table(){
|
63 |
|
64 |
global $wpdb;
|
107 |
}
|
108 |
|
109 |
|
|
|
110 |
if( !class_exists('AjaxLoadMore') ):
|
111 |
+
|
112 |
class AjaxLoadMore {
|
|
|
|
|
113 |
|
114 |
function __construct(){
|
115 |
|
116 |
+
$this->alm_define_constants();
|
117 |
+
$this->alm_includes();
|
|
|
|
|
|
|
118 |
|
119 |
add_action( 'wp_ajax_alm_query_posts', array(&$this, 'alm_query_posts') );
|
120 |
add_action( 'wp_ajax_nopriv_alm_query_posts', array(&$this, 'alm_query_posts') );
|
124 |
add_action( 'after_setup_theme', array(&$this, 'alm_image_sizes') );
|
125 |
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array(&$this, 'alm_action_links') );
|
126 |
add_filter( 'plugin_row_meta', array(&$this, 'alm_plugin_meta_links'), 10, 2 );
|
127 |
+
add_shortcode( 'ajax_load_more', array(&$this, 'alm_shortcode') );
|
128 |
+
add_filter( 'widget_text', 'do_shortcode' ); // Allow shortcodes in widget areas
|
129 |
+
load_plugin_textdomain( 'ajax-load-more', false, dirname(plugin_basename( __FILE__ )).'/lang/'); //load text domain
|
130 |
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
/*
|
136 |
+
* alm_define_constants
|
137 |
+
* Define plugin constants
|
138 |
+
*
|
139 |
+
* @since 2.10.1
|
140 |
+
*/
|
141 |
+
|
142 |
+
public function alm_define_constants(){
|
143 |
+
|
144 |
+
define('ALM_PATH', plugin_dir_path(__FILE__));
|
145 |
+
define('ALM_URL', plugins_url('', __FILE__));
|
146 |
+
define('ALM_ADMIN_URL', plugins_url('admin/', __FILE__));
|
147 |
+
define('ALM_NAME', '_ajax_load_more');
|
148 |
+
define('ALM_TITLE', 'Ajax Load More');
|
149 |
+
|
150 |
+
if (!defined('ALM_ALTERNATING_ITEM_NAME')) define('ALM_ALTERNATING_ITEM_NAME', '14456');
|
151 |
+
if (!defined('ALM_CACHE_ITEM_NAME')) define('ALM_CACHE_ITEM_NAME', '4878');
|
152 |
+
if (!defined('ALM_COMMENTS_ITEM_NAME')) define('ALM_COMMENTS_ITEM_NAME', '12172');
|
153 |
+
if (!defined('ALM_UNLIMITED_ITEM_NAME')) define('ALM_UNLIMITED_ITEM_NAME', '3118');
|
154 |
+
if (!defined('ALM_LAYOUTS_ITEM_NAME')) define('ALM_LAYOUTS_ITEM_NAME', '11398');
|
155 |
+
if (!defined('ALM_PAGING_ITEM_NAME')) define('ALM_PAGING_ITEM_NAME', '6898');
|
156 |
+
if (!defined('ALM_PRELOADED_ITEM_NAME')) define('ALM_PRELOADED_ITEM_NAME', '4293');
|
157 |
+
if (!defined('ALM_PREV_POST_ITEM_NAME')) define('ALM_PREV_POST_ITEM_NAME', '9686');
|
158 |
+
if (!defined('ALM_SEO_ITEM_NAME')) define('ALM_SEO_ITEM_NAME', '3482');
|
159 |
+
if (!defined('ALM_THEME_REPEATERS_ITEM_NAME')) define('ALM_THEME_REPEATERS_ITEM_NAME', '8860');
|
160 |
+
|
161 |
+
}
|
162 |
|
163 |
|
164 |
/*
|
165 |
+
* alm_includes
|
166 |
* Load these files before the theme loads
|
167 |
*
|
168 |
* @since 2.0.0
|
169 |
*/
|
170 |
|
171 |
+
public function alm_includes(){
|
172 |
+
|
173 |
+
include_once( ALM_PATH . 'core/functions.php'); // Functions
|
174 |
+
include_once( ALM_PATH . 'core/classes/class.alm-shortcode.php'); // Shortcode
|
175 |
+
include_once( ALM_PATH . 'core/classes/class.alm-enqueue.php'); // Enqueue
|
176 |
+
|
177 |
+
if( is_admin() ){
|
178 |
include_once('admin/editor/editor.php');
|
179 |
include_once('admin/admin.php');
|
180 |
+
}
|
181 |
+
|
182 |
+
}
|
183 |
|
184 |
|
185 |
|
190 |
* @since 2.2.3
|
191 |
*/
|
192 |
|
193 |
+
public function alm_action_links( $links ) {
|
194 |
$links[] = '<a href="'. get_admin_url(null, 'admin.php?page=ajax-load-more') .'">'.__('Settings', 'ajax-load-more').'</a>';
|
195 |
return $links;
|
196 |
}
|
204 |
* @since 2.7.2.1
|
205 |
*/
|
206 |
|
207 |
+
public function alm_plugin_meta_links( $links, $file ) {
|
208 |
if ( strpos( $file, 'ajax-load-more.php' ) !== false ) {
|
209 |
$new_links = array(
|
210 |
'<a href="admin.php?page=ajax-load-more-shortcode-builder">Shortcode Builder</a>',
|
220 |
|
221 |
|
222 |
/*
|
223 |
+
* alm_image_sizes
|
224 |
+
* Add default image size
|
225 |
*
|
226 |
* @since 2.8.3
|
227 |
*/
|
228 |
|
229 |
+
public function alm_image_sizes(){
|
230 |
add_image_size( 'alm-thumbnail', 150, 150, true); // Custom ALM thumbnail size
|
231 |
}
|
232 |
|
239 |
* @since 2.0.0
|
240 |
*/
|
241 |
|
242 |
+
public function alm_enqueue_scripts(){
|
243 |
$options = get_option( 'alm_settings' );
|
244 |
|
245 |
+
// Load JS
|
|
|
246 |
//wp_register_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.js', __FILE__ ), array('jquery'), ALM_VERSION, true );
|
247 |
+
wp_register_script( 'ajax-load-more', plugins_url( '/core/js/ajax-load-more.min.js', __FILE__ ), array('jquery'), ALM_VERSION, true );
|
248 |
+
|
249 |
|
250 |
+
// Load CSS
|
251 |
+
if(!isset($options['_alm_disable_css']) || $options['_alm_disable_css'] != '1'){
|
252 |
+
|
253 |
+
//$file = plugins_url('/core/css/ajax-load-more.css', __FILE__ );
|
254 |
+
$file = plugins_url('/core/css/ajax-load-more.min.css', __FILE__ );
|
255 |
+
|
256 |
+
$filename = 'ajax-load-more';
|
257 |
+
ALM_ENQUEUE::alm_enqueue_css($filename, $file);
|
258 |
+
|
259 |
}
|
260 |
|
261 |
// Prevent loading of unnessasry posts - move user to top of page
|
267 |
}
|
268 |
|
269 |
wp_localize_script(
|
270 |
+
'ajax-load-more', 'alm_localize',
|
|
|
271 |
array(
|
272 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
273 |
'alm_nonce' => wp_create_nonce( "ajax_load_more_nonce" ),
|
287 |
* @since 2.0.0
|
288 |
*/
|
289 |
|
290 |
+
public function alm_shortcode($atts) {
|
291 |
|
292 |
+
return ALM_SHORTCODE::alm_render_shortcode($atts);
|
293 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
}
|
295 |
|
296 |
|
302 |
* @since 2.0.0
|
303 |
*/
|
304 |
|
305 |
+
public function alm_query_posts() {
|
306 |
|
307 |
$nonce = $_GET['nonce'];
|
308 |
$options = get_option( 'alm_settings' );
|
508 |
}
|
509 |
|
510 |
// Meta Query
|
511 |
+
if(!empty($meta_key) && !empty($meta_value) || !empty($meta_key) && $meta_compare !== "IN"){
|
512 |
|
513 |
// Parse multiple meta query
|
514 |
$meta_query_total = count(explode(":", $meta_key)); // Total meta_query objects
|
551 |
|
552 |
// Meta_key, used for ordering by meta value
|
553 |
if(!empty($meta_key)){
|
554 |
+
if (strpos($orderby, 'meta_value') !== false) { // Only order by meta_key, if $orderby is set to meta_value{_num}
|
555 |
+
$meta_key_single = explode(":", $meta_key);
|
556 |
+
$args['meta_key'] = $meta_key_single[0];
|
557 |
+
}
|
558 |
}
|
559 |
|
560 |
// Author
|
699 |
endwhile; wp_reset_query();
|
700 |
|
701 |
$data = ob_get_clean();
|
|
|
702 |
|
703 |
// If Cache is enabled and seo_start_page is 1 (meaning, a user has not requested /page/12/)
|
704 |
// - Only create cached files if the user visits pages in order 1, 2, 3 etc.
|
739 |
*/
|
740 |
|
741 |
function AjaxLoadMore(){
|
742 |
+
global $ajax_load_more;
|
743 |
+
|
744 |
+
if( !isset($ajax_load_more))
|
745 |
$ajax_load_more = new AjaxLoadMore();
|
746 |
+
|
747 |
return $ajax_load_more;
|
748 |
}
|
749 |
// initialize
|
core/classes/class.alm-enqueue.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Ajax Load More Enqueue
|
4 |
+
*
|
5 |
+
* Enqueue scripts.
|
6 |
+
*
|
7 |
+
* @author Darren Cooney
|
8 |
+
* @since 2.10.1
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
exit;
|
13 |
+
}
|
14 |
+
|
15 |
+
if( !class_exists('ALM_ENQUEUE') ):
|
16 |
+
|
17 |
+
class ALM_ENQUEUE {
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
/**
|
22 |
+
* alm_enqueue_css
|
23 |
+
*
|
24 |
+
* Load ALM CSS
|
25 |
+
*
|
26 |
+
* @since 2.10.1
|
27 |
+
* @return wp_enqueue_style
|
28 |
+
*/
|
29 |
+
public static function alm_enqueue_css($name, $file){
|
30 |
+
$css = '';
|
31 |
+
$css_path = '';
|
32 |
+
$dir = 'alm';
|
33 |
+
$file_css = $name.'.css';
|
34 |
+
|
35 |
+
// - Check theme for local ajax-load-more.css, if found, load that file
|
36 |
+
if(is_child_theme()){
|
37 |
+
$css = get_stylesheet_directory_uri().'/'. $dir .'/' .$file_css;
|
38 |
+
$css_path = get_stylesheet_directory().'/'. $dir .'/' .$file_css;
|
39 |
+
// if child theme does not have CSS, check the parent theme
|
40 |
+
if(!file_exists($css_path)){
|
41 |
+
$css = get_template_directory_uri().'/'. $dir .'/' .$file_css;
|
42 |
+
$css_path = get_template_directory().'/'. $dir .'/' .$file_css;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
else{
|
46 |
+
$css = get_template_directory_uri().'/'. $dir .'/' .$file_css;
|
47 |
+
$css_path = get_template_directory().'/'. $dir .'/' .$file_css;
|
48 |
+
}
|
49 |
+
|
50 |
+
if($css_path !== ''){ // If $css_path has been
|
51 |
+
if(file_exists($css_path)){
|
52 |
+
$file = $css;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
// Enqueue $file
|
57 |
+
wp_enqueue_style( $name, $file );
|
58 |
+
}
|
59 |
+
|
60 |
+
}
|
61 |
+
|
62 |
+
endif;
|
core/classes/class.alm-shortcode.php
ADDED
@@ -0,0 +1,650 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Ajax Load More shortcode
|
4 |
+
*
|
5 |
+
* Returns the [ajax_load_more] shortcode.
|
6 |
+
*
|
7 |
+
* @author Darren Cooney
|
8 |
+
* @since 2.10.1
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
exit;
|
13 |
+
}
|
14 |
+
|
15 |
+
if( !class_exists('ALM_SHORTCODE') ):
|
16 |
+
|
17 |
+
class ALM_SHORTCODE {
|
18 |
+
|
19 |
+
|
20 |
+
static $counter = 0;
|
21 |
+
|
22 |
+
|
23 |
+
/**
|
24 |
+
* alm_render_shortcode
|
25 |
+
*
|
26 |
+
* Parse & Render ALM Shortcode.
|
27 |
+
*
|
28 |
+
* @since 2.10.1
|
29 |
+
* @return $ajaxloadmore
|
30 |
+
*/
|
31 |
+
|
32 |
+
public static function alm_render_shortcode($atts){
|
33 |
+
|
34 |
+
global $post;
|
35 |
+
|
36 |
+
$options = get_option( 'alm_settings' );
|
37 |
+
self::$counter++;
|
38 |
+
|
39 |
+
// Define page slug
|
40 |
+
$slug = '';
|
41 |
+
if(!is_archive()){
|
42 |
+
// If not an archive page, set the post slug
|
43 |
+
if(is_front_page() || is_home()){
|
44 |
+
$slug = 'home';
|
45 |
+
}else{
|
46 |
+
$slug = $post->post_name;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
// Custom CSS for Layouts - Only run this once.
|
51 |
+
if(has_action('alm_layouts_custom_css')){
|
52 |
+
do_action('alm_layouts_custom_css', self::$counter);
|
53 |
+
}
|
54 |
+
|
55 |
+
extract(shortcode_atts(array(
|
56 |
+
'restapi' => false,
|
57 |
+
'comments' => false,
|
58 |
+
'comments_per_page' => '5',
|
59 |
+
'comments_type' => 'comment',
|
60 |
+
'comments_style' => 'ol',
|
61 |
+
'comments_template' => 'none',
|
62 |
+
'comments_callback' => '',
|
63 |
+
'comments_post_id' => 'null',
|
64 |
+
'previous_post' => false,
|
65 |
+
'previous_post_id' => 'null',
|
66 |
+
'previous_post_taxonomy' => '',
|
67 |
+
'cache' => 'false',
|
68 |
+
'cache_id' => '',
|
69 |
+
'paging' => 'false',
|
70 |
+
'paging_controls' => 'false',
|
71 |
+
'paging_show_at_most' => '7',
|
72 |
+
'paging_classes' => '',
|
73 |
+
'preloaded' => 'false',
|
74 |
+
'preloaded_amount' => '5',
|
75 |
+
'seo' => 'false',
|
76 |
+
'repeater' => 'default',
|
77 |
+
'theme_repeater' => 'null',
|
78 |
+
'alternate' => false,
|
79 |
+
'alternate_sequence' => '',
|
80 |
+
'alternate_sequence_max' => '0',
|
81 |
+
'alternate_repeater' => 'null',
|
82 |
+
'alternate_theme_repeater' => 'null',
|
83 |
+
'post_type' => 'post',
|
84 |
+
'post_format' => '',
|
85 |
+
'category' => '',
|
86 |
+
'category__not_in' => '',
|
87 |
+
'tag' => '',
|
88 |
+
'tag__not_in' => '',
|
89 |
+
'taxonomy' => '',
|
90 |
+
'taxonomy_terms' => '',
|
91 |
+
'taxonomy_operator' => '',
|
92 |
+
'taxonomy_relation' => '',
|
93 |
+
'meta_key' => '',
|
94 |
+
'meta_value' => '',
|
95 |
+
'meta_compare' => '',
|
96 |
+
'meta_relation' => '',
|
97 |
+
'meta_type' => '',
|
98 |
+
'year' => '',
|
99 |
+
'month' => '',
|
100 |
+
'day' => '',
|
101 |
+
'author' => '',
|
102 |
+
'search' => '',
|
103 |
+
'custom_args' => '',
|
104 |
+
'post_status' => '',
|
105 |
+
'order' => 'DESC',
|
106 |
+
'orderby' => 'date',
|
107 |
+
'post__in' => '',
|
108 |
+
'post__not_in' => '',
|
109 |
+
'exclude' => '',
|
110 |
+
'offset' => '0',
|
111 |
+
'posts_per_page' => '5',
|
112 |
+
'scroll' => 'true',
|
113 |
+
'scroll_distance' => '150',
|
114 |
+
'max_pages' => '5',
|
115 |
+
'pause_override' => 'false',
|
116 |
+
'pause' => 'false',
|
117 |
+
'destroy_after' => '',
|
118 |
+
'transition' => 'slide',
|
119 |
+
'transition_speed' => '250',
|
120 |
+
'transition_container' => 'true',
|
121 |
+
'images_loaded' => 'false',
|
122 |
+
'button_label' => apply_filters('alm_button_label', __('Older Posts', 'ajax-load-more')),
|
123 |
+
'button_loading_label' => '',
|
124 |
+
'container_type' => '',
|
125 |
+
'css_classes' => '',
|
126 |
+
), $atts));
|
127 |
+
|
128 |
+
|
129 |
+
// Enqueue core Ajax Load More JS
|
130 |
+
wp_enqueue_script( 'ajax-load-more' );
|
131 |
+
|
132 |
+
// Enqueue add-on JS
|
133 |
+
if(has_action('alm_seo_installed') && $seo === 'true'){
|
134 |
+
wp_enqueue_script( 'ajax-load-more-seo' );
|
135 |
+
}
|
136 |
+
if(has_action('alm_paging_installed') && $paging === 'true'){
|
137 |
+
wp_enqueue_script( 'ajax-load-more-paging' );
|
138 |
+
}
|
139 |
+
if(has_action('alm_prev_post_installed') && $previous_post === 'true'){
|
140 |
+
wp_enqueue_script( 'ajax-load-more-previous-post' );
|
141 |
+
}
|
142 |
+
if(has_action('alm_layouts_installed')){
|
143 |
+
//wp_enqueue_script( 'ajax-load-more-layouts' ); // Not yet :)
|
144 |
+
}
|
145 |
+
|
146 |
+
if($previous_post === 'true')
|
147 |
+
$previous_post === true;
|
148 |
+
|
149 |
+
if($seo === "true" || $previous_post)
|
150 |
+
$transition_container = "true";
|
151 |
+
|
152 |
+
if($restapi === 'true')
|
153 |
+
$restapi = true;
|
154 |
+
|
155 |
+
// Get container elements (ul | div)
|
156 |
+
|
157 |
+
$container_element = 'ul';
|
158 |
+
if($options['_alm_container_type'] == '2' || $previous_post)
|
159 |
+
$container_element = 'div';
|
160 |
+
|
161 |
+
// override shortcode param
|
162 |
+
if($container_type){
|
163 |
+
$container_element = $container_type;
|
164 |
+
}
|
165 |
+
|
166 |
+
// Previous post override
|
167 |
+
if($previous_post){
|
168 |
+
$posts_per_page = 1;
|
169 |
+
$container_element = 'div';
|
170 |
+
}
|
171 |
+
|
172 |
+
// Comments
|
173 |
+
if($comments === 'true'){
|
174 |
+
$container_element = $comments_style;
|
175 |
+
}
|
176 |
+
|
177 |
+
// Get extra classnames
|
178 |
+
$classname = '';
|
179 |
+
if(isset($options['_alm_classname']))
|
180 |
+
$classname = ' '.$options['_alm_classname'];
|
181 |
+
|
182 |
+
// Get button color
|
183 |
+
$btn_color = '';
|
184 |
+
if(isset($options['_alm_btn_color']))
|
185 |
+
$btn_color = ' '.$options['_alm_btn_color'];
|
186 |
+
|
187 |
+
// Get paging color
|
188 |
+
$paging_color = '';
|
189 |
+
if(isset($options['_alm_paging_color']) && has_action('alm_paging_installed'))
|
190 |
+
$paging_color = ' paging-'.$options['_alm_paging_color'];
|
191 |
+
|
192 |
+
// Get Layouts activated
|
193 |
+
$alm_layouts = '';
|
194 |
+
if(has_action('alm_layouts_installed'))
|
195 |
+
$alm_layouts = ' alm-layouts';
|
196 |
+
|
197 |
+
// Get btn classnames
|
198 |
+
$button_classname = '';
|
199 |
+
if(isset($options['_alm_btn_classname']))
|
200 |
+
$button_classname = $options['_alm_btn_classname'];
|
201 |
+
|
202 |
+
|
203 |
+
// Language support
|
204 |
+
$lang = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : ''; // WPML - http://wpml.org
|
205 |
+
if (function_exists('pll_current_language')) // Polylang - https://wordpress.org/plugins/polylang/
|
206 |
+
$lang = pll_current_language();
|
207 |
+
if (function_exists('qtrans_getLanguage')) // qTranslate - https://wordpress.org/plugins/qtranslate/
|
208 |
+
$lang = qtrans_getLanguage();
|
209 |
+
|
210 |
+
$wp_posts_per_page = get_option( 'posts_per_page' ); // Posts per page - settings -> reading
|
211 |
+
|
212 |
+
/* If $wp_posts_per_page > than shortcode value then $posts_per_page to $wp_posts_per_page */
|
213 |
+
if(has_action('alm_seo_installed') && $wp_posts_per_page > $posts_per_page && $seo === 'true')
|
214 |
+
$posts_per_page = $wp_posts_per_page;
|
215 |
+
|
216 |
+
|
217 |
+
$paging_container_class = '';
|
218 |
+
if($paging === 'true'){
|
219 |
+
$paging_container_class = ' alm-paging-wrap';
|
220 |
+
$preloaded = "false";
|
221 |
+
}
|
222 |
+
|
223 |
+
|
224 |
+
// Start ALM object
|
225 |
+
$ajaxloadmore = '';
|
226 |
+
|
227 |
+
$ajaxloadmore .= apply_filters('alm_before_container', ''); // ALM Core Filter Hook
|
228 |
+
|
229 |
+
// Build canonical URL
|
230 |
+
// - Check the page/post type and then get the correct base url for the page.
|
231 |
+
|
232 |
+
// Date
|
233 |
+
if(is_date()){
|
234 |
+
// Is archive page
|
235 |
+
$archive_year = get_the_date('Y');
|
236 |
+
$archive_month = get_the_date('m');
|
237 |
+
$archive_day = get_the_date('d');
|
238 |
+
if(is_year()){
|
239 |
+
$canonicalURL = get_year_link( $archive_year );
|
240 |
+
}
|
241 |
+
if(is_month()){
|
242 |
+
$canonicalURL = get_month_link( $archive_year, $archive_month );
|
243 |
+
}
|
244 |
+
if(is_day()){
|
245 |
+
$canonicalURL = get_month_link( $archive_year, $archive_month, $archive_day );
|
246 |
+
}
|
247 |
+
}
|
248 |
+
// Frontpage
|
249 |
+
elseif(is_front_page() || is_home()){
|
250 |
+
$canonicalURL = get_home_url().'/';
|
251 |
+
}
|
252 |
+
// Category
|
253 |
+
elseif(is_category()){
|
254 |
+
$cur_cat_id = get_cat_id( single_cat_title('',false) );
|
255 |
+
$canonicalURL = get_category_link($cur_cat_id);
|
256 |
+
}
|
257 |
+
// Tag
|
258 |
+
elseif(is_tag()){
|
259 |
+
$cur_tag_id = get_query_var('tag_id');
|
260 |
+
$canonicalURL = get_tag_link($cur_tag_id);
|
261 |
+
}
|
262 |
+
// Author
|
263 |
+
elseif(is_author()){
|
264 |
+
$author_id = get_the_author_meta('ID');
|
265 |
+
$canonicalURL = get_author_posts_url($author_id);
|
266 |
+
}
|
267 |
+
// Taxonomy
|
268 |
+
elseif(is_tax()){
|
269 |
+
$tax_term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy' ));
|
270 |
+
$tax_id = $tax_term->term_id;
|
271 |
+
$canonicalURL = get_term_link($tax_id);
|
272 |
+
}
|
273 |
+
// post_type
|
274 |
+
elseif(is_post_type_archive()){
|
275 |
+
$post_type_archive = get_post_type();
|
276 |
+
$canonicalURL = get_post_type_archive_link($post_type_archive);
|
277 |
+
}
|
278 |
+
else{
|
279 |
+
$canonicalURL = get_permalink();
|
280 |
+
}
|
281 |
+
// End build canonical URL
|
282 |
+
|
283 |
+
|
284 |
+
// ALM Wrapper
|
285 |
+
$ajaxloadmore .= '<div id="ajax-load-more" class="ajax-load-more-wrap'. $btn_color .''. $paging_color .''. $alm_layouts .'" data-id="" data-canonical-url="'. $canonicalURL .'" data-slug="'. $slug .'">';
|
286 |
+
|
287 |
+
|
288 |
+
// Previous Post
|
289 |
+
// - Set other add-on params to false
|
290 |
+
if($previous_post){
|
291 |
+
$preloaded = false;
|
292 |
+
$seo = false;
|
293 |
+
$paging = false;
|
294 |
+
$cache = false;
|
295 |
+
$comments = false;
|
296 |
+
}
|
297 |
+
|
298 |
+
// Comments
|
299 |
+
// - Set other add-on params to false
|
300 |
+
if($comments){
|
301 |
+
$previous_post = false;
|
302 |
+
$preloaded = false;
|
303 |
+
$seo = false;
|
304 |
+
$paging = false;
|
305 |
+
$cache = false;
|
306 |
+
}
|
307 |
+
|
308 |
+
|
309 |
+
// ********************************
|
310 |
+
// Preloaded Add-on
|
311 |
+
// Retreive preloaded posts and append to ajax load more object
|
312 |
+
if(has_action('alm_preload_installed') && $preloaded === 'true'){
|
313 |
+
|
314 |
+
$preload_offset = $offset;
|
315 |
+
|
316 |
+
// If SEO, set $preloaded_amount to $posts_per_page
|
317 |
+
if(has_action('alm_seo_installed') && $seo === 'true'){
|
318 |
+
$preloaded_amount = $posts_per_page;
|
319 |
+
}
|
320 |
+
|
321 |
+
// If Paging, set $preloaded_amount to $posts_per_page
|
322 |
+
if($paging === 'true'){
|
323 |
+
$preloaded_amount = $posts_per_page;
|
324 |
+
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
|
325 |
+
if($paged > 1){
|
326 |
+
$preload_offset = $preloaded_amount * ($paged-2);
|
327 |
+
}
|
328 |
+
}
|
329 |
+
|
330 |
+
$preloaded_arr = array( // Create preload data array
|
331 |
+
'post_type' => $post_type,
|
332 |
+
'post_format' => $post_format,
|
333 |
+
'category' => $category,
|
334 |
+
'category__not_in' => $category__not_in,
|
335 |
+
'tag' => $tag,
|
336 |
+
'tag__not_in' => $tag__not_in,
|
337 |
+
'taxonomy' => $taxonomy,
|
338 |
+
'taxonomy_terms' => $taxonomy_terms,
|
339 |
+
'taxonomy_operator' => $taxonomy_operator,
|
340 |
+
'taxonomy_relation' => $taxonomy_relation,
|
341 |
+
'meta_key' => $meta_key,
|
342 |
+
'meta_value' => $meta_value,
|
343 |
+
'meta_compare' => $meta_compare,
|
344 |
+
'meta_relation' => $meta_relation,
|
345 |
+
'meta_type' => $meta_type,
|
346 |
+
'year' => $year,
|
347 |
+
'month' => $month,
|
348 |
+
'day' => $day,
|
349 |
+
'author' => $author,
|
350 |
+
'post__in' => $post__in,
|
351 |
+
'post__not_in' => $post__not_in,
|
352 |
+
'search' => $search,
|
353 |
+
'custom_args' => $custom_args,
|
354 |
+
'post_status' => $post_status,
|
355 |
+
'order' => $order,
|
356 |
+
'orderby' => $orderby,
|
357 |
+
'exclude' => $exclude,
|
358 |
+
'offset' => $preload_offset,
|
359 |
+
'posts_per_page' => $preloaded_amount,
|
360 |
+
'lang' => $lang,
|
361 |
+
'css_classes' => $css_classes,
|
362 |
+
);
|
363 |
+
|
364 |
+
$type = alm_get_repeater_type($repeater);
|
365 |
+
|
366 |
+
$args = apply_filters('alm_preload_args', $preloaded_arr); // Create preloaded $args
|
367 |
+
$args = apply_filters('alm_modify_query_args', $args, $slug); // ALM Core Filter Hook
|
368 |
+
|
369 |
+
$alm_preload_query = new WP_Query($args);
|
370 |
+
$alm_total_posts = $alm_preload_query->found_posts - $offset;
|
371 |
+
$output = '';
|
372 |
+
$noscript = '';
|
373 |
+
|
374 |
+
|
375 |
+
// Alternating Templates
|
376 |
+
if($alternate === 'true' && has_action('alm_alternating_installed')){
|
377 |
+
$alternate_sequence_array = '';
|
378 |
+
if($alternate_sequence === 'even'){
|
379 |
+
$alternate_sequence_array = 'even';
|
380 |
+
}else{
|
381 |
+
$alternate_sequence_array = explode(',', $alternate_sequence);
|
382 |
+
}
|
383 |
+
$global_repeater = $repeater;
|
384 |
+
$global_type = $type;
|
385 |
+
$global_theme_repeater = $theme_repeater;
|
386 |
+
}
|
387 |
+
|
388 |
+
|
389 |
+
if ($alm_preload_query->have_posts()) :
|
390 |
+
$alm_loop_count = 0; // Count var
|
391 |
+
$alm_page = 0; // Set page to 0
|
392 |
+
$alm_found_posts = $alm_total_posts;
|
393 |
+
$alm_current = 0;
|
394 |
+
while ($alm_preload_query->have_posts()) : $alm_preload_query->the_post();
|
395 |
+
$alm_loop_count++;
|
396 |
+
$alm_current++;
|
397 |
+
$alm_item = $alm_loop_count; // Get current item in loop
|
398 |
+
|
399 |
+
// Alternating Templates
|
400 |
+
if($alternate === 'true' && has_action('alm_alternating_installed')){
|
401 |
+
if (function_exists('alm_alternate_is_in_array')) {
|
402 |
+
if(alm_alternate_is_in_array($alm_current, $alternate_sequence_array)){ // If $alm_current is found in array
|
403 |
+
if($alternate_theme_repeater != 'null' && has_filter('alm_get_theme_repeater')){
|
404 |
+
$theme_repeater = $alternate_theme_repeater;
|
405 |
+
}else{
|
406 |
+
$repeater = $alternate_repeater;
|
407 |
+
$type = alm_get_repeater_type($repeater);
|
408 |
+
}
|
409 |
+
}else{ // Reset $repeater values
|
410 |
+
$repeater = $global_repeater;
|
411 |
+
$type = $global_type;
|
412 |
+
$theme_repeater = $global_theme_repeater;
|
413 |
+
}
|
414 |
+
}
|
415 |
+
}
|
416 |
+
|
417 |
+
$output .= apply_filters('alm_preload_inc', $repeater, $type, $theme_repeater, $alm_found_posts, $alm_page, $alm_item, $alm_current);
|
418 |
+
|
419 |
+
endwhile; wp_reset_query();
|
420 |
+
|
421 |
+
if(has_action('alm_seo_installed') && $seo === 'true'){ // If SEO, add noscript paging
|
422 |
+
// Create noscript paging for SEO if preload and seo are enabled
|
423 |
+
$noscript = alm_paging_no_script($alm_preload_query);
|
424 |
+
}
|
425 |
+
|
426 |
+
endif;
|
427 |
+
$preloaded_output = '<'.$container_element.' class="alm-listing alm-preloaded'. $classname .' '. $css_classes .'" data-total-posts="'. $alm_total_posts .'">';
|
428 |
+
if($seo === "true"){
|
429 |
+
$preloaded_output .= '<div class="alm-reveal alm-seo" data-page="1" data-url="'.$canonicalURL.'">';
|
430 |
+
}
|
431 |
+
$preloaded_output .= $output;
|
432 |
+
if($seo === "true"){
|
433 |
+
$preloaded_output .= '</div>';
|
434 |
+
}
|
435 |
+
$preloaded_output .= '</'.$container_element.'>';
|
436 |
+
|
437 |
+
if(has_action('alm_seo_installed')){ // If SEO, add noscript paging
|
438 |
+
$preloaded_output .= $noscript;
|
439 |
+
}
|
440 |
+
|
441 |
+
// Reset templates (custom and theme) if $alternate is true
|
442 |
+
if($alternate === 'true' && has_action('alm_alternating_installed')){
|
443 |
+
$repeater = $global_repeater;
|
444 |
+
$type = $global_type;
|
445 |
+
$theme_repeater = $theme_repeater;
|
446 |
+
}
|
447 |
+
|
448 |
+
$ajaxloadmore .= $preloaded_output; // Add $preloaded_output data to $ajaxloadmore
|
449 |
+
}
|
450 |
+
// End Preload Posts
|
451 |
+
// ********************************
|
452 |
+
|
453 |
+
$listing_class = 'alm-listing';
|
454 |
+
|
455 |
+
// If comments
|
456 |
+
if($comments === 'true'){
|
457 |
+
$listing_class = 'commentlist alm-comments';
|
458 |
+
}
|
459 |
+
|
460 |
+
$ajaxloadmore .= '<'.$container_element.' class="'.$listing_class.' alm-ajax'. $paging_container_class .' '. $classname . ' '. $css_classes .'"'; // Build ALM container
|
461 |
+
|
462 |
+
|
463 |
+
// Alternating Templates Add-on
|
464 |
+
if(has_action('alm_alternating_installed') && $alternate === 'true'){
|
465 |
+
$alternate_return = apply_filters(
|
466 |
+
'alm_alternating_templates_shortcode',
|
467 |
+
$alternate,
|
468 |
+
$alternate_sequence,
|
469 |
+
$alternate_sequence_max,
|
470 |
+
$alternate_repeater,
|
471 |
+
$alternate_theme_repeater
|
472 |
+
);
|
473 |
+
$ajaxloadmore .= $alternate_return;
|
474 |
+
}
|
475 |
+
|
476 |
+
// Cache Add-on
|
477 |
+
if(has_action('alm_cache_installed') && $cache === 'true'){
|
478 |
+
$cache_return = apply_filters(
|
479 |
+
'alm_cache_shortcode',
|
480 |
+
$cache,
|
481 |
+
$cache_id,
|
482 |
+
$options
|
483 |
+
);
|
484 |
+
$ajaxloadmore .= $cache_return;
|
485 |
+
}
|
486 |
+
|
487 |
+
// Comments Add-on
|
488 |
+
if(has_action('alm_comments_installed') && $comments === 'true'){
|
489 |
+
$comments_return = apply_filters(
|
490 |
+
'alm_comments_shortcode',
|
491 |
+
$comments,
|
492 |
+
$comments_per_page,
|
493 |
+
$comments_type,
|
494 |
+
$comments_style,
|
495 |
+
$comments_template,
|
496 |
+
$comments_callback,
|
497 |
+
$comments_post_id
|
498 |
+
);
|
499 |
+
$ajaxloadmore .= $comments_return;
|
500 |
+
}
|
501 |
+
|
502 |
+
// REST API Add-on
|
503 |
+
if(has_action('alm_rest_api_installed') && $restapi === true){
|
504 |
+
$restapi_return = apply_filters(
|
505 |
+
'alm_rest_api_shortcode',
|
506 |
+
'true'
|
507 |
+
);
|
508 |
+
$ajaxloadmore .= $restapi_return;
|
509 |
+
}
|
510 |
+
|
511 |
+
|
512 |
+
// Paging Add-on
|
513 |
+
if(has_action('alm_paging_installed') && $paging === 'true'){
|
514 |
+
$paging_return = apply_filters(
|
515 |
+
'alm_paging_shortcode',
|
516 |
+
$paging,
|
517 |
+
$paging_controls,
|
518 |
+
$paging_show_at_most,
|
519 |
+
$paging_classes,
|
520 |
+
$options
|
521 |
+
);
|
522 |
+
$ajaxloadmore .= $paging_return;
|
523 |
+
}
|
524 |
+
|
525 |
+
|
526 |
+
// Preloaded Add-on
|
527 |
+
if(has_action('alm_preload_installed') && $preloaded === 'true'){
|
528 |
+
$ajaxloadmore .= ' data-preloaded="'.$preloaded.'"';
|
529 |
+
$ajaxloadmore .= ' data-preloaded-amount="'.$preloaded_amount.'"';
|
530 |
+
}
|
531 |
+
|
532 |
+
|
533 |
+
// SEO Add-on
|
534 |
+
if(has_action('alm_seo_installed') && $seo === 'true'){
|
535 |
+
$seo_return = apply_filters(
|
536 |
+
'alm_seo_shortcode',
|
537 |
+
$seo,
|
538 |
+
$preloaded,
|
539 |
+
$options
|
540 |
+
);
|
541 |
+
$ajaxloadmore .= $seo_return;
|
542 |
+
}
|
543 |
+
|
544 |
+
|
545 |
+
// Previous Post Post Add-on
|
546 |
+
if(has_action('alm_prev_post_installed') && $previous_post){
|
547 |
+
$prev_post_return = apply_filters(
|
548 |
+
'alm_prev_post_shortcode',
|
549 |
+
$previous_post_id,
|
550 |
+
$previous_post_taxonomy,
|
551 |
+
$options
|
552 |
+
);
|
553 |
+
$ajaxloadmore .= $prev_post_return;
|
554 |
+
}
|
555 |
+
|
556 |
+
$ajaxloadmore .= ' data-repeater="'.$repeater.'"';
|
557 |
+
if($theme_repeater != 'null'){
|
558 |
+
$ajaxloadmore .= ' data-theme-repeater="'.$theme_repeater.'"';
|
559 |
+
}
|
560 |
+
$ajaxloadmore .= ' data-post-type="'.$post_type.'"';
|
561 |
+
$ajaxloadmore .= ' data-post-format="'.$post_format.'"';
|
562 |
+
$ajaxloadmore .= ' data-category="'.$category.'"';
|
563 |
+
$ajaxloadmore .= ' data-category-not-in="'.$category__not_in.'"';
|
564 |
+
$ajaxloadmore .= ' data-tag="'.$tag.'"';
|
565 |
+
$ajaxloadmore .= ' data-tag-not-in="'.$tag__not_in.'"';
|
566 |
+
$ajaxloadmore .= ' data-taxonomy="'.$taxonomy.'"';
|
567 |
+
$ajaxloadmore .= ' data-taxonomy-terms="'.$taxonomy_terms.'"';
|
568 |
+
$ajaxloadmore .= ' data-taxonomy-operator="'.$taxonomy_operator.'"';
|
569 |
+
$ajaxloadmore .= ' data-taxonomy-relation="'.$taxonomy_relation.'"';
|
570 |
+
$ajaxloadmore .= ' data-meta-key="'.$meta_key.'"';
|
571 |
+
$ajaxloadmore .= ' data-meta-value="'.$meta_value.'"';
|
572 |
+
$ajaxloadmore .= ' data-meta-compare="'.$meta_compare.'"';
|
573 |
+
$ajaxloadmore .= ' data-meta-relation="'.$meta_relation.'"';
|
574 |
+
$ajaxloadmore .= ' data-meta-type="'.$meta_type.'"';
|
575 |
+
$ajaxloadmore .= ' data-year="'.$year.'"';
|
576 |
+
$ajaxloadmore .= ' data-month="'.$month.'"';
|
577 |
+
$ajaxloadmore .= ' data-day="'.$day.'"';
|
578 |
+
$ajaxloadmore .= ' data-author="'.$author.'"';
|
579 |
+
$ajaxloadmore .= ' data-post-in="'.$post__in.'"';
|
580 |
+
$ajaxloadmore .= ' data-post-not-in="'.$post__not_in.'"';
|
581 |
+
$ajaxloadmore .= ' data-exclude="'.$exclude.'"';
|
582 |
+
$ajaxloadmore .= ' data-search="'.$search.'"';
|
583 |
+
$ajaxloadmore .= ' data-custom-args="'.$custom_args.'"';
|
584 |
+
$ajaxloadmore .= ' data-post-status="'.$post_status.'"';
|
585 |
+
$ajaxloadmore .= ' data-order="'.$order.'"';
|
586 |
+
$ajaxloadmore .= ' data-orderby="'.$orderby.'"';
|
587 |
+
$ajaxloadmore .= ' data-offset="'.$offset.'"';
|
588 |
+
$ajaxloadmore .= ' data-posts-per-page="'.$posts_per_page.'"';
|
589 |
+
$ajaxloadmore .= ' data-lang="'.$lang.'"';
|
590 |
+
$ajaxloadmore .= ' data-scroll="'.$scroll.'"';
|
591 |
+
$ajaxloadmore .= ' data-scroll-distance="'.$scroll_distance.'"';
|
592 |
+
$ajaxloadmore .= ' data-max-pages="'.$max_pages.'"';
|
593 |
+
$ajaxloadmore .= ' data-pause-override="'.$pause_override.'"';
|
594 |
+
$ajaxloadmore .= ' data-pause="'.$pause.'"';
|
595 |
+
$ajaxloadmore .= ' data-button-label="'.$button_label.'"';
|
596 |
+
if(!empty($button_loading_label)){
|
597 |
+
$ajaxloadmore .= ' data-button-loading-label="'.$button_loading_label.'"';
|
598 |
+
}
|
599 |
+
$ajaxloadmore .= ' data-button-class="'.$button_classname.'"';
|
600 |
+
$ajaxloadmore .= ' data-destroy-after="'.$destroy_after.'"';
|
601 |
+
$ajaxloadmore .= ' data-transition="'.$transition.'"';
|
602 |
+
if($transition_speed !== '250')
|
603 |
+
$ajaxloadmore .= ' data-transition-speed="'.$transition_speed.'"';
|
604 |
+
if($transition_container === 'false')
|
605 |
+
$ajaxloadmore .= ' data-transition-container="'.$transition_container.'"';
|
606 |
+
$ajaxloadmore .= ' data-images-loaded="'.$images_loaded.'"';
|
607 |
+
|
608 |
+
$ajaxloadmore .= '>';
|
609 |
+
|
610 |
+
|
611 |
+
// Previous Post Add-on
|
612 |
+
// - Get first post and append to ajax load more object
|
613 |
+
if(has_action('alm_prev_post_installed') && $previous_post){
|
614 |
+
$repeater_type = preg_split('/(?=\d)/', $repeater, 2); // split $repeater at number to retrieve type
|
615 |
+
$repeater_type = $repeater_type[0]; // (default | repeater | template_)
|
616 |
+
if($theme_repeater != 'null' && has_filter('alm_get_theme_repeater')){
|
617 |
+
$repeater_type = null;
|
618 |
+
}
|
619 |
+
// Get next post include and build the output from the next post filter
|
620 |
+
$previous_post_output = '<div class="alm-reveal alm-previous-post post-'. $previous_post_id .'" data-url="'. get_permalink($previous_post_id) .'" data-title="'. get_the_title($previous_post_id) .'" data-id="'. $previous_post_id .'">'; // Set the post id .alm-reveal div
|
621 |
+
$previous_post_output .= apply_filters('alm_prev_post_inc', $repeater, $repeater_type, $theme_repeater, $previous_post_id, $post_type);
|
622 |
+
$previous_post_output .= '</div>';
|
623 |
+
$ajaxloadmore .= $previous_post_output; // Add $next_post_output data to $ajaxloadmore
|
624 |
+
|
625 |
+
}
|
626 |
+
// End Previous Post
|
627 |
+
|
628 |
+
|
629 |
+
$ajaxloadmore .= '</'.$container_element.'>';
|
630 |
+
|
631 |
+
$ajaxloadmore .= apply_filters('alm_before_button', ''); // ALM Core Filter Hook
|
632 |
+
|
633 |
+
$ajaxloadmore .= '</div>';
|
634 |
+
|
635 |
+
$ajaxloadmore .= apply_filters('alm_after_container', ''); // ALM Core Filter Hook
|
636 |
+
|
637 |
+
|
638 |
+
// REST API Add-on - add template to page
|
639 |
+
if(has_action('alm_get_rest_api_template') && $restapi){
|
640 |
+
$rest_type = alm_get_repeater_type($repeater);
|
641 |
+
do_action('alm_get_rest_api_template', $repeater, $rest_type);
|
642 |
+
}
|
643 |
+
|
644 |
+
return $ajaxloadmore; // End ALM object
|
645 |
+
}
|
646 |
+
|
647 |
+
}
|
648 |
+
|
649 |
+
endif;
|
650 |
+
|
core/functions.php
CHANGED
@@ -57,8 +57,7 @@ function alm_get_current_repeater($repeater, $type) {
|
|
57 |
function alm_get_default_repeater() {
|
58 |
global $wpdb;
|
59 |
$file = null;
|
60 |
-
$template_dir = 'alm_templates';
|
61 |
-
|
62 |
|
63 |
// Allow user to load template from theme directory
|
64 |
// Since 2.8.5
|
@@ -294,15 +293,26 @@ function alm_get_tax_query($post_format, $taxonomy, $taxonomy_terms, $taxonomy_o
|
|
294 |
* @since 2.5.0
|
295 |
*/
|
296 |
function alm_get_meta_query($meta_key, $meta_value, $meta_compare, $meta_type){
|
297 |
-
if(!empty($meta_key)
|
298 |
|
299 |
$meta_values = alm_parse_meta_value($meta_value, $meta_compare);
|
300 |
-
$
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
306 |
|
307 |
return $return;
|
308 |
|
@@ -349,6 +359,7 @@ function alm_get_repeater_type($repeater){
|
|
349 |
}
|
350 |
|
351 |
|
|
|
352 |
/*
|
353 |
* alm_paging_no_script
|
354 |
* Create paging navigation
|
57 |
function alm_get_default_repeater() {
|
58 |
global $wpdb;
|
59 |
$file = null;
|
60 |
+
$template_dir = 'alm_templates';
|
|
|
61 |
|
62 |
// Allow user to load template from theme directory
|
63 |
// Since 2.8.5
|
293 |
* @since 2.5.0
|
294 |
*/
|
295 |
function alm_get_meta_query($meta_key, $meta_value, $meta_compare, $meta_type){
|
296 |
+
if(!empty($meta_key)){
|
297 |
|
298 |
$meta_values = alm_parse_meta_value($meta_value, $meta_compare);
|
299 |
+
if(!empty($meta_values)){
|
300 |
+
|
301 |
+
$return = array(
|
302 |
+
'key' => $meta_key,
|
303 |
+
'value' => $meta_values,
|
304 |
+
'compare' => $meta_compare,
|
305 |
+
'type' => $meta_type
|
306 |
+
);
|
307 |
+
}else{
|
308 |
+
// If $meta_values is empty, don't query for 'value'
|
309 |
+
$return = array(
|
310 |
+
'key' => $meta_key,
|
311 |
+
'compare' => $meta_compare,
|
312 |
+
'type' => $meta_type
|
313 |
+
);
|
314 |
+
|
315 |
+
}
|
316 |
|
317 |
return $return;
|
318 |
|
359 |
}
|
360 |
|
361 |
|
362 |
+
|
363 |
/*
|
364 |
* alm_paging_no_script
|
365 |
* Create paging navigation
|
core/js/ajax-load-more.js
CHANGED
@@ -82,8 +82,8 @@
|
|
82 |
alm.comments_type = alm.content.attr('data-comments_type');
|
83 |
alm.comments_style = alm.content.attr('data-comments_style');
|
84 |
alm.comments_template = alm.content.attr('data-comments_template');
|
85 |
-
alm.comments_callback = alm.content.attr('data-comments_callback');
|
86 |
-
|
87 |
alm.seo = alm.content.attr('data-seo'); // true | false
|
88 |
|
89 |
alm.preloaded = alm.content.attr('data-preloaded'); // true | false
|
@@ -92,9 +92,8 @@
|
|
92 |
alm.paging = alm.content.attr('data-paging'); // is paging enabled
|
93 |
alm.paging_controls = alm.content.attr('data-paging-controls');
|
94 |
alm.paging_show_at_most = alm.content.attr('data-paging-show-at-most');
|
95 |
-
alm.paging_classes = alm.content.attr('data-paging-classes');
|
96 |
-
|
97 |
-
|
98 |
/* Paging */
|
99 |
if(alm.paging === 'true'){
|
100 |
alm.paging = true;
|
@@ -218,8 +217,7 @@
|
|
218 |
alm.offset = 0;
|
219 |
}else{
|
220 |
alm.offset = alm.content.attr('data-offset');
|
221 |
-
}
|
222 |
-
|
223 |
|
224 |
/* Check for pause on init
|
225 |
* Pause could be used to hold the loading of posts for a button click.
|
@@ -349,7 +347,6 @@
|
|
349 |
*/
|
350 |
|
351 |
alm.AjaxLoadMore.loadPosts = function () {
|
352 |
-
|
353 |
if(!alm.disable_ajax){ // Check for ajax blocker
|
354 |
if(!alm.paging){
|
355 |
alm.button.addClass('loading');
|
@@ -422,15 +419,16 @@
|
|
422 |
|
423 |
// Set Alternate Query params
|
424 |
if(alm.alternate === 'true'){
|
425 |
-
alm.alternate_array = {
|
426 |
'alternate': 'true',
|
427 |
'alternate_sequence': alm.alternate_sequence,
|
428 |
'alternate_sequence_max': alm.alternate_sequence_max,
|
429 |
'alternate_repeater': alm.alternate_repeater,
|
430 |
'alternate_theme_repeater': alm.alternate_theme_repeater,
|
431 |
};
|
432 |
-
}
|
433 |
-
|
|
|
434 |
$.ajax({
|
435 |
type: "GET",
|
436 |
url: alm_localize.ajaxurl,
|
@@ -491,6 +489,7 @@
|
|
491 |
}
|
492 |
},
|
493 |
success: function (data) {
|
|
|
494 |
if(queryType === 'standard'){
|
495 |
alm.AjaxLoadMore.success(data, false);
|
496 |
}
|
@@ -520,7 +519,7 @@
|
|
520 |
* @since 2.6.0
|
521 |
*/
|
522 |
|
523 |
-
alm.AjaxLoadMore.success = function (data, is_cache) {
|
524 |
|
525 |
if(alm.previous_post){ // Get previous page data
|
526 |
alm.AjaxLoadMore.getPreviousPost();
|
@@ -775,10 +774,10 @@
|
|
775 |
}
|
776 |
}
|
777 |
|
778 |
-
} else {
|
779 |
-
|
780 |
// Is Paging
|
781 |
if(!alm.init){
|
|
|
782 |
$('.alm-paging-content', alm.el).html('').append(alm.data).almWaitForImages().done(function(){ // Remove loading class and append data
|
783 |
$('.alm-paging-loading', alm.el).fadeOut(alm.speed); // Fade out loader
|
784 |
if ($.isFunction($.fn.almOnPagingComplete)){
|
@@ -1005,8 +1004,7 @@
|
|
1005 |
alm.AjaxLoadMore.loadPosts();
|
1006 |
|
1007 |
}
|
1008 |
-
}
|
1009 |
-
|
1010 |
}
|
1011 |
});
|
1012 |
}
|
@@ -1051,10 +1049,12 @@
|
|
1051 |
* @since 2.7.0
|
1052 |
*/
|
1053 |
|
1054 |
-
$.fn.almUpdateCurrentPage = function(current,
|
1055 |
-
|
1056 |
alm.page = current;
|
1057 |
-
|
|
|
|
|
|
|
1058 |
if(alm_paging_init && alm.preloaded === 'true'){
|
1059 |
|
1060 |
var data = $('.alm-preloaded', alm.el).html(); // Content of preloaded page
|
82 |
alm.comments_type = alm.content.attr('data-comments_type');
|
83 |
alm.comments_style = alm.content.attr('data-comments_style');
|
84 |
alm.comments_template = alm.content.attr('data-comments_template');
|
85 |
+
alm.comments_callback = alm.content.attr('data-comments_callback');
|
86 |
+
|
87 |
alm.seo = alm.content.attr('data-seo'); // true | false
|
88 |
|
89 |
alm.preloaded = alm.content.attr('data-preloaded'); // true | false
|
92 |
alm.paging = alm.content.attr('data-paging'); // is paging enabled
|
93 |
alm.paging_controls = alm.content.attr('data-paging-controls');
|
94 |
alm.paging_show_at_most = alm.content.attr('data-paging-show-at-most');
|
95 |
+
alm.paging_classes = alm.content.attr('data-paging-classes');
|
96 |
+
|
|
|
97 |
/* Paging */
|
98 |
if(alm.paging === 'true'){
|
99 |
alm.paging = true;
|
217 |
alm.offset = 0;
|
218 |
}else{
|
219 |
alm.offset = alm.content.attr('data-offset');
|
220 |
+
}
|
|
|
221 |
|
222 |
/* Check for pause on init
|
223 |
* Pause could be used to hold the loading of posts for a button click.
|
347 |
*/
|
348 |
|
349 |
alm.AjaxLoadMore.loadPosts = function () {
|
|
|
350 |
if(!alm.disable_ajax){ // Check for ajax blocker
|
351 |
if(!alm.paging){
|
352 |
alm.button.addClass('loading');
|
419 |
|
420 |
// Set Alternate Query params
|
421 |
if(alm.alternate === 'true'){
|
422 |
+
alm.alternate_array = {
|
423 |
'alternate': 'true',
|
424 |
'alternate_sequence': alm.alternate_sequence,
|
425 |
'alternate_sequence_max': alm.alternate_sequence_max,
|
426 |
'alternate_repeater': alm.alternate_repeater,
|
427 |
'alternate_theme_repeater': alm.alternate_theme_repeater,
|
428 |
};
|
429 |
+
}
|
430 |
+
|
431 |
+
|
432 |
$.ajax({
|
433 |
type: "GET",
|
434 |
url: alm_localize.ajaxurl,
|
489 |
}
|
490 |
},
|
491 |
success: function (data) {
|
492 |
+
//console.log(data);
|
493 |
if(queryType === 'standard'){
|
494 |
alm.AjaxLoadMore.success(data, false);
|
495 |
}
|
519 |
* @since 2.6.0
|
520 |
*/
|
521 |
|
522 |
+
alm.AjaxLoadMore.success = function (data, is_cache) {
|
523 |
|
524 |
if(alm.previous_post){ // Get previous page data
|
525 |
alm.AjaxLoadMore.getPreviousPost();
|
774 |
}
|
775 |
}
|
776 |
|
777 |
+
} else {
|
|
|
778 |
// Is Paging
|
779 |
if(!alm.init){
|
780 |
+
|
781 |
$('.alm-paging-content', alm.el).html('').append(alm.data).almWaitForImages().done(function(){ // Remove loading class and append data
|
782 |
$('.alm-paging-loading', alm.el).fadeOut(alm.speed); // Fade out loader
|
783 |
if ($.isFunction($.fn.almOnPagingComplete)){
|
1004 |
alm.AjaxLoadMore.loadPosts();
|
1005 |
|
1006 |
}
|
1007 |
+
}
|
|
|
1008 |
}
|
1009 |
});
|
1010 |
}
|
1049 |
* @since 2.7.0
|
1050 |
*/
|
1051 |
|
1052 |
+
$.fn.almUpdateCurrentPage = function(current, obj, alm){
|
|
|
1053 |
alm.page = current;
|
1054 |
+
|
1055 |
+
// We will eventually use this function to combine Paging + Preloaded add-ons
|
1056 |
+
var alm_paging_init = false;
|
1057 |
+
// If is paging init and preloaded, grab preloaded data, and append it .alm-reveal
|
1058 |
if(alm_paging_init && alm.preloaded === 'true'){
|
1059 |
|
1060 |
var data = $('.alm-preloaded', alm.el).html(); // Content of preloaded page
|
core/js/ajax-load-more.min.js
CHANGED
@@ -1,1428 +1,95 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
(
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
/* Paging */
|
99 |
-
if(alm.paging === 'true'){
|
100 |
-
alm.paging = true;
|
101 |
-
if(alm.paging_show_at_most === undefined){
|
102 |
-
alm.paging_show_at_most = 7;
|
103 |
-
}
|
104 |
-
// if paging and preload then pause.
|
105 |
-
if(alm.preloaded === 'true'){
|
106 |
-
alm.pause = true;
|
107 |
-
}
|
108 |
-
}else{
|
109 |
-
alm.paging = false;
|
110 |
-
}
|
111 |
-
|
112 |
-
if(alm.paging_controls === 'true'){
|
113 |
-
alm.paging_controls = true;
|
114 |
-
}else{
|
115 |
-
alm.paging_controls = false;
|
116 |
-
}
|
117 |
-
/* /end Paging */
|
118 |
-
|
119 |
-
|
120 |
-
/* Cache */
|
121 |
-
if (alm.cache === undefined){
|
122 |
-
alm.cache = false;
|
123 |
-
}
|
124 |
-
|
125 |
-
if (alm.cache_logged_in === undefined){
|
126 |
-
alm.cache_logged_in = false;
|
127 |
-
}
|
128 |
-
/* /end Cache */
|
129 |
-
|
130 |
-
/* Comments */
|
131 |
-
if (alm.comments_per_page === undefined){
|
132 |
-
alm.comments_per_page = '5';
|
133 |
-
}
|
134 |
-
/* /end Comments
|
135 |
-
|
136 |
-
/* Preloaded */
|
137 |
-
/* Check preloaded posts to ensure posts_per_page > alm.total_posts - if posts_per_page <= total_posts disable ajax load more */
|
138 |
-
if (alm.preloaded === 'true'){
|
139 |
-
alm.preload_wrap = alm.content.prev('.alm-preloaded');
|
140 |
-
alm.total_posts = parseInt(alm.preload_wrap.attr('data-total-posts'));
|
141 |
-
if (alm.preloaded_amount === undefined){
|
142 |
-
alm.preloaded_amount = false;
|
143 |
-
}
|
144 |
-
if (alm.total_posts <= alm.preloaded_amount){
|
145 |
-
alm.disable_ajax = true;
|
146 |
-
}
|
147 |
-
}else{
|
148 |
-
alm.preloaded = 'false';
|
149 |
-
}
|
150 |
-
/* /end Preloaded */
|
151 |
-
|
152 |
-
|
153 |
-
/* SEO */
|
154 |
-
if (alm.seo === undefined){
|
155 |
-
alm.seo = false;
|
156 |
-
}
|
157 |
-
if (alm.seo === 'true'){
|
158 |
-
alm.seo = true; // Convert string to boolean
|
159 |
-
}
|
160 |
-
if($(".ajax-load-more-wrap").length > 1){
|
161 |
-
alm.seo = false;
|
162 |
-
}
|
163 |
-
|
164 |
-
alm.permalink = alm.content.attr('data-seo-permalink');
|
165 |
-
alm.pageview = alm.content.attr('data-seo-pageview');
|
166 |
-
alm.start_page = alm.content.attr('data-seo-start-page');
|
167 |
-
|
168 |
-
if(alm.start_page){
|
169 |
-
|
170 |
-
alm.seo_scroll = alm.content.attr('data-seo-scroll');
|
171 |
-
alm.seo_scroll_speed = alm.content.attr('data-seo-scroll-speed');
|
172 |
-
alm.seo_scrolltop = alm.content.attr('data-seo-scrolltop');
|
173 |
-
|
174 |
-
alm.isPaged = false;
|
175 |
-
|
176 |
-
if (alm.start_page > 1) {
|
177 |
-
alm.isPaged = true; // Is this a $paged page > 1 ?
|
178 |
-
alm.posts_per_page = alm.start_page * alm.posts_per_page;
|
179 |
-
}
|
180 |
-
// If paging is enabled, reset our posts_per_page
|
181 |
-
if(alm.paging){
|
182 |
-
alm.posts_per_page = alm.orginal_posts_per_page;
|
183 |
-
}
|
184 |
-
|
185 |
-
}else{
|
186 |
-
alm.start_page = 1;
|
187 |
-
}
|
188 |
-
/* /end SEO */
|
189 |
-
|
190 |
-
|
191 |
-
/* Previous Post */
|
192 |
-
if (alm.previous_post === 'true'){
|
193 |
-
alm.previous_post = true;
|
194 |
-
alm.previous_post_permalink = '';
|
195 |
-
alm.previous_post_title = '';
|
196 |
-
}else{
|
197 |
-
alm.previous_post = false;
|
198 |
-
}
|
199 |
-
if (alm.previous_post_id === undefined){
|
200 |
-
alm.previous_post_id = '';
|
201 |
-
}
|
202 |
-
if (alm.previous_post_taxonomy === undefined){
|
203 |
-
alm.previous_post_taxonomy = '';
|
204 |
-
}
|
205 |
-
alm.previous_post_title_template = alm.content.attr('data-previous-post-title-template');
|
206 |
-
alm.siteTitle = alm.content.attr('data-previous-post-site-title');
|
207 |
-
alm.siteTagline = alm.content.attr('data-previous-post-site-tagline');
|
208 |
-
alm.previous_post_pageview = alm.content.attr('data-previous-post-pageview');
|
209 |
-
alm.previous_post_scroll = alm.content.attr('data-previous-post-scroll');
|
210 |
-
alm.previous_post_scroll_speed = alm.content.attr('data-previous-post-scroll-speed');
|
211 |
-
alm.previous_post_scroll_top = alm.content.attr('data-previous-post-scrolltop');
|
212 |
-
|
213 |
-
/* /end Previous Post */
|
214 |
-
|
215 |
-
|
216 |
-
/* Define offset */
|
217 |
-
if (alm.content.attr('data-offset') === undefined){
|
218 |
-
alm.offset = 0;
|
219 |
-
}else{
|
220 |
-
alm.offset = alm.content.attr('data-offset');
|
221 |
-
}
|
222 |
-
|
223 |
-
|
224 |
-
/* Check for pause on init
|
225 |
-
* Pause could be used to hold the loading of posts for a button click.
|
226 |
-
*/
|
227 |
-
if (alm.pause === undefined || (alm.seo && alm.start_page > 1)){// SEO only
|
228 |
-
alm.pause = false;
|
229 |
-
}
|
230 |
-
if (alm.preloaded === 'true' && alm.seo && alm.start_page > 0){ // SEO + Preloaded
|
231 |
-
alm.pause = false;
|
232 |
-
}
|
233 |
-
|
234 |
-
|
235 |
-
/* Select the repeater template */
|
236 |
-
if (alm.repeater === undefined){
|
237 |
-
alm.repeater = 'default';
|
238 |
-
}
|
239 |
-
if (alm.theme_repeater === undefined){
|
240 |
-
alm.theme_repeater = 'null';
|
241 |
-
}
|
242 |
-
|
243 |
-
|
244 |
-
/* Max number of pages to load while scrolling */
|
245 |
-
if (alm.max_pages === undefined){
|
246 |
-
alm.max_pages = 5;
|
247 |
-
}
|
248 |
-
|
249 |
-
if (alm.max_pages === 0){
|
250 |
-
alm.max_pages = 10000;
|
251 |
-
}
|
252 |
-
|
253 |
-
|
254 |
-
/* Scroll Distance */
|
255 |
-
if (alm.scroll_distance === undefined){
|
256 |
-
alm.scroll_distance = 150;
|
257 |
-
}
|
258 |
-
|
259 |
-
|
260 |
-
/* Transition Params */
|
261 |
-
if (alm.transition === undefined){
|
262 |
-
alm.transition = 'slide';
|
263 |
-
}else if (alm.transition === "fade"){
|
264 |
-
alm.transition = 'fade';
|
265 |
-
}else if (alm.transition === "none"){
|
266 |
-
alm.transition = 'none';
|
267 |
-
}else {
|
268 |
-
alm.transition = 'slide';
|
269 |
-
}
|
270 |
-
|
271 |
-
if (alm.speed === undefined){
|
272 |
-
alm.speed = 250;
|
273 |
-
} else{
|
274 |
-
alm.speed = parseInt(alm.speed);
|
275 |
-
}
|
276 |
-
|
277 |
-
if (alm.transition_container === undefined || alm.transition_container === 'true'){
|
278 |
-
alm.transition_container = true;
|
279 |
-
}else {
|
280 |
-
alm.transition_container = false;
|
281 |
-
}
|
282 |
-
|
283 |
-
|
284 |
-
/* Images Loaded */
|
285 |
-
if (alm.images_loaded === undefined){
|
286 |
-
alm.images_loaded = 'false';
|
287 |
-
}
|
288 |
-
|
289 |
-
|
290 |
-
/* Destroy After */
|
291 |
-
if (alm.destroy_after !== undefined) {}
|
292 |
-
|
293 |
-
|
294 |
-
/* Button Labels */
|
295 |
-
if (alm.content.attr('data-button-label') === undefined){
|
296 |
-
alm.button_label = 'Older Posts';
|
297 |
-
}else{
|
298 |
-
alm.button_label = alm.content.attr('data-button-label');
|
299 |
-
}
|
300 |
-
|
301 |
-
|
302 |
-
alm.button_loading_label = alm.content.attr('data-button-loading-label');
|
303 |
-
if (alm.button_loading_label === undefined){
|
304 |
-
alm.button_loading_label = false;
|
305 |
-
}
|
306 |
-
|
307 |
-
|
308 |
-
/* Button Class */
|
309 |
-
if (alm.content.attr('data-button-class') === undefined){
|
310 |
-
alm.button_class = '';
|
311 |
-
}else{
|
312 |
-
alm.button_class = ' ' + alm.content.attr('data-button-class');
|
313 |
-
}
|
314 |
-
|
315 |
-
/* Define scroll event */
|
316 |
-
if (alm.content.attr('data-scroll') === undefined){
|
317 |
-
alm.scroll = true;
|
318 |
-
}else if (alm.content.attr('data-scroll') === 'false'){
|
319 |
-
alm.scroll = false;
|
320 |
-
}else{
|
321 |
-
alm.scroll = true;
|
322 |
-
}
|
323 |
-
|
324 |
-
/* Parse multiple Post Types */
|
325 |
-
alm.post_type = alm.content.attr('data-post-type');
|
326 |
-
alm.post_type = alm.post_type.split(",");
|
327 |
-
|
328 |
-
|
329 |
-
/* Append 'load More' button to .ajax-load-more-wrap */
|
330 |
-
alm.container.append('<div class="' + alm.prefix + 'btn-wrap"/>');
|
331 |
-
alm.btnWrap = $('.' + alm.prefix + 'btn-wrap', alm.container);
|
332 |
-
if(alm.paging){
|
333 |
-
// Paging add-on
|
334 |
-
alm.content.parent().addClass('loading'); // add loading class to main container
|
335 |
-
}else{
|
336 |
-
|
337 |
-
|
338 |
-
// If paging is false
|
339 |
-
$('.'+ alm.prefix + 'btn-wrap', alm.container).append('<button id="load-more" class="' + alm.prefix + 'load-more-btn more'+ alm.button_class +'">' + alm.button_label + '</button>');
|
340 |
-
alm.button = $('.alm-load-more-btn', alm.container);
|
341 |
-
}
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
/* alm.AjaxLoadMore.loadPosts()
|
346 |
-
*
|
347 |
-
* The function to get posts via Ajax
|
348 |
-
* @since 2.0.0
|
349 |
-
*/
|
350 |
-
|
351 |
-
alm.AjaxLoadMore.loadPosts = function () {
|
352 |
-
|
353 |
-
if(!alm.disable_ajax){ // Check for ajax blocker
|
354 |
-
if(!alm.paging){
|
355 |
-
alm.button.addClass('loading');
|
356 |
-
if(alm.button_loading_label !== false){
|
357 |
-
alm.button.text(alm.button_loading_label);
|
358 |
-
}
|
359 |
-
}
|
360 |
-
alm.loading = true;
|
361 |
-
|
362 |
-
// If cache = true && cache_logged_in setting is false
|
363 |
-
if(alm.cache === 'true' && !alm.cache_logged_in){
|
364 |
-
if(alm.init && alm.seo && alm.isPaged){
|
365 |
-
|
366 |
-
// if alm.init = true, SEO = true and SEO page > 1
|
367 |
-
// - skip cache build process because we can't build cache from multiple loaded queries
|
368 |
-
alm.AjaxLoadMore.ajax('standard');
|
369 |
-
|
370 |
-
} else {
|
371 |
-
// Build and/or get cache
|
372 |
-
var cachePage = alm.cache_path + '/page-' + alm.page +'.html';
|
373 |
-
|
374 |
-
$.get(cachePage, function( data ) {
|
375 |
-
alm.AjaxLoadMore.success(data, true); // data contains whatever the request has returned
|
376 |
-
}).fail(function() {
|
377 |
-
alm.AjaxLoadMore.ajax('standard');
|
378 |
-
});
|
379 |
-
}
|
380 |
-
|
381 |
-
} else { // Standard ALM query
|
382 |
-
|
383 |
-
alm.AjaxLoadMore.ajax('standard');
|
384 |
-
|
385 |
-
}
|
386 |
-
}
|
387 |
-
|
388 |
-
};
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
/* alm.AjaxLoadMore.ajax()
|
393 |
-
*
|
394 |
-
* Ajax Load Moe Ajax function
|
395 |
-
* @since 2.6.0
|
396 |
-
*/
|
397 |
-
|
398 |
-
alm.AjaxLoadMore.ajax = function (queryType) {
|
399 |
-
|
400 |
-
if(alm.previous_post){
|
401 |
-
alm.previous_post_id = alm.content.attr('data-previous-post-id');
|
402 |
-
alm.previous_post_taxonomy = alm.content.attr('data-previous-post-taxonomy');
|
403 |
-
}
|
404 |
-
|
405 |
-
var action = 'alm_query_posts';
|
406 |
-
|
407 |
-
// If this is a comment query
|
408 |
-
if(alm.comments === 'true'){
|
409 |
-
action = 'alm_comments_query';
|
410 |
-
alm.posts_per_page = alm.comments_per_page;
|
411 |
-
alm.comments_array = {
|
412 |
-
'comments': 'true',
|
413 |
-
'post_id': alm.comments_post_id,
|
414 |
-
'per_page': alm.comments_per_page,
|
415 |
-
'type': alm.comments_type,
|
416 |
-
'style': alm.comments_style,
|
417 |
-
'template': alm.comments_template,
|
418 |
-
'callback': alm.comments_callback,
|
419 |
-
};
|
420 |
-
|
421 |
-
}
|
422 |
-
|
423 |
-
// Set Alternate Query params
|
424 |
-
if(alm.alternate === 'true'){
|
425 |
-
alm.alternate_array = {
|
426 |
-
'alternate': 'true',
|
427 |
-
'alternate_sequence': alm.alternate_sequence,
|
428 |
-
'alternate_sequence_max': alm.alternate_sequence_max,
|
429 |
-
'alternate_repeater': alm.alternate_repeater,
|
430 |
-
'alternate_theme_repeater': alm.alternate_theme_repeater,
|
431 |
-
};
|
432 |
-
}
|
433 |
-
|
434 |
-
$.ajax({
|
435 |
-
type: "GET",
|
436 |
-
url: alm_localize.ajaxurl,
|
437 |
-
data: {
|
438 |
-
action: action,
|
439 |
-
query_type: queryType,
|
440 |
-
nonce: alm_localize.alm_nonce,
|
441 |
-
cache_id: alm.cache_id,
|
442 |
-
repeater: alm.repeater,
|
443 |
-
theme_repeater: alm.theme_repeater,
|
444 |
-
alternate: alm.alternate_array,
|
445 |
-
comments: alm.comments_array,
|
446 |
-
post_type: alm.post_type,
|
447 |
-
post_format: alm.content.attr('data-post-format'),
|
448 |
-
category: alm.content.attr('data-category'),
|
449 |
-
category__not_in: alm.content.attr('data-category-not-in'),
|
450 |
-
tag: alm.content.attr('data-tag'),
|
451 |
-
tag__not_in: alm.content.attr('data-tag-not-in'),
|
452 |
-
taxonomy: alm.content.attr('data-taxonomy'),
|
453 |
-
taxonomy_terms: alm.content.attr('data-taxonomy-terms'),
|
454 |
-
taxonomy_operator: alm.content.attr('data-taxonomy-operator'),
|
455 |
-
taxonomy_relation: alm.content.attr('data-taxonomy-relation'),
|
456 |
-
meta_key: alm.content.attr('data-meta-key'),
|
457 |
-
meta_value: alm.content.attr('data-meta-value'),
|
458 |
-
meta_compare: alm.content.attr('data-meta-compare'),
|
459 |
-
meta_relation: alm.content.attr('data-meta-relation'),
|
460 |
-
meta_type: alm.content.attr('data-meta-type'),
|
461 |
-
author: alm.content.attr('data-author'),
|
462 |
-
year: alm.content.attr('data-year'),
|
463 |
-
month: alm.content.attr('data-month'),
|
464 |
-
day: alm.content.attr('data-day'),
|
465 |
-
post_status: alm.content.attr('data-post-status'),
|
466 |
-
order: alm.content.attr('data-order'),
|
467 |
-
orderby: alm.content.attr('data-orderby'),
|
468 |
-
post__in: alm.content.attr('data-post-in'),
|
469 |
-
post__not_in: alm.content.attr('data-post-not-in'),
|
470 |
-
exclude: alm.content.attr('data-exclude'), // Deprecate soon in favor of post__not_in
|
471 |
-
search: alm.content.attr('data-search'),
|
472 |
-
custom_args: alm.content.attr('data-custom-args'),
|
473 |
-
posts_per_page: alm.posts_per_page,
|
474 |
-
pageNumber: alm.page,
|
475 |
-
offset: alm.offset,
|
476 |
-
preloaded: alm.preloaded,
|
477 |
-
preloaded_amount: alm.preloaded_amount,
|
478 |
-
seo_start_page: alm.start_page,
|
479 |
-
previous_post: alm.previous_post,
|
480 |
-
previous_post_id: alm.previous_post_id,
|
481 |
-
previous_post_taxonomy: alm.previous_post_taxonomy,
|
482 |
-
lang: alm.lang,
|
483 |
-
slug: alm.slug,
|
484 |
-
canonical_url: alm.canonical_url,
|
485 |
-
},
|
486 |
-
dataType: "JSON",
|
487 |
-
// parse the data as html
|
488 |
-
beforeSend: function () {
|
489 |
-
if (alm.page != 1 && !alm.paging) {
|
490 |
-
alm.button.addClass('loading');
|
491 |
-
}
|
492 |
-
},
|
493 |
-
success: function (data) {
|
494 |
-
if(queryType === 'standard'){
|
495 |
-
alm.AjaxLoadMore.success(data, false);
|
496 |
-
}
|
497 |
-
else if(queryType === 'totalposts' && alm.paging){
|
498 |
-
if($.isFunction($.fn.almBuildPagination)){
|
499 |
-
$.fn.almBuildPagination(data, alm);
|
500 |
-
}
|
501 |
-
}
|
502 |
-
|
503 |
-
},
|
504 |
-
error: function (jqXHR, textStatus, errorThrown) {
|
505 |
-
alm.AjaxLoadMore.error(jqXHR, textStatus, errorThrown);
|
506 |
-
}
|
507 |
-
});
|
508 |
-
};
|
509 |
-
|
510 |
-
// If pagination enabled, run totalposts query
|
511 |
-
if(alm.paging){
|
512 |
-
alm.AjaxLoadMore.ajax('totalposts'); // Create paging menu and query for total posts
|
513 |
-
}
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
/* alm.AjaxLoadMore.success()
|
518 |
-
*
|
519 |
-
* Success function after loading data
|
520 |
-
* @since 2.6.0
|
521 |
-
*/
|
522 |
-
|
523 |
-
alm.AjaxLoadMore.success = function (data, is_cache) {
|
524 |
-
|
525 |
-
if(alm.previous_post){ // Get previous page data
|
526 |
-
alm.AjaxLoadMore.getPreviousPost();
|
527 |
-
}
|
528 |
-
var html;
|
529 |
-
|
530 |
-
if(!is_cache){
|
531 |
-
html = data.html;
|
532 |
-
}else{
|
533 |
-
html = data; // If is cache, don't look for json data
|
534 |
-
}
|
535 |
-
|
536 |
-
alm.data = $(html); // Convert data to an object
|
537 |
-
|
538 |
-
if (alm.init) {
|
539 |
-
if(!alm.paging){
|
540 |
-
|
541 |
-
alm.button.text(alm.button_label);
|
542 |
-
|
543 |
-
} else {
|
544 |
-
|
545 |
-
// Is pagination
|
546 |
-
if (alm.data.length > 0) {
|
547 |
-
alm.el = $('<div class="alm-reveal"/>');
|
548 |
-
alm.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>');
|
549 |
-
$('.alm-paging-content', alm.el).append(alm.data).hide();
|
550 |
-
alm.content.append(alm.el);
|
551 |
-
alm.content.parent().removeClass('loading'); // Remove loading class from main container
|
552 |
-
alm.resetBtnText();
|
553 |
-
|
554 |
-
$('.alm-paging-content', alm.el).fadeIn( alm.speed, 'alm_easeInOutQuad', function(){
|
555 |
-
var paddingT = parseInt(alm.content.css('padding-top')),
|
556 |
-
paddingB = parseInt(alm.content.css('padding-bottom'));
|
557 |
-
alm.content.css('height', alm.el.height() + paddingT + paddingB + 'px');
|
558 |
-
if ($.isFunction($.fn.almFadePageControls)){
|
559 |
-
$.fn.almFadePageControls(alm.btnWrap);
|
560 |
-
}
|
561 |
-
});
|
562 |
-
}
|
563 |
-
|
564 |
-
}
|
565 |
-
|
566 |
-
// ALM Empty - triggers if zero results were returned
|
567 |
-
if(alm.data.length === 0){
|
568 |
-
if ($.isFunction($.fn.almEmpty)) {
|
569 |
-
$.fn.almEmpty(alm);
|
570 |
-
}
|
571 |
-
}
|
572 |
-
|
573 |
-
// isPaged
|
574 |
-
if(alm.isPaged){
|
575 |
-
alm.posts_per_page = alm.content.attr('data-posts-per-page'); // Reset our posts per page variable
|
576 |
-
alm.page = alm.start_page - 1; // Set our new page #
|
577 |
-
}
|
578 |
-
}
|
579 |
-
|
580 |
-
// We have results!
|
581 |
-
if (alm.data.length > 0) {
|
582 |
-
if(!alm.paging){
|
583 |
-
|
584 |
-
if(alm.previous_post){ // If Previous Post, create container and append data
|
585 |
-
|
586 |
-
alm.el = $('<div class="alm-reveal alm-previous-post post-'+alm.previous_post_id+'" data-id="'+alm.previous_post_id+'" data-title="'+alm.previous_post_title+'" data-url="'+alm.previous_post_permalink+'"/>');
|
587 |
-
alm.el.append(alm.data).hide();
|
588 |
-
|
589 |
-
}else{
|
590 |
-
|
591 |
-
if(!alm.transition_container){
|
592 |
-
// If transiton container == false
|
593 |
-
alm.data.hide();
|
594 |
-
alm.el = alm.data;
|
595 |
-
|
596 |
-
}else{
|
597 |
-
// Standard transition container
|
598 |
-
|
599 |
-
// if start_page is > 1
|
600 |
-
// - loop through items and break them separate alm-reveal divs
|
601 |
-
if (alm.init && alm.start_page > 1){
|
602 |
-
|
603 |
-
var data = [];
|
604 |
-
var size = Math.ceil(alm.data.length/alm.start_page); // slice data array into pages
|
605 |
-
//console.log(size);
|
606 |
-
for (var i = 0; i < alm.data.length; i += size) {
|
607 |
-
data.push(alm.data.slice(i, size + i));
|
608 |
-
}
|
609 |
-
|
610 |
-
alm.el = alm.content; // Set alm.el to be alm-listing div
|
611 |
-
for (var k = 0; k < data.length; k++){
|
612 |
-
|
613 |
-
var p = 0; // Add 1 page if items are preloaded.
|
614 |
-
if(alm.preloaded === 'true'){
|
615 |
-
p = 1;
|
616 |
-
}
|
617 |
-
|
618 |
-
var div;
|
619 |
-
if(k > 0 || alm.preloaded === 'true'){ // > Paged
|
620 |
-
var pagenum = (k + 1 + p);
|
621 |
-
if(alm.permalink === 'default'){
|
622 |
-
div = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'&paged='+ pagenum+'" data-page="'+ pagenum +'" />');
|
623 |
-
}else{
|
624 |
-
div = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'page/'+ pagenum +'/" data-page="'+ pagenum +'" />');
|
625 |
-
}
|
626 |
-
}else{ // First Page
|
627 |
-
div = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'" data-page="1" />');
|
628 |
-
}
|
629 |
-
div.append(data[k]);
|
630 |
-
div = $(div); // convert to object
|
631 |
-
alm.el.append(div).hide(); // Add data to .alm-listing wrapper
|
632 |
-
}
|
633 |
-
}
|
634 |
-
|
635 |
-
else {
|
636 |
-
// If is SEO and paged, or preloaded.
|
637 |
-
if(alm.seo && alm.page > 0 || alm.preloaded === 'true'){
|
638 |
-
|
639 |
-
var p = 0; // Add 1 page if items are preloaded.
|
640 |
-
if(alm.preloaded === 'true'){
|
641 |
-
p = 1;
|
642 |
-
}
|
643 |
-
// SEO [Paged]
|
644 |
-
var pagenum = (alm.page + 1 + p);
|
645 |
-
if(alm.seo){
|
646 |
-
if(alm.permalink === 'default'){
|
647 |
-
alm.el = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'&paged='+ pagenum+'" data-page="'+ pagenum +'" />');
|
648 |
-
}else{
|
649 |
-
alm.el = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'page/'+ pagenum +'/" data-page="'+ pagenum +'" />');
|
650 |
-
}
|
651 |
-
}else{
|
652 |
-
// Basic ALM ****
|
653 |
-
alm.el = $('<div class="alm-reveal" />');
|
654 |
-
}
|
655 |
-
|
656 |
-
}else{
|
657 |
-
if(alm.seo){
|
658 |
-
// SEO [Page 1]
|
659 |
-
alm.el = $('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'" data-page="1" />');
|
660 |
-
}else{
|
661 |
-
// Basic ALM ****
|
662 |
-
alm.el = $('<div class="alm-reveal" />');
|
663 |
-
}
|
664 |
-
}
|
665 |
-
|
666 |
-
alm.el.append(alm.data).hide();
|
667 |
-
}
|
668 |
-
}
|
669 |
-
}
|
670 |
-
|
671 |
-
alm.content.append(alm.el);
|
672 |
-
|
673 |
-
if (alm.transition === 'fade') { // Fade transition
|
674 |
-
if(alm.images_loaded === 'true'){
|
675 |
-
alm.el.almWaitForImages().done(function(){
|
676 |
-
alm.el.fadeIn(alm.speed, 'alm_easeInOutQuad', function () {
|
677 |
-
alm.loading = false;
|
678 |
-
if(!alm.paging){
|
679 |
-
alm.button.delay(alm.speed).removeClass('loading');
|
680 |
-
alm.resetBtnText();
|
681 |
-
}
|
682 |
-
if (alm.data.length < alm.posts_per_page) {
|
683 |
-
alm.finished = true;
|
684 |
-
if(!alm.paging){
|
685 |
-
alm.button.addClass('done');
|
686 |
-
}
|
687 |
-
}
|
688 |
-
if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
|
689 |
-
$.fn.almSEO(alm);
|
690 |
-
}
|
691 |
-
});
|
692 |
-
});
|
693 |
-
}else{
|
694 |
-
alm.el.fadeIn(alm.speed, 'alm_easeInOutQuad', function () {
|
695 |
-
alm.loading = false;
|
696 |
-
if(!alm.paging){
|
697 |
-
alm.button.delay(alm.speed).removeClass('loading');
|
698 |
-
alm.resetBtnText();
|
699 |
-
}
|
700 |
-
if (alm.data.length < alm.posts_per_page) {
|
701 |
-
alm.finished = true;
|
702 |
-
if(!alm.paging){
|
703 |
-
alm.button.addClass('done');
|
704 |
-
}
|
705 |
-
}
|
706 |
-
if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
|
707 |
-
$.fn.almSEO(alm);
|
708 |
-
}
|
709 |
-
});
|
710 |
-
}
|
711 |
-
|
712 |
-
}else if(alm.transition === 'none') { // No transition
|
713 |
-
if(alm.images_loaded === 'true'){
|
714 |
-
alm.el.almWaitForImages().done(function(){
|
715 |
-
alm.el.show();
|
716 |
-
if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
|
717 |
-
$.fn.almSEO(alm);
|
718 |
-
}
|
719 |
-
});
|
720 |
-
}else{
|
721 |
-
alm.el.show();
|
722 |
-
if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
|
723 |
-
$.fn.almSEO(alm);
|
724 |
-
}
|
725 |
-
}
|
726 |
-
alm.loading = false;
|
727 |
-
if(!alm.paging){
|
728 |
-
alm.button.delay(alm.speed).removeClass('loading');
|
729 |
-
alm.resetBtnText();
|
730 |
-
}
|
731 |
-
if (alm.data.length < alm.posts_per_page) {
|
732 |
-
alm.finished = true;
|
733 |
-
if(!alm.paging){
|
734 |
-
alm.button.addClass('done');
|
735 |
-
}
|
736 |
-
}
|
737 |
-
|
738 |
-
}else { // Slide transition
|
739 |
-
if(alm.images_loaded === 'true'){
|
740 |
-
alm.el.almWaitForImages().done(function(){
|
741 |
-
alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function () {
|
742 |
-
alm.loading = false;
|
743 |
-
if(!alm.paging){
|
744 |
-
alm.button.delay(alm.speed).removeClass('loading');
|
745 |
-
alm.resetBtnText();
|
746 |
-
}
|
747 |
-
if (alm.data.length < alm.posts_per_page) {
|
748 |
-
alm.finished = true;
|
749 |
-
if(!alm.paging){
|
750 |
-
alm.button.addClass('done');
|
751 |
-
}
|
752 |
-
}
|
753 |
-
if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
|
754 |
-
$.fn.almSEO(alm);
|
755 |
-
}
|
756 |
-
});
|
757 |
-
});
|
758 |
-
}else{
|
759 |
-
alm.el.slideDown(alm.speed, 'alm_easeInOutQuad', function () {
|
760 |
-
alm.loading = false;
|
761 |
-
if(!alm.paging){
|
762 |
-
alm.button.delay(alm.speed).removeClass('loading');
|
763 |
-
alm.resetBtnText();
|
764 |
-
}
|
765 |
-
if (alm.data.length < alm.posts_per_page) {
|
766 |
-
alm.finished = true;
|
767 |
-
if(!alm.paging){
|
768 |
-
alm.button.addClass('done');
|
769 |
-
}
|
770 |
-
}
|
771 |
-
if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
|
772 |
-
$.fn.almSEO(alm);
|
773 |
-
}
|
774 |
-
});
|
775 |
-
}
|
776 |
-
}
|
777 |
-
|
778 |
-
} else {
|
779 |
-
|
780 |
-
// Is Paging
|
781 |
-
if(!alm.init){
|
782 |
-
$('.alm-paging-content', alm.el).html('').append(alm.data).almWaitForImages().done(function(){ // Remove loading class and append data
|
783 |
-
$('.alm-paging-loading', alm.el).fadeOut(alm.speed); // Fade out loader
|
784 |
-
if ($.isFunction($.fn.almOnPagingComplete)){
|
785 |
-
$.fn.almOnPagingComplete(alm);
|
786 |
-
}
|
787 |
-
if ($.isFunction($.fn.almSEO) && alm.seo) { // ALM SEO
|
788 |
-
$.fn.almSEO(alm);
|
789 |
-
}
|
790 |
-
});
|
791 |
-
}
|
792 |
-
}
|
793 |
-
|
794 |
-
// ALM Complete
|
795 |
-
if ($.isFunction($.fn.almComplete)) {
|
796 |
-
if(alm.images_loaded === 'true'){
|
797 |
-
alm.el.almWaitForImages().done(function(){
|
798 |
-
$.fn.almComplete(alm);
|
799 |
-
});
|
800 |
-
}else{
|
801 |
-
$.fn.almComplete(alm);
|
802 |
-
}
|
803 |
-
}
|
804 |
-
|
805 |
-
// ALM Done
|
806 |
-
// - If data is returned but it's less than the posts per page.
|
807 |
-
if(alm.data.length < alm.posts_per_page){
|
808 |
-
if ($.isFunction($.fn.almDone)) {
|
809 |
-
// Delay done until after animation
|
810 |
-
setTimeout(function(){
|
811 |
-
$.fn.almDone(alm)
|
812 |
-
}, alm.speed + 10);
|
813 |
-
}
|
814 |
-
}
|
815 |
-
|
816 |
-
} else {
|
817 |
-
|
818 |
-
if(!alm.paging){
|
819 |
-
alm.button.delay(alm.speed).removeClass('loading').addClass('done');
|
820 |
-
alm.resetBtnText();
|
821 |
-
}
|
822 |
-
|
823 |
-
// ALM Done
|
824 |
-
if ($.isFunction($.fn.almDone) && !alm.init) {
|
825 |
-
$.fn.almDone(alm);
|
826 |
-
}
|
827 |
-
|
828 |
-
alm.loading = false;
|
829 |
-
alm.finished = true;
|
830 |
-
}
|
831 |
-
|
832 |
-
// Destroy After param
|
833 |
-
if (alm.destroy_after !== undefined && alm.destroy_after !== '') {
|
834 |
-
var currentPage = alm.page + 1; // Add 1 because alm.page starts at 0
|
835 |
-
|
836 |
-
if(alm.preload){
|
837 |
-
currentPage++;
|
838 |
-
}
|
839 |
-
|
840 |
-
if(currentPage == alm.destroy_after){ // - Disable ALM is page = alm.destroy_after value
|
841 |
-
alm.disable_ajax = true;
|
842 |
-
if(!alm.paging){
|
843 |
-
alm.button.delay(alm.speed).fadeOut(alm.speed);
|
844 |
-
}
|
845 |
-
}
|
846 |
-
}
|
847 |
-
alm.init = false;
|
848 |
-
|
849 |
-
};
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
/* alm.AjaxLoadMore.getPreviousPost()
|
854 |
-
*
|
855 |
-
* Get the previous post ID via ajax
|
856 |
-
* @since 2.7.4
|
857 |
-
*/
|
858 |
-
alm.fetchingPreviousPost = false;
|
859 |
-
alm.AjaxLoadMore.getPreviousPost = function () {
|
860 |
-
alm.fetchingPreviousPost = true;
|
861 |
-
$.ajax({
|
862 |
-
type: "GET",
|
863 |
-
dataType: "JSON",
|
864 |
-
url: alm_localize.ajaxurl,
|
865 |
-
data: {
|
866 |
-
action: 'alm_query_previous_post',
|
867 |
-
id: alm.previous_post_id,
|
868 |
-
taxonomy: alm.previous_post_taxonomy
|
869 |
-
},
|
870 |
-
success: function (data) {
|
871 |
-
if(data.has_previous_post){
|
872 |
-
alm.content.attr('data-previous-post-id', data.prev_id); // update previous-post-id on ALM element
|
873 |
-
alm.previous_post_permalink = data.prev_permalink;
|
874 |
-
alm.previous_post_title = data.prev_title;
|
875 |
-
}else{
|
876 |
-
if(!data.has_previous_post){
|
877 |
-
alm.finished = true;
|
878 |
-
alm.button.addClass('done');
|
879 |
-
if ($.isFunction($.fn.almDone)) { // ALM Done
|
880 |
-
$.fn.almDone(alm);
|
881 |
-
}
|
882 |
-
}
|
883 |
-
}
|
884 |
-
if($.isFunction($.fn.almSetPreviousPost)){
|
885 |
-
$.fn.almSetPreviousPost(alm, data.current_id, data.permalink, data.title);
|
886 |
-
}
|
887 |
-
alm.fetchingPreviousPost = false;
|
888 |
-
},
|
889 |
-
error: function (jqXHR, textStatus, errorThrown) {
|
890 |
-
alm.AjaxLoadMore.error(jqXHR, textStatus, errorThrown);
|
891 |
-
alm.fetchingPreviousPost = false;
|
892 |
-
}
|
893 |
-
|
894 |
-
});
|
895 |
-
};
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
/* alm.resetBtnText()
|
900 |
-
*
|
901 |
-
* Resets the loading button text after loading has completed
|
902 |
-
* @since 2.8.4
|
903 |
-
*/
|
904 |
-
alm.resetBtnText = function(){
|
905 |
-
if(alm.button_loading_label !== false){ // Reset button text
|
906 |
-
if(!alm.paging){
|
907 |
-
alm.button.text(alm.button_label);
|
908 |
-
}
|
909 |
-
}
|
910 |
-
};
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
/* alm.AjaxLoadMore.error()
|
915 |
-
*
|
916 |
-
* Error function after failed data
|
917 |
-
* @since 2.6.0
|
918 |
-
*/
|
919 |
-
|
920 |
-
alm.AjaxLoadMore.error = function (jqXHR, textStatus, errorThrown) {
|
921 |
-
alm.loading = false;
|
922 |
-
if(!alm.paging){
|
923 |
-
alm.button.removeClass('loading');
|
924 |
-
alm.resetBtnText();
|
925 |
-
}
|
926 |
-
console.log(errorThrown);
|
927 |
-
};
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
/* Button onClick()
|
932 |
-
*
|
933 |
-
* Load more button click event
|
934 |
-
* @since 1.0.0
|
935 |
-
*/
|
936 |
-
|
937 |
-
if(!alm.paging && !alm.fetchingPreviousPost){
|
938 |
-
alm.button.on('click', function () {
|
939 |
-
if (alm.pause === 'true') {
|
940 |
-
alm.pause = false;
|
941 |
-
alm.pause_override = false;
|
942 |
-
alm.AjaxLoadMore.loadPosts();
|
943 |
-
}
|
944 |
-
if (!alm.loading && !alm.finished && !$(this).hasClass('done')) {
|
945 |
-
alm.loading = true;
|
946 |
-
alm.page++;
|
947 |
-
alm.AjaxLoadMore.loadPosts();
|
948 |
-
}
|
949 |
-
});
|
950 |
-
}
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
if(alm.paging){
|
955 |
-
alm.window.resize(function() {
|
956 |
-
if ($.isFunction($.fn.almOnWindowResize)){
|
957 |
-
setTimeout(function(){
|
958 |
-
$.fn.almOnWindowResize(alm);
|
959 |
-
}, 250);
|
960 |
-
}
|
961 |
-
});
|
962 |
-
}
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
/* alm.AjaxLoadMore.isVisible()
|
967 |
-
*
|
968 |
-
* Check to see if element is visible before loading posts
|
969 |
-
* @since 2.1.2
|
970 |
-
*/
|
971 |
-
|
972 |
-
alm.AjaxLoadMore.isVisible = function () {
|
973 |
-
alm.visible = false;
|
974 |
-
if (alm.el.is(":visible")) {
|
975 |
-
alm.visible = true;
|
976 |
-
}
|
977 |
-
return alm.visible;
|
978 |
-
};
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
/* Window scroll and touchmove events
|
983 |
-
*
|
984 |
-
* Load posts as user scrolls the page
|
985 |
-
* @since 1.0
|
986 |
-
*/
|
987 |
-
if (alm.scroll && !alm.paging) {
|
988 |
-
alm.window.bind("scroll touchstart", function () {
|
989 |
-
if (alm.AjaxLoadMore.isVisible() && !alm.fetchingPreviousPost) {
|
990 |
-
|
991 |
-
var content_offset = alm.button.offset(),
|
992 |
-
top = Math.round(content_offset.top - (alm.window.height() - alm.scroll_distance));
|
993 |
-
|
994 |
-
// Pause Override
|
995 |
-
if(!alm.loading && !alm.finished && (alm.window.scrollTop() >= top) && alm.page < (alm.max_pages - 1) && alm.proceed && alm.pause === 'true' && alm.pause_override === 'true'){
|
996 |
-
// If Pause && Pause Override
|
997 |
-
alm.button.trigger('click');
|
998 |
-
|
999 |
-
}
|
1000 |
-
// Standard Scroll event
|
1001 |
-
else{
|
1002 |
-
if (!alm.loading && !alm.finished && (alm.window.scrollTop() >= top) && alm.page < (alm.max_pages - 1) && alm.proceed && alm.pause !== 'true') {
|
1003 |
-
|
1004 |
-
alm.page++;
|
1005 |
-
alm.AjaxLoadMore.loadPosts();
|
1006 |
-
|
1007 |
-
}
|
1008 |
-
}
|
1009 |
-
|
1010 |
-
}
|
1011 |
-
});
|
1012 |
-
}
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
/* Init Ajax load More
|
1017 |
-
*
|
1018 |
-
* Load posts as user scrolls the page
|
1019 |
-
* @since 2.0
|
1020 |
-
*/
|
1021 |
-
if(!alm.paging && !alm.previous_post){
|
1022 |
-
if(alm.disable_ajax){
|
1023 |
-
alm.finished = true;
|
1024 |
-
alm.button.addClass('done');
|
1025 |
-
}else{
|
1026 |
-
if (alm.pause === 'true') {
|
1027 |
-
alm.button.text(alm.button_label);
|
1028 |
-
alm.loading = false;
|
1029 |
-
} else {
|
1030 |
-
alm.AjaxLoadMore.loadPosts();
|
1031 |
-
}
|
1032 |
-
}
|
1033 |
-
}
|
1034 |
-
if(alm.previous_post){
|
1035 |
-
alm.AjaxLoadMore.getPreviousPost(); // Set next post on load
|
1036 |
-
alm.loading = false;
|
1037 |
-
}
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
//flag to prevent unnecessary loading of post on init. Hold for 1 second
|
1042 |
-
setTimeout(function () {
|
1043 |
-
alm.proceed = true;
|
1044 |
-
}, 500);
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
/* $.fn.almUpdateCurrentPage()
|
1049 |
-
*
|
1050 |
-
* Update current page - triggered from paging add-on
|
1051 |
-
* @since 2.7.0
|
1052 |
-
*/
|
1053 |
-
|
1054 |
-
$.fn.almUpdateCurrentPage = function(current, alm_paging_init){
|
1055 |
-
|
1056 |
-
alm.page = current;
|
1057 |
-
// If is paging and preloaded
|
1058 |
-
if(alm_paging_init && alm.preloaded === 'true'){
|
1059 |
-
|
1060 |
-
var data = $('.alm-preloaded', alm.el).html(); // Content of preloaded page
|
1061 |
-
$('.alm-preloaded', alm.el).remove();
|
1062 |
-
alm.preloaded_amount = 0; // Reset
|
1063 |
-
alm.AjaxLoadMore.success(data, false); // Skip post loading and go right to success() for display
|
1064 |
-
|
1065 |
-
}else{
|
1066 |
-
|
1067 |
-
alm.AjaxLoadMore.loadPosts();
|
1068 |
-
|
1069 |
-
}
|
1070 |
-
};
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
/* $.fn.almGetParentContainer()
|
1075 |
-
*
|
1076 |
-
* return the parent ALM container
|
1077 |
-
*
|
1078 |
-
* @since 2.7.0
|
1079 |
-
* @return element
|
1080 |
-
*/
|
1081 |
-
$.fn.almGetParentContainer = function(){
|
1082 |
-
return alm.el.closest('#ajax-load-more'); // Return the parent #ajax-load-more div
|
1083 |
-
};
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
/* $.fn.almGetObj()
|
1088 |
-
*
|
1089 |
-
* return the current ALM obj
|
1090 |
-
*
|
1091 |
-
* @since 2.7.0
|
1092 |
-
* @return object
|
1093 |
-
*/
|
1094 |
-
$.fn.almGetObj = function(){
|
1095 |
-
return alm; // Return the entire alm object
|
1096 |
-
};
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
//Custom easing function
|
1101 |
-
$.easing.alm_easeInOutQuad = function (x, t, b, c, d) {
|
1102 |
-
if ((t /= d / 2) < 1) { return c / 2 * t * t + b; }
|
1103 |
-
return -c / 2 * ((--t) * (t - 2) - 1) + b;
|
1104 |
-
};
|
1105 |
-
|
1106 |
-
};
|
1107 |
-
|
1108 |
-
// End $.ajaxloadmore
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
/* $.fn.almFilter(type, speed, data)
|
1113 |
-
*
|
1114 |
-
* Filter Ajax Load More
|
1115 |
-
* @type ('slide', 'fade', null);
|
1116 |
-
* @speed '300';
|
1117 |
-
* @data obj;
|
1118 |
-
*
|
1119 |
-
* @since 2.6.1
|
1120 |
-
*/
|
1121 |
-
$.fn.almFilter = function (transition, speed, data) {
|
1122 |
-
|
1123 |
-
$(".ajax-load-more-wrap").each(function (e) {
|
1124 |
-
var el = $(this);
|
1125 |
-
if(transition === 'slide'){ // Slide transition
|
1126 |
-
el.slideUp(speed, function(){
|
1127 |
-
$('.alm-listing', el).html(''); // Clear listings
|
1128 |
-
$('.alm-btn-wrap', el).remove(); // remove buttons
|
1129 |
-
el.fadeIn(speed);
|
1130 |
-
|
1131 |
-
$.fn.almSetFilters(el, data);
|
1132 |
-
|
1133 |
-
});
|
1134 |
-
}else if(transition === 'fade'){ // Fade transition
|
1135 |
-
el.fadeOut(speed, function(){
|
1136 |
-
$('.alm-listing', el).html(''); // Clear listings
|
1137 |
-
$('.alm-btn-wrap', el).remove(); // remove buttons
|
1138 |
-
el.fadeIn(speed);
|
1139 |
-
|
1140 |
-
$.fn.almSetFilters(el, data);
|
1141 |
-
|
1142 |
-
});
|
1143 |
-
}else{
|
1144 |
-
$('.alm-listing', el).html(''); // Clear listings
|
1145 |
-
$('.alm-btn-wrap', el).remove(); // remove buttons
|
1146 |
-
el.fadeIn(speed);
|
1147 |
-
|
1148 |
-
$.fn.almSetFilters(el, data);
|
1149 |
-
|
1150 |
-
}
|
1151 |
-
|
1152 |
-
});
|
1153 |
-
};
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
/* $.fn.almSetFilters(el, data)
|
1158 |
-
*
|
1159 |
-
* Set filter parameters on .alm-listing element
|
1160 |
-
*
|
1161 |
-
* @since 2.6.1
|
1162 |
-
*/
|
1163 |
-
$.fn.almSetFilters = function(el, data){
|
1164 |
-
$.each(data, function(key, value) {
|
1165 |
-
key = key.replace(/\W+/g, '-').replace(/([a-z\d])([A-Z])/g, '$1-$2'); // Convert camelCase data() object back to dash (-)
|
1166 |
-
$('.alm-listing', el).attr('data-'+key, value);
|
1167 |
-
});
|
1168 |
-
|
1169 |
-
if ($.isFunction($.fn.almFilterComplete)){
|
1170 |
-
$.fn.almFilterComplete();
|
1171 |
-
}
|
1172 |
-
|
1173 |
-
$(".ajax-load-more-wrap").ajaxloadmore(); // re-initiate Ajax Load More
|
1174 |
-
};
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
/* $.fn.ajaxloadmore()
|
1179 |
-
*
|
1180 |
-
* Initiate all instances of Ajax load More
|
1181 |
-
* @since 2.1.2
|
1182 |
-
*/
|
1183 |
-
$.fn.ajaxloadmore = function () {
|
1184 |
-
return this.each(function (e) {
|
1185 |
-
$(this).data('alm', new $.ajaxloadmore($(this), e));
|
1186 |
-
});
|
1187 |
-
};
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
/*
|
1192 |
-
* Initiate Ajax load More if div is present on screen
|
1193 |
-
* @since 2.1.2
|
1194 |
-
*/
|
1195 |
-
if ($(".ajax-load-more-wrap").length){
|
1196 |
-
$(".ajax-load-more-wrap").ajaxloadmore();
|
1197 |
-
}
|
1198 |
-
|
1199 |
-
|
1200 |
-
})(jQuery);
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
/*! almWaitForImages
|
1205 |
-
jQuery Plugin
|
1206 |
-
v2.0.2
|
1207 |
-
Based on https://github.com/alexanderdickson/almWaitForImages
|
1208 |
-
*/
|
1209 |
-
// Include almWaitForImages() for paging add-on
|
1210 |
-
;(function (factory) {
|
1211 |
-
if (typeof define === 'function' && define.amd) {
|
1212 |
-
// AMD. Register as an anonymous module.
|
1213 |
-
define(['jquery'], factory);
|
1214 |
-
} else if (typeof exports === 'object') {
|
1215 |
-
// CommonJS / nodejs module
|
1216 |
-
module.exports = factory(require('jquery'));
|
1217 |
-
} else {
|
1218 |
-
// Browser globals
|
1219 |
-
factory(jQuery);
|
1220 |
-
}
|
1221 |
-
}(function ($) {
|
1222 |
-
// Namespace all events.
|
1223 |
-
var eventNamespace = 'almWaitForImages';
|
1224 |
-
|
1225 |
-
// CSS properties which contain references to images.
|
1226 |
-
$.almWaitForImages = {
|
1227 |
-
hasImageProperties: [
|
1228 |
-
'backgroundImage',
|
1229 |
-
'listStyleImage',
|
1230 |
-
'borderImage',
|
1231 |
-
'borderCornerImage',
|
1232 |
-
'cursor'
|
1233 |
-
],
|
1234 |
-
hasImageAttributes: ['srcset']
|
1235 |
-
};
|
1236 |
-
|
1237 |
-
// Custom selector to find all `img` elements with a valid `src` attribute.
|
1238 |
-
$.expr[':']['has-src'] = function (obj) {
|
1239 |
-
// Ensure we are dealing with an `img` element with a valid
|
1240 |
-
// `src` attribute.
|
1241 |
-
return $(obj).is('img[src][src!=""]');
|
1242 |
-
};
|
1243 |
-
|
1244 |
-
// Custom selector to find images which are not already cached by the
|
1245 |
-
// browser.
|
1246 |
-
$.expr[':'].uncached = function (obj) {
|
1247 |
-
// Ensure we are dealing with an `img` element with a valid
|
1248 |
-
// `src` attribute.
|
1249 |
-
if (!$(obj).is(':has-src')) {
|
1250 |
-
return false;
|
1251 |
-
}
|
1252 |
-
|
1253 |
-
return !obj.complete;
|
1254 |
-
};
|
1255 |
-
|
1256 |
-
$.fn.almWaitForImages = function () {
|
1257 |
-
|
1258 |
-
var allImgsLength = 0;
|
1259 |
-
var allImgsLoaded = 0;
|
1260 |
-
var deferred = $.Deferred();
|
1261 |
-
|
1262 |
-
var finishedCallback;
|
1263 |
-
var eachCallback;
|
1264 |
-
var waitForAll;
|
1265 |
-
|
1266 |
-
// Handle options object (if passed).
|
1267 |
-
if ($.isPlainObject(arguments[0])) {
|
1268 |
-
|
1269 |
-
waitForAll = arguments[0].waitForAll;
|
1270 |
-
eachCallback = arguments[0].each;
|
1271 |
-
finishedCallback = arguments[0].finished;
|
1272 |
-
|
1273 |
-
} else {
|
1274 |
-
|
1275 |
-
// Handle if using deferred object and only one param was passed in.
|
1276 |
-
if (arguments.length === 1 && $.type(arguments[0]) === 'boolean') {
|
1277 |
-
waitForAll = arguments[0];
|
1278 |
-
} else {
|
1279 |
-
finishedCallback = arguments[0];
|
1280 |
-
eachCallback = arguments[1];
|
1281 |
-
waitForAll = arguments[2];
|
1282 |
-
}
|
1283 |
-
|
1284 |
-
}
|
1285 |
-
|
1286 |
-
// Handle missing callbacks.
|
1287 |
-
finishedCallback = finishedCallback || $.noop;
|
1288 |
-
eachCallback = eachCallback || $.noop;
|
1289 |
-
|
1290 |
-
// Convert waitForAll to Boolean
|
1291 |
-
waitForAll = !! waitForAll;
|
1292 |
-
|
1293 |
-
// Ensure callbacks are functions.
|
1294 |
-
if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) {
|
1295 |
-
throw new TypeError('An invalid callback was supplied.');
|
1296 |
-
}
|
1297 |
-
|
1298 |
-
this.each(function () {
|
1299 |
-
// Build a list of all imgs, dependent on what images will
|
1300 |
-
// be considered.
|
1301 |
-
var obj = $(this);
|
1302 |
-
var allImgs = [];
|
1303 |
-
// CSS properties which may contain an image.
|
1304 |
-
var hasImgProperties = $.almWaitForImages.hasImageProperties || [];
|
1305 |
-
// Element attributes which may contain an image.
|
1306 |
-
var hasImageAttributes = $.almWaitForImages.hasImageAttributes || [];
|
1307 |
-
// To match `url()` references.
|
1308 |
-
// Spec: http://www.w3.org/TR/CSS2/syndata.html#value-def-uri
|
1309 |
-
var matchUrl = /url\(\s*(['"]?)(.*?)\1\s*\)/g;
|
1310 |
-
|
1311 |
-
if (waitForAll) {
|
1312 |
-
|
1313 |
-
// Get all elements (including the original), as any one of
|
1314 |
-
// them could have a background image.
|
1315 |
-
obj.find('*').addBack().each(function () {
|
1316 |
-
var element = $(this);
|
1317 |
-
|
1318 |
-
// If an `img` element, add it. But keep iterating in
|
1319 |
-
// case it has a background image too.
|
1320 |
-
if (element.is('img:has-src')) {
|
1321 |
-
allImgs.push({
|
1322 |
-
src: element.attr('src'),
|
1323 |
-
element: element[0]
|
1324 |
-
});
|
1325 |
-
}
|
1326 |
-
|
1327 |
-
$.each(hasImgProperties, function (i, property) {
|
1328 |
-
var propertyValue = element.css(property);
|
1329 |
-
var match;
|
1330 |
-
|
1331 |
-
// If it doesn't contain this property, skip.
|
1332 |
-
if (!propertyValue) {
|
1333 |
-
return true;
|
1334 |
-
}
|
1335 |
-
|
1336 |
-
// Get all url() of this element.
|
1337 |
-
while (match = matchUrl.exec(propertyValue)) {
|
1338 |
-
allImgs.push({
|
1339 |
-
src: match[2],
|
1340 |
-
element: element[0]
|
1341 |
-
});
|
1342 |
-
}
|
1343 |
-
});
|
1344 |
-
|
1345 |
-
$.each(hasImageAttributes, function (i, attribute) {
|
1346 |
-
var attributeValue = element.attr(attribute);
|
1347 |
-
var attributeValues;
|
1348 |
-
|
1349 |
-
// If it doesn't contain this property, skip.
|
1350 |
-
if (!attributeValue) {
|
1351 |
-
return true;
|
1352 |
-
}
|
1353 |
-
|
1354 |
-
// Check for multiple comma separated images
|
1355 |
-
attributeValues = attributeValue.split(',');
|
1356 |
-
|
1357 |
-
$.each(attributeValues, function(i, value) {
|
1358 |
-
// Trim value and get string before first
|
1359 |
-
// whitespace (for use with srcset).
|
1360 |
-
value = $.trim(value).split(' ')[0];
|
1361 |
-
allImgs.push({
|
1362 |
-
src: value,
|
1363 |
-
element: element[0]
|
1364 |
-
});
|
1365 |
-
});
|
1366 |
-
});
|
1367 |
-
});
|
1368 |
-
} else {
|
1369 |
-
// For images only, the task is simpler.
|
1370 |
-
obj.find('img:has-src')
|
1371 |
-
.each(function () {
|
1372 |
-
allImgs.push({
|
1373 |
-
src: this.src,
|
1374 |
-
element: this
|
1375 |
-
});
|
1376 |
-
});
|
1377 |
-
}
|
1378 |
-
|
1379 |
-
allImgsLength = allImgs.length;
|
1380 |
-
allImgsLoaded = 0;
|
1381 |
-
|
1382 |
-
// If no images found, don't bother.
|
1383 |
-
if (allImgsLength === 0) {
|
1384 |
-
finishedCallback.call(obj[0]);
|
1385 |
-
deferred.resolveWith(obj[0]);
|
1386 |
-
}
|
1387 |
-
|
1388 |
-
$.each(allImgs, function (i, img) {
|
1389 |
-
|
1390 |
-
var image = new Image();
|
1391 |
-
var events =
|
1392 |
-
'load.' + eventNamespace + ' error.' + eventNamespace;
|
1393 |
-
|
1394 |
-
// Handle the image loading and error with the same callback.
|
1395 |
-
$(image).one(events, function me (event) {
|
1396 |
-
// If an error occurred with loading the image, set the
|
1397 |
-
// third argument accordingly.
|
1398 |
-
var eachArguments = [
|
1399 |
-
allImgsLoaded,
|
1400 |
-
allImgsLength,
|
1401 |
-
event.type == 'load'
|
1402 |
-
];
|
1403 |
-
allImgsLoaded++;
|
1404 |
-
|
1405 |
-
eachCallback.apply(img.element, eachArguments);
|
1406 |
-
deferred.notifyWith(img.element, eachArguments);
|
1407 |
-
|
1408 |
-
// Unbind the event listeners. I use this in addition to
|
1409 |
-
// `one` as one of those events won't be called (either
|
1410 |
-
// 'load' or 'error' will be called).
|
1411 |
-
$(this).off(events, me);
|
1412 |
-
|
1413 |
-
if (allImgsLoaded == allImgsLength) {
|
1414 |
-
finishedCallback.call(obj[0]);
|
1415 |
-
deferred.resolveWith(obj[0]);
|
1416 |
-
return false;
|
1417 |
-
}
|
1418 |
-
|
1419 |
-
});
|
1420 |
-
|
1421 |
-
image.src = img.src;
|
1422 |
-
});
|
1423 |
-
});
|
1424 |
-
|
1425 |
-
return deferred.promise();
|
1426 |
-
|
1427 |
-
};
|
1428 |
-
}));
|
1 |
+
(function($){"use strict";$.ajaxloadmore=function(el,e){if(alm_localize.scrolltop==='true'){$(window).scrollTop(0);}
|
2 |
+
var alm=this;alm.AjaxLoadMore={};alm.page=0;alm.proceed=false;alm.disable_ajax=false;alm.init=true;alm.loading=true;alm.finished=false;alm.window=$(window);alm.button_label='';alm.data;alm.el=el;alm.container=el;alm.container.addClass('alm-'+e).attr('data-id',e);alm.content=$('.alm-ajax',alm.container);alm.content_preloaded=$('.alm-listing.alm-preloaded',alm.container);alm.canonical_url=alm.el.attr('data-canonical-url');alm.slug=alm.el.attr('data-slug');alm.prefix='alm-';alm.cache=alm.content.attr('data-cache');alm.cache_id=alm.content.attr('data-cache-id');alm.cache_path=alm.content.attr('data-cache-path');alm.cache_logged_in=alm.content.attr('data-cache-logged-in');alm.repeater=alm.content.attr('data-repeater');alm.theme_repeater=alm.content.attr('data-theme-repeater');alm.alternate_array='';alm.alternate=alm.content.attr('data-alternate');alm.alternate_sequence=alm.content.attr('data-alternate-sequence');alm.alternate_sequence_max=alm.content.attr('data-alternate-sequence-max');alm.alternate_repeater=alm.content.attr('data-alternate-repeater');alm.alternate_theme_repeater=alm.content.attr('data-alternate-theme-repeater');alm.scroll_distance=parseInt(alm.content.attr('data-scroll-distance'));alm.max_pages=parseInt(alm.content.attr('data-max-pages'));alm.pause_override=alm.content.attr('data-pause-override');alm.pause=alm.content.attr('data-pause');alm.transition=alm.content.attr('data-transition');alm.transition_container=alm.content.attr('data-transition-container');alm.speed=alm.content.attr('data-transition-speed')
|
3 |
+
alm.images_loaded=alm.content.attr('data-images-loaded');alm.destroy_after=alm.content.attr('data-destroy-after');alm.lang=alm.content.attr('data-lang');alm.orginal_posts_per_page=alm.content.attr('data-posts-per-page');alm.posts_per_page=alm.content.attr('data-posts-per-page');alm.previous_post=alm.content.attr('data-previous-post');alm.previous_post_id=alm.content.attr('data-previous-post-id');alm.previous_post_taxonomy=alm.content.attr('data-previous-post-taxonomy');alm.comments=alm.content.attr('data-comments');if(alm.comments==='true'){alm.content=$('.alm-comments',alm.container);}
|
4 |
+
alm.comments_array='';alm.comments_post_id=alm.content.attr('data-comments_post_id');alm.comments_per_page=alm.content.attr('data-comments_per_page');alm.comments_type=alm.content.attr('data-comments_type');alm.comments_style=alm.content.attr('data-comments_style');alm.comments_template=alm.content.attr('data-comments_template');alm.comments_callback=alm.content.attr('data-comments_callback');alm.seo=alm.content.attr('data-seo');alm.preloaded=alm.content.attr('data-preloaded');alm.preloaded_amount=alm.content.attr('data-preloaded-amount');alm.paging=alm.content.attr('data-paging');alm.paging_controls=alm.content.attr('data-paging-controls');alm.paging_show_at_most=alm.content.attr('data-paging-show-at-most');alm.paging_classes=alm.content.attr('data-paging-classes');if(alm.paging==='true'){alm.paging=true;if(alm.paging_show_at_most===undefined){alm.paging_show_at_most=7;}
|
5 |
+
if(alm.preloaded==='true'){alm.pause=true;}}else{alm.paging=false;}
|
6 |
+
if(alm.paging_controls==='true'){alm.paging_controls=true;}else{alm.paging_controls=false;}
|
7 |
+
if(alm.cache===undefined){alm.cache=false;}
|
8 |
+
if(alm.cache_logged_in===undefined){alm.cache_logged_in=false;}
|
9 |
+
if(alm.comments_per_page===undefined){alm.comments_per_page='5';}
|
10 |
+
if(alm.preloaded==='true'){alm.preload_wrap=alm.content.prev('.alm-preloaded');alm.total_posts=parseInt(alm.preload_wrap.attr('data-total-posts'));if(alm.preloaded_amount===undefined){alm.preloaded_amount=false;}
|
11 |
+
if(alm.total_posts<=alm.preloaded_amount){alm.disable_ajax=true;}}else{alm.preloaded='false';}
|
12 |
+
if(alm.seo===undefined){alm.seo=false;}
|
13 |
+
if(alm.seo==='true'){alm.seo=true;}
|
14 |
+
if($(".ajax-load-more-wrap").length>1){alm.seo=false;}
|
15 |
+
alm.permalink=alm.content.attr('data-seo-permalink');alm.pageview=alm.content.attr('data-seo-pageview');alm.start_page=alm.content.attr('data-seo-start-page');if(alm.start_page){alm.seo_scroll=alm.content.attr('data-seo-scroll');alm.seo_scroll_speed=alm.content.attr('data-seo-scroll-speed');alm.seo_scrolltop=alm.content.attr('data-seo-scrolltop');alm.isPaged=false;if(alm.start_page>1){alm.isPaged=true;alm.posts_per_page=alm.start_page*alm.posts_per_page;}
|
16 |
+
if(alm.paging){alm.posts_per_page=alm.orginal_posts_per_page;}}else{alm.start_page=1;}
|
17 |
+
if(alm.previous_post==='true'){alm.previous_post=true;alm.previous_post_permalink='';alm.previous_post_title='';}else{alm.previous_post=false;}
|
18 |
+
if(alm.previous_post_id===undefined){alm.previous_post_id='';}
|
19 |
+
if(alm.previous_post_taxonomy===undefined){alm.previous_post_taxonomy='';}
|
20 |
+
alm.previous_post_title_template=alm.content.attr('data-previous-post-title-template');alm.siteTitle=alm.content.attr('data-previous-post-site-title');alm.siteTagline=alm.content.attr('data-previous-post-site-tagline');alm.previous_post_pageview=alm.content.attr('data-previous-post-pageview');alm.previous_post_scroll=alm.content.attr('data-previous-post-scroll');alm.previous_post_scroll_speed=alm.content.attr('data-previous-post-scroll-speed');alm.previous_post_scroll_top=alm.content.attr('data-previous-post-scrolltop');if(alm.content.attr('data-offset')===undefined){alm.offset=0;}else{alm.offset=alm.content.attr('data-offset');}
|
21 |
+
if(alm.pause===undefined||(alm.seo&&alm.start_page>1)){alm.pause=false;}
|
22 |
+
if(alm.preloaded==='true'&&alm.seo&&alm.start_page>0){alm.pause=false;}
|
23 |
+
if(alm.repeater===undefined){alm.repeater='default';}
|
24 |
+
if(alm.theme_repeater===undefined){alm.theme_repeater='null';}
|
25 |
+
if(alm.max_pages===undefined){alm.max_pages=5;}
|
26 |
+
if(alm.max_pages===0){alm.max_pages=10000;}
|
27 |
+
if(alm.scroll_distance===undefined){alm.scroll_distance=150;}
|
28 |
+
if(alm.transition===undefined){alm.transition='slide';}else if(alm.transition==="fade"){alm.transition='fade';}else if(alm.transition==="none"){alm.transition='none';}else{alm.transition='slide';}
|
29 |
+
if(alm.speed===undefined){alm.speed=250;}else{alm.speed=parseInt(alm.speed);}
|
30 |
+
if(alm.transition_container===undefined||alm.transition_container==='true'){alm.transition_container=true;}else{alm.transition_container=false;}
|
31 |
+
if(alm.images_loaded===undefined){alm.images_loaded='false';}
|
32 |
+
if(alm.destroy_after!==undefined){}
|
33 |
+
if(alm.content.attr('data-button-label')===undefined){alm.button_label='Older Posts';}else{alm.button_label=alm.content.attr('data-button-label');}
|
34 |
+
alm.button_loading_label=alm.content.attr('data-button-loading-label');if(alm.button_loading_label===undefined){alm.button_loading_label=false;}
|
35 |
+
if(alm.content.attr('data-button-class')===undefined){alm.button_class='';}else{alm.button_class=' '+alm.content.attr('data-button-class');}
|
36 |
+
if(alm.content.attr('data-scroll')===undefined){alm.scroll=true;}else if(alm.content.attr('data-scroll')==='false'){alm.scroll=false;}else{alm.scroll=true;}
|
37 |
+
alm.post_type=alm.content.attr('data-post-type');alm.post_type=alm.post_type.split(",");alm.container.append('<div class="'+alm.prefix+'btn-wrap"/>');alm.btnWrap=$('.'+alm.prefix+'btn-wrap',alm.container);if(alm.paging){alm.content.parent().addClass('loading');}else{$('.'+alm.prefix+'btn-wrap',alm.container).append('<button id="load-more" class="'+alm.prefix+'load-more-btn more'+alm.button_class+'">'+alm.button_label+'</button>');alm.button=$('.alm-load-more-btn',alm.container);}
|
38 |
+
alm.AjaxLoadMore.loadPosts=function(){if(!alm.disable_ajax){if(!alm.paging){alm.button.addClass('loading');if(alm.button_loading_label!==false){alm.button.text(alm.button_loading_label);}}
|
39 |
+
alm.loading=true;if(alm.cache==='true'&&!alm.cache_logged_in){if(alm.init&&alm.seo&&alm.isPaged){alm.AjaxLoadMore.ajax('standard');}else{var cachePage=alm.cache_path+'/page-'+alm.page+'.html';$.get(cachePage,function(data){alm.AjaxLoadMore.success(data,true);}).fail(function(){alm.AjaxLoadMore.ajax('standard');});}}else{alm.AjaxLoadMore.ajax('standard');}}};alm.AjaxLoadMore.ajax=function(queryType){if(alm.previous_post){alm.previous_post_id=alm.content.attr('data-previous-post-id');alm.previous_post_taxonomy=alm.content.attr('data-previous-post-taxonomy');}
|
40 |
+
var action='alm_query_posts';if(alm.comments==='true'){action='alm_comments_query';alm.posts_per_page=alm.comments_per_page;alm.comments_array={'comments':'true','post_id':alm.comments_post_id,'per_page':alm.comments_per_page,'type':alm.comments_type,'style':alm.comments_style,'template':alm.comments_template,'callback':alm.comments_callback,};}
|
41 |
+
if(alm.alternate==='true'){alm.alternate_array={'alternate':'true','alternate_sequence':alm.alternate_sequence,'alternate_sequence_max':alm.alternate_sequence_max,'alternate_repeater':alm.alternate_repeater,'alternate_theme_repeater':alm.alternate_theme_repeater,};}
|
42 |
+
$.ajax({type:"GET",url:alm_localize.ajaxurl,data:{action:action,query_type:queryType,nonce:alm_localize.alm_nonce,cache_id:alm.cache_id,repeater:alm.repeater,theme_repeater:alm.theme_repeater,alternate:alm.alternate_array,comments:alm.comments_array,post_type:alm.post_type,post_format:alm.content.attr('data-post-format'),category:alm.content.attr('data-category'),category__not_in:alm.content.attr('data-category-not-in'),tag:alm.content.attr('data-tag'),tag__not_in:alm.content.attr('data-tag-not-in'),taxonomy:alm.content.attr('data-taxonomy'),taxonomy_terms:alm.content.attr('data-taxonomy-terms'),taxonomy_operator:alm.content.attr('data-taxonomy-operator'),taxonomy_relation:alm.content.attr('data-taxonomy-relation'),meta_key:alm.content.attr('data-meta-key'),meta_value:alm.content.attr('data-meta-value'),meta_compare:alm.content.attr('data-meta-compare'),meta_relation:alm.content.attr('data-meta-relation'),meta_type:alm.content.attr('data-meta-type'),author:alm.content.attr('data-author'),year:alm.content.attr('data-year'),month:alm.content.attr('data-month'),day:alm.content.attr('data-day'),post_status:alm.content.attr('data-post-status'),order:alm.content.attr('data-order'),orderby:alm.content.attr('data-orderby'),post__in:alm.content.attr('data-post-in'),post__not_in:alm.content.attr('data-post-not-in'),exclude:alm.content.attr('data-exclude'),search:alm.content.attr('data-search'),custom_args:alm.content.attr('data-custom-args'),posts_per_page:alm.posts_per_page,pageNumber:alm.page,offset:alm.offset,preloaded:alm.preloaded,preloaded_amount:alm.preloaded_amount,seo_start_page:alm.start_page,previous_post:alm.previous_post,previous_post_id:alm.previous_post_id,previous_post_taxonomy:alm.previous_post_taxonomy,lang:alm.lang,slug:alm.slug,canonical_url:alm.canonical_url,},dataType:"JSON",beforeSend:function(){if(alm.page!=1&&!alm.paging){alm.button.addClass('loading');}},success:function(data){if(queryType==='standard'){alm.AjaxLoadMore.success(data,false);}
|
43 |
+
else if(queryType==='totalposts'&&alm.paging){if($.isFunction($.fn.almBuildPagination)){$.fn.almBuildPagination(data,alm);}}},error:function(jqXHR,textStatus,errorThrown){alm.AjaxLoadMore.error(jqXHR,textStatus,errorThrown);}});};if(alm.paging){alm.AjaxLoadMore.ajax('totalposts');}
|
44 |
+
alm.AjaxLoadMore.success=function(data,is_cache){if(alm.previous_post){alm.AjaxLoadMore.getPreviousPost();}
|
45 |
+
var html;if(!is_cache){html=data.html;}else{html=data;}
|
46 |
+
alm.data=$(html);if(alm.init){if(!alm.paging){alm.button.text(alm.button_label);}else{if(alm.data.length>0){alm.el=$('<div class="alm-reveal"/>');alm.el.append('<div class="alm-paging-content"></div><div class="alm-paging-loading"></div>');$('.alm-paging-content',alm.el).append(alm.data).hide();alm.content.append(alm.el);alm.content.parent().removeClass('loading');alm.resetBtnText();$('.alm-paging-content',alm.el).fadeIn(alm.speed,'alm_easeInOutQuad',function(){var paddingT=parseInt(alm.content.css('padding-top')),paddingB=parseInt(alm.content.css('padding-bottom'));alm.content.css('height',alm.el.height()+paddingT+paddingB+'px');if($.isFunction($.fn.almFadePageControls)){$.fn.almFadePageControls(alm.btnWrap);}});}}
|
47 |
+
if(alm.data.length===0){if($.isFunction($.fn.almEmpty)){$.fn.almEmpty(alm);}}
|
48 |
+
if(alm.isPaged){alm.posts_per_page=alm.content.attr('data-posts-per-page');alm.page=alm.start_page-1;}}
|
49 |
+
if(alm.data.length>0){if(!alm.paging){if(alm.previous_post){alm.el=$('<div class="alm-reveal alm-previous-post post-'+alm.previous_post_id+'" data-id="'+alm.previous_post_id+'" data-title="'+alm.previous_post_title+'" data-url="'+alm.previous_post_permalink+'"/>');alm.el.append(alm.data).hide();}else{if(!alm.transition_container){alm.data.hide();alm.el=alm.data;}else{if(alm.init&&alm.start_page>1){var data=[];var size=Math.ceil(alm.data.length/alm.start_page);for(var i=0;i<alm.data.length;i+=size){data.push(alm.data.slice(i,size+i));}
|
50 |
+
alm.el=alm.content;for(var k=0;k<data.length;k++){var p=0;if(alm.preloaded==='true'){p=1;}
|
51 |
+
var div;if(k>0||alm.preloaded==='true'){var pagenum=(k+1+p);if(alm.permalink==='default'){div=$('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'&paged='+pagenum+'" data-page="'+pagenum+'" />');}else{div=$('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'page/'+pagenum+'/" data-page="'+pagenum+'" />');}}else{div=$('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'" data-page="1" />');}
|
52 |
+
div.append(data[k]);div=$(div);alm.el.append(div).hide();}}
|
53 |
+
else{if(alm.seo&&alm.page>0||alm.preloaded==='true'){var p=0;if(alm.preloaded==='true'){p=1;}
|
54 |
+
var pagenum=(alm.page+1+p);if(alm.seo){if(alm.permalink==='default'){alm.el=$('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'&paged='+pagenum+'" data-page="'+pagenum+'" />');}else{alm.el=$('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'page/'+pagenum+'/" data-page="'+pagenum+'" />');}}else{alm.el=$('<div class="alm-reveal" />');}}else{if(alm.seo){alm.el=$('<div class="alm-reveal alm-seo" data-url="'+alm.canonical_url+'" data-page="1" />');}else{alm.el=$('<div class="alm-reveal" />');}}
|
55 |
+
alm.el.append(alm.data).hide();}}}
|
56 |
+
alm.content.append(alm.el);if(alm.transition==='fade'){if(alm.images_loaded==='true'){alm.el.almWaitForImages().done(function(){alm.el.fadeIn(alm.speed,'alm_easeInOutQuad',function(){alm.loading=false;if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading');alm.resetBtnText();}
|
57 |
+
if(alm.data.length<alm.posts_per_page){alm.finished=true;if(!alm.paging){alm.button.addClass('done');}}
|
58 |
+
if($.isFunction($.fn.almSEO)&&alm.seo){$.fn.almSEO(alm);}});});}else{alm.el.fadeIn(alm.speed,'alm_easeInOutQuad',function(){alm.loading=false;if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading');alm.resetBtnText();}
|
59 |
+
if(alm.data.length<alm.posts_per_page){alm.finished=true;if(!alm.paging){alm.button.addClass('done');}}
|
60 |
+
if($.isFunction($.fn.almSEO)&&alm.seo){$.fn.almSEO(alm);}});}}else if(alm.transition==='none'){if(alm.images_loaded==='true'){alm.el.almWaitForImages().done(function(){alm.el.show();if($.isFunction($.fn.almSEO)&&alm.seo){$.fn.almSEO(alm);}});}else{alm.el.show();if($.isFunction($.fn.almSEO)&&alm.seo){$.fn.almSEO(alm);}}
|
61 |
+
alm.loading=false;if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading');alm.resetBtnText();}
|
62 |
+
if(alm.data.length<alm.posts_per_page){alm.finished=true;if(!alm.paging){alm.button.addClass('done');}}}else{if(alm.images_loaded==='true'){alm.el.almWaitForImages().done(function(){alm.el.slideDown(alm.speed,'alm_easeInOutQuad',function(){alm.loading=false;if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading');alm.resetBtnText();}
|
63 |
+
if(alm.data.length<alm.posts_per_page){alm.finished=true;if(!alm.paging){alm.button.addClass('done');}}
|
64 |
+
if($.isFunction($.fn.almSEO)&&alm.seo){$.fn.almSEO(alm);}});});}else{alm.el.slideDown(alm.speed,'alm_easeInOutQuad',function(){alm.loading=false;if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading');alm.resetBtnText();}
|
65 |
+
if(alm.data.length<alm.posts_per_page){alm.finished=true;if(!alm.paging){alm.button.addClass('done');}}
|
66 |
+
if($.isFunction($.fn.almSEO)&&alm.seo){$.fn.almSEO(alm);}});}}}else{if(!alm.init){$('.alm-paging-content',alm.el).html('').append(alm.data).almWaitForImages().done(function(){$('.alm-paging-loading',alm.el).fadeOut(alm.speed);if($.isFunction($.fn.almOnPagingComplete)){$.fn.almOnPagingComplete(alm);}
|
67 |
+
if($.isFunction($.fn.almSEO)&&alm.seo){$.fn.almSEO(alm);}});}}
|
68 |
+
if($.isFunction($.fn.almComplete)){if(alm.images_loaded==='true'){alm.el.almWaitForImages().done(function(){$.fn.almComplete(alm);});}else{$.fn.almComplete(alm);}}
|
69 |
+
if(alm.data.length<alm.posts_per_page){if($.isFunction($.fn.almDone)){setTimeout(function(){$.fn.almDone(alm)},alm.speed+10);}}}else{if(!alm.paging){alm.button.delay(alm.speed).removeClass('loading').addClass('done');alm.resetBtnText();}
|
70 |
+
if($.isFunction($.fn.almDone)&&!alm.init){$.fn.almDone(alm);}
|
71 |
+
alm.loading=false;alm.finished=true;}
|
72 |
+
if(alm.destroy_after!==undefined&&alm.destroy_after!==''){var currentPage=alm.page+1;if(alm.preload){currentPage++;}
|
73 |
+
if(currentPage==alm.destroy_after){alm.disable_ajax=true;if(!alm.paging){alm.button.delay(alm.speed).fadeOut(alm.speed);}}}
|
74 |
+
alm.init=false;};alm.fetchingPreviousPost=false;alm.AjaxLoadMore.getPreviousPost=function(){alm.fetchingPreviousPost=true;$.ajax({type:"GET",dataType:"JSON",url:alm_localize.ajaxurl,data:{action:'alm_query_previous_post',id:alm.previous_post_id,taxonomy:alm.previous_post_taxonomy},success:function(data){if(data.has_previous_post){alm.content.attr('data-previous-post-id',data.prev_id);alm.previous_post_permalink=data.prev_permalink;alm.previous_post_title=data.prev_title;}else{if(!data.has_previous_post){alm.finished=true;alm.button.addClass('done');if($.isFunction($.fn.almDone)){$.fn.almDone(alm);}}}
|
75 |
+
if($.isFunction($.fn.almSetPreviousPost)){$.fn.almSetPreviousPost(alm,data.current_id,data.permalink,data.title);}
|
76 |
+
alm.fetchingPreviousPost=false;},error:function(jqXHR,textStatus,errorThrown){alm.AjaxLoadMore.error(jqXHR,textStatus,errorThrown);alm.fetchingPreviousPost=false;}});};alm.resetBtnText=function(){if(alm.button_loading_label!==false){if(!alm.paging){alm.button.text(alm.button_label);}}};alm.AjaxLoadMore.error=function(jqXHR,textStatus,errorThrown){alm.loading=false;if(!alm.paging){alm.button.removeClass('loading');alm.resetBtnText();}
|
77 |
+
console.log(errorThrown);};if(!alm.paging&&!alm.fetchingPreviousPost){alm.button.on('click',function(){if(alm.pause==='true'){alm.pause=false;alm.pause_override=false;alm.AjaxLoadMore.loadPosts();}
|
78 |
+
if(!alm.loading&&!alm.finished&&!$(this).hasClass('done')){alm.loading=true;alm.page++;alm.AjaxLoadMore.loadPosts();}});}
|
79 |
+
if(alm.paging){alm.window.resize(function(){if($.isFunction($.fn.almOnWindowResize)){setTimeout(function(){$.fn.almOnWindowResize(alm);},250);}});}
|
80 |
+
alm.AjaxLoadMore.isVisible=function(){alm.visible=false;if(alm.el.is(":visible")){alm.visible=true;}
|
81 |
+
return alm.visible;};if(alm.scroll&&!alm.paging){alm.window.bind("scroll touchstart",function(){if(alm.AjaxLoadMore.isVisible()&&!alm.fetchingPreviousPost){var content_offset=alm.button.offset(),top=Math.round(content_offset.top-(alm.window.height()-alm.scroll_distance));if(!alm.loading&&!alm.finished&&(alm.window.scrollTop()>=top)&&alm.page<(alm.max_pages-1)&&alm.proceed&&alm.pause==='true'&&alm.pause_override==='true'){alm.button.trigger('click');}
|
82 |
+
else{if(!alm.loading&&!alm.finished&&(alm.window.scrollTop()>=top)&&alm.page<(alm.max_pages-1)&&alm.proceed&&alm.pause!=='true'){alm.page++;alm.AjaxLoadMore.loadPosts();}}}});}
|
83 |
+
if(!alm.paging&&!alm.previous_post){if(alm.disable_ajax){alm.finished=true;alm.button.addClass('done');}else{if(alm.pause==='true'){alm.button.text(alm.button_label);alm.loading=false;}else{alm.AjaxLoadMore.loadPosts();}}}
|
84 |
+
if(alm.previous_post){alm.AjaxLoadMore.getPreviousPost();alm.loading=false;}
|
85 |
+
setTimeout(function(){alm.proceed=true;},500);$.fn.almUpdateCurrentPage=function(current,obj,alm){alm.page=current;var alm_paging_init=false;if(alm_paging_init&&alm.preloaded==='true'){var data=$('.alm-preloaded',alm.el).html();$('.alm-preloaded',alm.el).remove();alm.preloaded_amount=0;alm.AjaxLoadMore.success(data,false);}else{alm.AjaxLoadMore.loadPosts();}};$.fn.almGetParentContainer=function(){return alm.el.closest('#ajax-load-more');};$.fn.almGetObj=function(){return alm;};$.easing.alm_easeInOutQuad=function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}
|
86 |
+
return-c/2*((--t)*(t-2)-1)+b;};};$.fn.almFilter=function(transition,speed,data){$(".ajax-load-more-wrap").each(function(e){var el=$(this);if(transition==='slide'){el.slideUp(speed,function(){$('.alm-listing',el).html('');$('.alm-btn-wrap',el).remove();el.fadeIn(speed);$.fn.almSetFilters(el,data);});}else if(transition==='fade'){el.fadeOut(speed,function(){$('.alm-listing',el).html('');$('.alm-btn-wrap',el).remove();el.fadeIn(speed);$.fn.almSetFilters(el,data);});}else{$('.alm-listing',el).html('');$('.alm-btn-wrap',el).remove();el.fadeIn(speed);$.fn.almSetFilters(el,data);}});};$.fn.almSetFilters=function(el,data){$.each(data,function(key,value){key=key.replace(/\W+/g,'-').replace(/([a-z\d])([A-Z])/g,'$1-$2');$('.alm-listing',el).attr('data-'+key,value);});if($.isFunction($.fn.almFilterComplete)){$.fn.almFilterComplete();}
|
87 |
+
$(".ajax-load-more-wrap").ajaxloadmore();};$.fn.ajaxloadmore=function(){return this.each(function(e){$(this).data('alm',new $.ajaxloadmore($(this),e));});};if($(".ajax-load-more-wrap").length){$(".ajax-load-more-wrap").ajaxloadmore();}})(jQuery);;(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){module.exports=factory(require('jquery'));}else{factory(jQuery);}}(function($){var eventNamespace='almWaitForImages';$.almWaitForImages={hasImageProperties:['backgroundImage','listStyleImage','borderImage','borderCornerImage','cursor'],hasImageAttributes:['srcset']};$.expr[':']['has-src']=function(obj){return $(obj).is('img[src][src!=""]');};$.expr[':'].uncached=function(obj){if(!$(obj).is(':has-src')){return false;}
|
88 |
+
return!obj.complete;};$.fn.almWaitForImages=function(){var allImgsLength=0;var allImgsLoaded=0;var deferred=$.Deferred();var finishedCallback;var eachCallback;var waitForAll;if($.isPlainObject(arguments[0])){waitForAll=arguments[0].waitForAll;eachCallback=arguments[0].each;finishedCallback=arguments[0].finished;}else{if(arguments.length===1&&$.type(arguments[0])==='boolean'){waitForAll=arguments[0];}else{finishedCallback=arguments[0];eachCallback=arguments[1];waitForAll=arguments[2];}}
|
89 |
+
finishedCallback=finishedCallback||$.noop;eachCallback=eachCallback||$.noop;waitForAll=!!waitForAll;if(!$.isFunction(finishedCallback)||!$.isFunction(eachCallback)){throw new TypeError('An invalid callback was supplied.');}
|
90 |
+
this.each(function(){var obj=$(this);var allImgs=[];var hasImgProperties=$.almWaitForImages.hasImageProperties||[];var hasImageAttributes=$.almWaitForImages.hasImageAttributes||[];var matchUrl=/url\(\s*(['"]?)(.*?)\1\s*\)/g;if(waitForAll){obj.find('*').addBack().each(function(){var element=$(this);if(element.is('img:has-src')){allImgs.push({src:element.attr('src'),element:element[0]});}
|
91 |
+
$.each(hasImgProperties,function(i,property){var propertyValue=element.css(property);var match;if(!propertyValue){return true;}
|
92 |
+
while(match=matchUrl.exec(propertyValue)){allImgs.push({src:match[2],element:element[0]});}});$.each(hasImageAttributes,function(i,attribute){var attributeValue=element.attr(attribute);var attributeValues;if(!attributeValue){return true;}
|
93 |
+
attributeValues=attributeValue.split(',');$.each(attributeValues,function(i,value){value=$.trim(value).split(' ')[0];allImgs.push({src:value,element:element[0]});});});});}else{obj.find('img:has-src').each(function(){allImgs.push({src:this.src,element:this});});}
|
94 |
+
allImgsLength=allImgs.length;allImgsLoaded=0;if(allImgsLength===0){finishedCallback.call(obj[0]);deferred.resolveWith(obj[0]);}
|
95 |
+
$.each(allImgs,function(i,img){var image=new Image();var events='load.'+eventNamespace+' error.'+eventNamespace;$(image).one(events,function me(event){var eachArguments=[allImgsLoaded,allImgsLength,event.type=='load'];allImgsLoaded++;eachCallback.apply(img.element,eachArguments);deferred.notifyWith(img.element,eachArguments);$(this).off(events,me);if(allImgsLoaded==allImgsLength){finishedCallback.call(obj[0]);deferred.resolveWith(obj[0]);return false;}});image.src=img.src;});});return deferred.promise();};}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lang/ajax-load-more.pot
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Ajax Load More\n"
|
4 |
-
"POT-Creation-Date: 2016-
|
5 |
-
"PO-Revision-Date: 2016-
|
6 |
-
"Last-Translator: Darren Cooney <
|
7 |
"Language-Team: \n"
|
8 |
"Language: en_CA\n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -15,12 +15,12 @@ msgstr ""
|
|
15 |
"X-Poedit-KeywordsList: __;_e\n"
|
16 |
"X-Poedit-SearchPath-0: ..\n"
|
17 |
|
18 |
-
#: ../admin/admin.php:
|
19 |
-
#: ../admin/admin.php:
|
20 |
msgid "You don't belong here."
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: ../admin/admin.php:
|
24 |
#: ../admin/views/licenses.php:51 ../admin/views/licenses.php:106
|
25 |
#: ../admin/views/licenses.php:160 ../admin/views/licenses.php:215
|
26 |
#: ../admin/views/licenses.php:271 ../admin/views/licenses.php:327
|
@@ -29,7 +29,7 @@ msgstr ""
|
|
29 |
msgid "Active"
|
30 |
msgstr ""
|
31 |
|
32 |
-
#: ../admin/admin.php:
|
33 |
#: ../admin/views/licenses.php:55 ../admin/views/licenses.php:110
|
34 |
#: ../admin/views/licenses.php:164 ../admin/views/licenses.php:219
|
35 |
#: ../admin/views/licenses.php:275 ../admin/views/licenses.php:331
|
@@ -38,159 +38,159 @@ msgstr ""
|
|
38 |
msgid "Inactive"
|
39 |
msgstr ""
|
40 |
|
41 |
-
#: ../admin/admin.php:
|
42 |
msgid "Applying layout"
|
43 |
msgstr ""
|
44 |
|
45 |
-
#: ../admin/admin.php:
|
46 |
msgid "Template Updated"
|
47 |
msgstr ""
|
48 |
|
49 |
-
#: ../admin/admin.php:
|
50 |
msgid ""
|
51 |
"[Ajax Load More] Error opening default repeater template - Please check your "
|
52 |
"file path and ensure your server is configured to allow Ajax Load More to "
|
53 |
"read and write files within the /ajax-load-more/core/repeater directory"
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: ../admin/admin.php:
|
57 |
msgid ""
|
58 |
"[Ajax Load More] Error updating default repeater template - Please check "
|
59 |
"your file path and ensure your server is configured to allow Ajax Load More "
|
60 |
"to read and write files within the /ajax-load-more/core/repeater directory."
|
61 |
msgstr ""
|
62 |
|
63 |
-
#: ../admin/admin.php:
|
64 |
msgid "[Ajax Load More] Unable to open repeater template - "
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: ../admin/admin.php:
|
68 |
msgid "[Ajax Load More] Error saving repeater template - "
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: ../admin/admin.php:
|
72 |
msgid "Error Writing File"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: ../admin/admin.php:
|
76 |
#: ../admin/shortcode-builder/shortcode-builder.php:1244
|
77 |
msgid "Container Type"
|
78 |
msgstr ""
|
79 |
|
80 |
-
#: ../admin/admin.php:
|
81 |
#: ../admin/shortcode-builder/shortcode-builder.php:1268
|
82 |
msgid "Container Classes"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: ../admin/admin.php:
|
86 |
msgid "Disable CSS"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: ../admin/admin.php:
|
90 |
msgid "Button/Loading Style"
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: ../admin/admin.php:
|
94 |
msgid "Button Classes"
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: ../admin/admin.php:
|
98 |
msgid "Ajax Security"
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: ../admin/admin.php:
|
102 |
msgid "Top of Page"
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: ../admin/admin.php:
|
106 |
msgid "Dynamic Content"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: ../admin/admin.php:
|
110 |
msgid "Editor Button"
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: ../admin/admin.php:
|
114 |
msgid "Error Notices"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: ../admin/admin.php:
|
118 |
msgid ""
|
119 |
"Customize the user experience of Ajax Load More by updating the fields below."
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: ../admin/admin.php:
|
123 |
msgid "The following settings affect the WordPress admin area only."
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: ../admin/admin.php:
|
127 |
msgid "I want to use my own CSS styles."
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: ../admin/admin.php:
|
131 |
msgid "View Ajax Load More CSS"
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: ../admin/admin.php:
|
135 |
msgid "Hide shortcode button in WYSIWYG editor."
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: ../admin/admin.php:
|
139 |
msgid ""
|
140 |
"Display error messaging regarding repeater template updates in the browser "
|
141 |
"console."
|
142 |
msgstr ""
|
143 |
|
144 |
-
#: ../admin/admin.php:
|
145 |
msgid ""
|
146 |
"Disable dynamic population of categories, tags and authors in the Shortcode "
|
147 |
"Builder.<span style=\"display:block\">Recommended if you have an "
|
148 |
"extraordinary number of categories, tags and/or authors."
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: ../admin/admin.php:
|
152 |
msgid "Ajax Posts Here"
|
153 |
msgstr ""
|
154 |
|
155 |
-
#: ../admin/admin.php:
|
156 |
msgid "You can modify the container type when building a shortcode."
|
157 |
msgstr ""
|
158 |
|
159 |
-
#: ../admin/admin.php:
|
160 |
msgid ""
|
161 |
"Add classes to Ajax Load More container - classes are applied globally and "
|
162 |
"will appear with every instance of Ajax Load More. <span style=\"display:"
|
163 |
"block\">You can also add classes when building a shortcode.</span>"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: ../admin/admin.php:
|
167 |
msgid ""
|
168 |
"Select an Ajax loading style - you can choose between a <strong>button</"
|
169 |
"strong> or <strong>infinite scroll</strong>"
|
170 |
msgstr ""
|
171 |
|
172 |
-
#: ../admin/admin.php:
|
173 |
msgid "Preview"
|
174 |
msgstr ""
|
175 |
|
176 |
-
#: ../admin/admin.php:
|
177 |
#: ../admin/shortcode-builder/shortcode-builder.php:1218
|
178 |
-
#: ../
|
179 |
msgid "Older Posts"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: ../admin/admin.php:
|
183 |
msgid "Add classes to your <strong>Load More</strong> button"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: ../admin/admin.php:
|
187 |
msgid ""
|
188 |
"On initial page load, move the user's browser window to the top of the "
|
189 |
"screen.<span style=\"display:block\">This <u>may</u> help prevent the "
|
190 |
"loading of unnecessary posts.</span>"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: ../admin/admin.php:
|
194 |
msgid ""
|
195 |
"Enable <a href=\"https://codex.wordpress.org/WordPress_Nonces\" target="
|
196 |
"\"_blank\">WP nonce</a> verification to help protect URLs against certain "
|
@@ -1547,36 +1547,36 @@ msgstr ""
|
|
1547 |
msgid "Updating template..."
|
1548 |
msgstr ""
|
1549 |
|
1550 |
-
#: ../admin/views/repeater-templates.php:
|
1551 |
msgid "Templating Help"
|
1552 |
msgstr ""
|
1553 |
|
1554 |
-
#: ../admin/views/repeater-templates.php:
|
1555 |
msgid "What is a repeater template?"
|
1556 |
msgstr ""
|
1557 |
|
1558 |
-
#: ../admin/views/repeater-templates.php:
|
1559 |
msgid ""
|
1560 |
"A repeater template is a snippet of code that will execute over and over "
|
1561 |
"within a <a href=\"http://codex.wordpress.org/The_Loop\" target=\"_blank"
|
1562 |
"\">WordPress loop</a>.</p>"
|
1563 |
msgstr ""
|
1564 |
|
1565 |
-
#: ../admin/views/repeater-templates.php:
|
1566 |
msgid "Can I include PHP in the repeater template?"
|
1567 |
msgstr ""
|
1568 |
|
1569 |
-
#: ../admin/views/repeater-templates.php:
|
1570 |
msgid ""
|
1571 |
"Yes, PHP and core WordPress functions such as, <code>the_title()</code> and "
|
1572 |
"<code>the_permalink()</code> are required.</p>"
|
1573 |
msgstr ""
|
1574 |
|
1575 |
-
#: ../admin/views/repeater-templates.php:
|
1576 |
msgid "Tips and Tricks"
|
1577 |
msgstr ""
|
1578 |
|
1579 |
-
#: ../admin/views/repeater-templates.php:
|
1580 |
msgid ""
|
1581 |
"Always open and close your templates with an HTML element. In some rare "
|
1582 |
"cases data may not be displayed if not wrapped in HTML.<br/>e.g. <code><"
|
@@ -1652,11 +1652,11 @@ msgstr ""
|
|
1652 |
msgid "Clear all Shortcode Builder settings"
|
1653 |
msgstr ""
|
1654 |
|
1655 |
-
#: ../ajax-load-more.php:
|
1656 |
msgid "Settings"
|
1657 |
msgstr ""
|
1658 |
|
1659 |
-
#: ../core/functions.php:
|
1660 |
msgid "Pages:"
|
1661 |
msgstr ""
|
1662 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Ajax Load More\n"
|
4 |
+
"POT-Creation-Date: 2016-05-08 22:06-0500\n"
|
5 |
+
"PO-Revision-Date: 2016-05-08 22:06-0500\n"
|
6 |
+
"Last-Translator: Darren Cooney <darren.cooney@gmail.com>\n"
|
7 |
"Language-Team: \n"
|
8 |
"Language: en_CA\n"
|
9 |
"MIME-Version: 1.0\n"
|
15 |
"X-Poedit-KeywordsList: __;_e\n"
|
16 |
"X-Poedit-SearchPath-0: ..\n"
|
17 |
|
18 |
+
#: ../admin/admin.php:92 ../admin/admin.php:123 ../admin/admin.php:681
|
19 |
+
#: ../admin/admin.php:725 ../admin/admin.php:775
|
20 |
msgid "You don't belong here."
|
21 |
msgstr ""
|
22 |
|
23 |
+
#: ../admin/admin.php:153 ../admin/editor/editor-build.php:67
|
24 |
#: ../admin/views/licenses.php:51 ../admin/views/licenses.php:106
|
25 |
#: ../admin/views/licenses.php:160 ../admin/views/licenses.php:215
|
26 |
#: ../admin/views/licenses.php:271 ../admin/views/licenses.php:327
|
29 |
msgid "Active"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#: ../admin/admin.php:154 ../admin/editor/editor-build.php:68
|
33 |
#: ../admin/views/licenses.php:55 ../admin/views/licenses.php:110
|
34 |
#: ../admin/views/licenses.php:164 ../admin/views/licenses.php:219
|
35 |
#: ../admin/views/licenses.php:275 ../admin/views/licenses.php:331
|
38 |
msgid "Inactive"
|
39 |
msgstr ""
|
40 |
|
41 |
+
#: ../admin/admin.php:155
|
42 |
msgid "Applying layout"
|
43 |
msgstr ""
|
44 |
|
45 |
+
#: ../admin/admin.php:156 ../admin/views/repeater-templates.php:220
|
46 |
msgid "Template Updated"
|
47 |
msgstr ""
|
48 |
|
49 |
+
#: ../admin/admin.php:266
|
50 |
msgid ""
|
51 |
"[Ajax Load More] Error opening default repeater template - Please check your "
|
52 |
"file path and ensure your server is configured to allow Ajax Load More to "
|
53 |
"read and write files within the /ajax-load-more/core/repeater directory"
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: ../admin/admin.php:270
|
57 |
msgid ""
|
58 |
"[Ajax Load More] Error updating default repeater template - Please check "
|
59 |
"your file path and ensure your server is configured to allow Ajax Load More "
|
60 |
"to read and write files within the /ajax-load-more/core/repeater directory."
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: ../admin/admin.php:639
|
64 |
msgid "[Ajax Load More] Unable to open repeater template - "
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: ../admin/admin.php:643
|
68 |
msgid "[Ajax Load More] Error saving repeater template - "
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: ../admin/admin.php:676
|
72 |
msgid "Error Writing File"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: ../admin/admin.php:861
|
76 |
#: ../admin/shortcode-builder/shortcode-builder.php:1244
|
77 |
msgid "Container Type"
|
78 |
msgstr ""
|
79 |
|
80 |
+
#: ../admin/admin.php:869
|
81 |
#: ../admin/shortcode-builder/shortcode-builder.php:1268
|
82 |
msgid "Container Classes"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: ../admin/admin.php:877
|
86 |
msgid "Disable CSS"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: ../admin/admin.php:885
|
90 |
msgid "Button/Loading Style"
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: ../admin/admin.php:893
|
94 |
msgid "Button Classes"
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: ../admin/admin.php:901
|
98 |
msgid "Ajax Security"
|
99 |
msgstr ""
|
100 |
|
101 |
+
#: ../admin/admin.php:909
|
102 |
msgid "Top of Page"
|
103 |
msgstr ""
|
104 |
|
105 |
+
#: ../admin/admin.php:917
|
106 |
msgid "Dynamic Content"
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: ../admin/admin.php:925
|
110 |
msgid "Editor Button"
|
111 |
msgstr ""
|
112 |
|
113 |
+
#: ../admin/admin.php:933
|
114 |
msgid "Error Notices"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: ../admin/admin.php:998
|
118 |
msgid ""
|
119 |
"Customize the user experience of Ajax Load More by updating the fields below."
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: ../admin/admin.php:1011
|
123 |
msgid "The following settings affect the WordPress admin area only."
|
124 |
msgstr ""
|
125 |
|
126 |
+
#: ../admin/admin.php:1042
|
127 |
msgid "I want to use my own CSS styles."
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: ../admin/admin.php:1042
|
131 |
msgid "View Ajax Load More CSS"
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: ../admin/admin.php:1062
|
135 |
msgid "Hide shortcode button in WYSIWYG editor."
|
136 |
msgstr ""
|
137 |
|
138 |
+
#: ../admin/admin.php:1083
|
139 |
msgid ""
|
140 |
"Display error messaging regarding repeater template updates in the browser "
|
141 |
"console."
|
142 |
msgstr ""
|
143 |
|
144 |
+
#: ../admin/admin.php:1104
|
145 |
msgid ""
|
146 |
"Disable dynamic population of categories, tags and authors in the Shortcode "
|
147 |
"Builder.<span style=\"display:block\">Recommended if you have an "
|
148 |
"extraordinary number of categories, tags and/or authors."
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: ../admin/admin.php:1125 ../admin/admin.php:1128
|
152 |
msgid "Ajax Posts Here"
|
153 |
msgstr ""
|
154 |
|
155 |
+
#: ../admin/admin.php:1130
|
156 |
msgid "You can modify the container type when building a shortcode."
|
157 |
msgstr ""
|
158 |
|
159 |
+
#: ../admin/admin.php:1147
|
160 |
msgid ""
|
161 |
"Add classes to Ajax Load More container - classes are applied globally and "
|
162 |
"will appear with every instance of Ajax Load More. <span style=\"display:"
|
163 |
"block\">You can also add classes when building a shortcode.</span>"
|
164 |
msgstr ""
|
165 |
|
166 |
+
#: ../admin/admin.php:1209
|
167 |
msgid ""
|
168 |
"Select an Ajax loading style - you can choose between a <strong>button</"
|
169 |
"strong> or <strong>infinite scroll</strong>"
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: ../admin/admin.php:1232
|
173 |
msgid "Preview"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: ../admin/admin.php:1232
|
177 |
#: ../admin/shortcode-builder/shortcode-builder.php:1218
|
178 |
+
#: ../core/classes/class.alm-shortcode.php:122
|
179 |
msgid "Older Posts"
|
180 |
msgstr ""
|
181 |
|
182 |
+
#: ../admin/admin.php:1251
|
183 |
msgid "Add classes to your <strong>Load More</strong> button"
|
184 |
msgstr ""
|
185 |
|
186 |
+
#: ../admin/admin.php:1294
|
187 |
msgid ""
|
188 |
"On initial page load, move the user's browser window to the top of the "
|
189 |
"screen.<span style=\"display:block\">This <u>may</u> help prevent the "
|
190 |
"loading of unnecessary posts.</span>"
|
191 |
msgstr ""
|
192 |
|
193 |
+
#: ../admin/admin.php:1315
|
194 |
msgid ""
|
195 |
"Enable <a href=\"https://codex.wordpress.org/WordPress_Nonces\" target="
|
196 |
"\"_blank\">WP nonce</a> verification to help protect URLs against certain "
|
1547 |
msgid "Updating template..."
|
1548 |
msgstr ""
|
1549 |
|
1550 |
+
#: ../admin/views/repeater-templates.php:251
|
1551 |
msgid "Templating Help"
|
1552 |
msgstr ""
|
1553 |
|
1554 |
+
#: ../admin/views/repeater-templates.php:253
|
1555 |
msgid "What is a repeater template?"
|
1556 |
msgstr ""
|
1557 |
|
1558 |
+
#: ../admin/views/repeater-templates.php:254
|
1559 |
msgid ""
|
1560 |
"A repeater template is a snippet of code that will execute over and over "
|
1561 |
"within a <a href=\"http://codex.wordpress.org/The_Loop\" target=\"_blank"
|
1562 |
"\">WordPress loop</a>.</p>"
|
1563 |
msgstr ""
|
1564 |
|
1565 |
+
#: ../admin/views/repeater-templates.php:257
|
1566 |
msgid "Can I include PHP in the repeater template?"
|
1567 |
msgstr ""
|
1568 |
|
1569 |
+
#: ../admin/views/repeater-templates.php:258
|
1570 |
msgid ""
|
1571 |
"Yes, PHP and core WordPress functions such as, <code>the_title()</code> and "
|
1572 |
"<code>the_permalink()</code> are required.</p>"
|
1573 |
msgstr ""
|
1574 |
|
1575 |
+
#: ../admin/views/repeater-templates.php:261
|
1576 |
msgid "Tips and Tricks"
|
1577 |
msgstr ""
|
1578 |
|
1579 |
+
#: ../admin/views/repeater-templates.php:263
|
1580 |
msgid ""
|
1581 |
"Always open and close your templates with an HTML element. In some rare "
|
1582 |
"cases data may not be displayed if not wrapped in HTML.<br/>e.g. <code><"
|
1652 |
msgid "Clear all Shortcode Builder settings"
|
1653 |
msgstr ""
|
1654 |
|
1655 |
+
#: ../ajax-load-more.php:194
|
1656 |
msgid "Settings"
|
1657 |
msgstr ""
|
1658 |
|
1659 |
+
#: ../core/functions.php:399
|
1660 |
msgid "Pages:"
|
1661 |
msgstr ""
|
1662 |
|