Version Description
- Urgent fix for array_push error
Download this release
Release Info
Developer | dcooney |
Plugin | WordPress Infinite Scroll – Ajax Load More |
Version | 2.3.1 |
Comparing to | |
See all releases |
Code changes from version 2.2.8 to 2.3.1
- README.txt +30 -10
- admin/admin.php +178 -16
- admin/css/admin.css +63 -23
- admin/editor.php +21 -22
- admin/img/add-ons/seo-add-ons.jpg +0 -0
- admin/img/add-ons/unlimited-add-ons.jpg +0 -0
- admin/shortcode-builder/js/shortcode-builder.js +18 -5
- admin/shortcode-builder/shortcode-builder.php +28 -2
- ajax-load-more.php +102 -22
- core/js/ajax-load-more.js +52 -5
- core/js/ajax-load-more.min.js +19 -1
- core/repeater/default.php +7 -7
README.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Ajax Load More ===
|
2 |
Contributors: dcooney
|
3 |
Donate link: http://connekthq.com/donate/
|
4 |
-
Tags: ajax, query, loop, paging, filter, jquery, shortcode builder, shortcode, search, tags, category, post types, taxonomy, post format, wmpl
|
5 |
Requires at least: 3.6
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -33,7 +33,7 @@ Check out the **[demo site](http://connekthq.com/plugins/ajax-load-more/)** for
|
|
33 |
|
34 |
Ajax Load More accepts a number of parameters that are passed to the WordPress query. These parameters are transferred via shortcode - don't worry, creating your shortcode is simple with our intuitive Shortcode Builder.
|
35 |
|
36 |
-
* **repeater** - Choose a repeater template (Add-on available). Default = ‘default
|
37 |
* **post_type** - Comma separated list of post types. Default = ‘post’
|
38 |
* **post_format** - Query by post format. Default = null
|
39 |
* **category** - Query by category slug. Default = null
|
@@ -56,6 +56,7 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
|
|
56 |
* **pause** - Do not load posts until user clicks the Load More button (true/false). Default = 'false'
|
57 |
* **transition** - Choose a posts reveal transition (slide/fade). Default = 'slide'
|
58 |
* **button_label** - The label text for Load More button. Default = 'Older Posts'
|
|
|
59 |
|
60 |
***
|
61 |
|
@@ -70,6 +71,7 @@ Ajax Load More accepts a number of parameters that are passed to the WordPress q
|
|
70 |
* **[Multiple Instances](http://connekthq.com/plugins/ajax-load-more/examples/multiple-instances/)** - Include multiple Ajax Load More' on a single page
|
71 |
* **[Pause Loading](http://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Posts will not load until initiated by the user
|
72 |
* **[Search Results](http://connekthq.com/plugins/ajax-load-more/examples/search-results/)** - Returning results based on search terms
|
|
|
73 |
|
74 |
*The [Custom Repeater Add-On](http://connekthq.com/plugins/ajax-load-more/custom-repeaters/) has been installed for use on each of our product demos*
|
75 |
|
@@ -99,17 +101,21 @@ The following Add-ons are available to increase the functionality of Ajax Load M
|
|
99 |
The **[Custom Repeaters](http://connekthq.com/plugins/ajax-load-more/custom-repeaters)** add-on will allow for **unlimited repeater templates** and provide the ability to create unique templates for different content types throughout your theme.
|
100 |
[Get More Information](http://connekthq.com/plugins/ajax-load-more/custom-repeaters)
|
101 |
|
|
|
|
|
|
|
|
|
|
|
102 |
***
|
103 |
|
104 |
= Tested Browsers =
|
105 |
|
106 |
-
* Firefox (
|
107 |
-
* Chrome (
|
108 |
-
* Safari (
|
109 |
* IE8+
|
110 |
-
*
|
111 |
-
*
|
112 |
-
* BB10
|
113 |
|
114 |
***
|
115 |
|
@@ -199,6 +205,20 @@ How to install Ajax Load More.
|
|
199 |
== Changelog ==
|
200 |
|
201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
= 2.2.8 =
|
203 |
* Adding required functionality for the NEW Ajax Load More Custom Repeaters v2 add-on - http://connekthq.com/plugins/ajax-load-more/custom-repeaters/
|
204 |
* Improved debug messaging for Ajax Load More and Add-Ons.
|
1 |
=== Ajax Load More ===
|
2 |
Contributors: dcooney
|
3 |
Donate link: http://connekthq.com/donate/
|
4 |
+
Tags: ajax, query, loop, paging, filter, infinite scroll, infinite, dynamic, jquery, shortcode builder, shortcode, search, tags, category, post types, taxonomy, meta_query, post format, wmpl
|
5 |
Requires at least: 3.6
|
6 |
+
Tested up to: 4.1
|
7 |
+
Stable tag: 2.3.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
33 |
|
34 |
Ajax Load More accepts a number of parameters that are passed to the WordPress query. These parameters are transferred via shortcode - don't worry, creating your shortcode is simple with our intuitive Shortcode Builder.
|
35 |
|
36 |
+
* **repeater** - Choose a repeater template (Add-on available). Default = ‘default’
|
37 |
* **post_type** - Comma separated list of post types. Default = ‘post’
|
38 |
* **post_format** - Query by post format. Default = null
|
39 |
* **category** - Query by category slug. Default = null
|
56 |
* **pause** - Do not load posts until user clicks the Load More button (true/false). Default = 'false'
|
57 |
* **transition** - Choose a posts reveal transition (slide/fade). Default = 'slide'
|
58 |
* **button_label** - The label text for Load More button. Default = 'Older Posts'
|
59 |
+
* **seo** - Enable address bar URL rewrites as users page through content - <a href="seo/">add-on only</a> (true/false). Default = ‘false’
|
60 |
|
61 |
***
|
62 |
|
71 |
* **[Multiple Instances](http://connekthq.com/plugins/ajax-load-more/examples/multiple-instances/)** - Include multiple Ajax Load More' on a single page
|
72 |
* **[Pause Loading](http://connekthq.com/plugins/ajax-load-more/examples/pause-loading/)** - Posts will not load until initiated by the user
|
73 |
* **[Search Results](http://connekthq.com/plugins/ajax-load-more/examples/search-results/)** - Returning results based on search terms
|
74 |
+
* **[SEO Paging](http://connekthq.com/plugins/ajax-load-more/examples/seo-paging/)** - Generate unique paging URLs with each Ajax Load More query
|
75 |
|
76 |
*The [Custom Repeater Add-On](http://connekthq.com/plugins/ajax-load-more/custom-repeaters/) has been installed for use on each of our product demos*
|
77 |
|
101 |
The **[Custom Repeaters](http://connekthq.com/plugins/ajax-load-more/custom-repeaters)** add-on will allow for **unlimited repeater templates** and provide the ability to create unique templates for different content types throughout your theme.
|
102 |
[Get More Information](http://connekthq.com/plugins/ajax-load-more/custom-repeaters)
|
103 |
|
104 |
+
**Search Engine Optimization**
|
105 |
+
|
106 |
+
The **[SEO](http://connekthq.com/plugins/ajax-load-more/seo/)** add-on will optimize your ajax loaded content for search engines and site visitors by generating standard WordPress paging URLs with each Ajax Load More query.
|
107 |
+
[Get More Information](http://connekthq.com/plugins/ajax-load-more/seo/)
|
108 |
+
|
109 |
***
|
110 |
|
111 |
= Tested Browsers =
|
112 |
|
113 |
+
* Firefox (Mac, PC)
|
114 |
+
* Chrome (Mac, PC, iOS, Android)
|
115 |
+
* Safari (Mac, iOS)
|
116 |
* IE8+
|
117 |
+
* Android (Native)
|
118 |
+
* BB10 (Native)
|
|
|
119 |
|
120 |
***
|
121 |
|
205 |
== Changelog ==
|
206 |
|
207 |
|
208 |
+
= 2.3.1 =
|
209 |
+
* Urgent fix for array_push error
|
210 |
+
|
211 |
+
|
212 |
+
= 2.3.0 =
|
213 |
+
* Adding required functionality for ALM SEO add-on (http://connekthq.com/plugins/ajax-load-more/seo/)
|
214 |
+
* Adding variables for counting items within the ALM query - $alm_page & $alm_item are now accessible within repeater templates.
|
215 |
+
* Remove plugin activation notification due to error fetching column names.
|
216 |
+
* Fixed issue with orderby = "rand", ALM now excludes all previously queried post ids.
|
217 |
+
* fixed JS error on ALM setting pages.
|
218 |
+
* Fixed issue with hiding TinyMCE button that was affecting other plugins.
|
219 |
+
* General plugin improvements and enhancements.
|
220 |
+
|
221 |
+
|
222 |
= 2.2.8 =
|
223 |
* Adding required functionality for the NEW Ajax Load More Custom Repeaters v2 add-on - http://connekthq.com/plugins/ajax-load-more/custom-repeaters/
|
224 |
* Improved debug messaging for Ajax Load More and Add-Ons.
|
admin/admin.php
CHANGED
@@ -31,8 +31,7 @@ function alm_admin_vars() { ?>
|
|
31 |
/**
|
32 |
* alm_core_update
|
33 |
* Update default repeater on plugin update.
|
34 |
-
*
|
35 |
-
* If plugin versions do not match the plugin has been updated and we need to update our repeaters.
|
36 |
*
|
37 |
* @since 2.0.5
|
38 |
*/
|
@@ -178,7 +177,8 @@ function alm_enqueue_admin_scripts(){
|
|
178 |
|
179 |
}
|
180 |
|
181 |
-
//Load JS
|
|
|
182 |
wp_enqueue_script( 'select2', ALM_ADMIN_URL. 'js/libs/select2.min.js', array( 'jquery' ));
|
183 |
wp_enqueue_script( 'shortcode-builder', ALM_ADMIN_URL. 'shortcode-builder/js/shortcode-builder.js', array( 'jquery' ));
|
184 |
}
|
@@ -213,7 +213,7 @@ function alm_settings_page(){ ?>
|
|
213 |
//get the older values, wont work the first time
|
214 |
$options = get_option( '_alm_settings' ); ?>
|
215 |
<div class="row no-brd alm-save-settings">
|
216 |
-
<?php submit_button('Save Settings'
|
217 |
<div class="loading"></div>
|
218 |
</div>
|
219 |
</form>
|
@@ -704,11 +704,11 @@ function alm_add_ons_page(){ ?>
|
|
704 |
<div class="wrap">
|
705 |
<div class="header-wrap">
|
706 |
<h2><?php _e('Ajax Load More: Add-ons', ALM_NAME); ?></h2>
|
707 |
-
<p><?php _e('
|
708 |
</div>
|
709 |
<div class="cnkt-main">
|
710 |
|
711 |
-
<!--
|
712 |
<div class="group">
|
713 |
<div class="row no-brd">
|
714 |
<div class="expand-wrap">
|
@@ -717,27 +717,53 @@ function alm_add_ons_page(){ ?>
|
|
717 |
</div>
|
718 |
<div class="wrap">
|
719 |
<h2 class="addon-title"><?php _e('Custom Repeaters', ALM_NAME); ?></h2>
|
720 |
-
<p class="addon-intro"><?php _e('
|
721 |
-
<p><?php _e('Create, delete and modify <a href="?page=ajax-load-more-repeaters">repeater templates</a> as you need them with absolutely zero restrictions
|
722 |
</div>
|
723 |
</div>
|
724 |
</div>
|
725 |
<?php
|
|
|
726 |
if (has_action('alm_unlimited_installed')){
|
727 |
-
echo '<a class="btn installed" href="
|
728 |
}else{
|
729 |
-
echo '<a class="btn" href="
|
730 |
}
|
731 |
?>
|
732 |
</div>
|
733 |
-
<!-- End
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
|
735 |
</div>
|
736 |
|
737 |
<div class="cnkt-sidebar">
|
738 |
<div class="cta">
|
739 |
-
<h3><?php _e('
|
740 |
-
<p><?php _e('
|
741 |
</div>
|
742 |
<?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/writeable.php'); ?>
|
743 |
</div>
|
@@ -757,6 +783,7 @@ function alm_add_ons_page(){ ?>
|
|
757 |
|
758 |
add_action( 'admin_init', 'alm_admin_init');
|
759 |
function alm_admin_init(){
|
|
|
760 |
register_setting(
|
761 |
'alm-setting-group',
|
762 |
'alm_settings',
|
@@ -765,7 +792,7 @@ function alm_admin_init(){
|
|
765 |
|
766 |
add_settings_section(
|
767 |
'alm_general_settings',
|
768 |
-
'
|
769 |
'alm_general_settings_callback',
|
770 |
'ajax-load-more'
|
771 |
);
|
@@ -809,6 +836,38 @@ function alm_admin_init(){
|
|
809 |
'ajax-load-more',
|
810 |
'alm_general_settings'
|
811 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
812 |
}
|
813 |
|
814 |
|
@@ -821,7 +880,7 @@ function alm_admin_init(){
|
|
821 |
*/
|
822 |
|
823 |
function alm_general_settings_callback() {
|
824 |
-
echo '<p>' . __('Customize your version of Ajax Load More by updating the fields below
|
825 |
}
|
826 |
|
827 |
|
@@ -968,7 +1027,7 @@ function alm_btn_color_callback() {
|
|
968 |
$html .= '<option value="white" ' . $selected6 .'>White</option>';
|
969 |
$html .= '</select>';
|
970 |
|
971 |
-
$html .= '<div class="ajax-load-more-wrap '.$color.'"><span>'.__('Preview', ALM_NAME) .'</span><button class="alm-load-more-btn loading" disabled="disabled">Show More</button></div>';
|
972 |
echo $html;
|
973 |
?>
|
974 |
<script>
|
@@ -1002,3 +1061,106 @@ function alm_btn_color_callback() {
|
|
1002 |
}
|
1003 |
|
1004 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
/**
|
32 |
* alm_core_update
|
33 |
* Update default repeater on plugin update.
|
34 |
+
* If plugin versions do not match or the plugin has been updated and we need to update our repeaters.
|
|
|
35 |
*
|
36 |
* @since 2.0.5
|
37 |
*/
|
177 |
|
178 |
}
|
179 |
|
180 |
+
//Load JS
|
181 |
+
wp_enqueue_script( 'jquery-form' );
|
182 |
wp_enqueue_script( 'select2', ALM_ADMIN_URL. 'js/libs/select2.min.js', array( 'jquery' ));
|
183 |
wp_enqueue_script( 'shortcode-builder', ALM_ADMIN_URL. 'shortcode-builder/js/shortcode-builder.js', array( 'jquery' ));
|
184 |
}
|
213 |
//get the older values, wont work the first time
|
214 |
$options = get_option( '_alm_settings' ); ?>
|
215 |
<div class="row no-brd alm-save-settings">
|
216 |
+
<?php submit_button('Save Settings'); ?>
|
217 |
<div class="loading"></div>
|
218 |
</div>
|
219 |
</form>
|
704 |
<div class="wrap">
|
705 |
<div class="header-wrap">
|
706 |
<h2><?php _e('Ajax Load More: Add-ons', ALM_NAME); ?></h2>
|
707 |
+
<p><?php _e('Add-ons are available to extend and enhance the core functionality of Ajax Load More.', ALM_NAME); ?></p>
|
708 |
</div>
|
709 |
<div class="cnkt-main">
|
710 |
|
711 |
+
<!-- Custom Repeaters -->
|
712 |
<div class="group">
|
713 |
<div class="row no-brd">
|
714 |
<div class="expand-wrap">
|
717 |
</div>
|
718 |
<div class="wrap">
|
719 |
<h2 class="addon-title"><?php _e('Custom Repeaters', ALM_NAME); ?></h2>
|
720 |
+
<p class="addon-intro"><?php _e('Extend Ajax Load More with unlimited repeater templates.', ALM_NAME); ?></p>
|
721 |
+
<p><?php _e('Create, delete and modify <a href="?page=ajax-load-more-repeaters">repeater templates</a> as you need them with absolutely zero restrictions.</p>', ALM_NAME); ?>
|
722 |
</div>
|
723 |
</div>
|
724 |
</div>
|
725 |
<?php
|
726 |
+
$cr_url = 'http://connekthq.com/plugins/ajax-load-more/custom-repeaters/';
|
727 |
if (has_action('alm_unlimited_installed')){
|
728 |
+
echo '<a class="btn installed" href="'. $cr_url .'" target="_blank"><i class="fa fa-check-square"></i> Installed</a> ';
|
729 |
}else{
|
730 |
+
echo '<a class="btn" href="'. $cr_url .'" target="_blank"><i class="fa fa-download"></i> Purchase & Install</a>';
|
731 |
}
|
732 |
?>
|
733 |
</div>
|
734 |
+
<!-- End Custom Repeaters -->
|
735 |
+
|
736 |
+
<!-- SEO -->
|
737 |
+
<div class="group">
|
738 |
+
<div class="row no-brd">
|
739 |
+
<div class="expand-wrap">
|
740 |
+
<div class="section-title">
|
741 |
+
<img src="<?php echo ALM_ADMIN_URL; ?>img/add-ons/seo-add-ons.jpg">
|
742 |
+
</div>
|
743 |
+
<div class="wrap">
|
744 |
+
<h2 class="addon-title"><?php _e('Search Engine Optimization', ALM_NAME); ?></h2>
|
745 |
+
<p class="addon-intro"><?php _e('Generate unique paging URLs with every Ajax Load More query.', ALM_NAME); ?></p>
|
746 |
+
<p><?php _e('The SEO add-on will optimize your ajax loaded content for search engines and site visitors by generating unique paging URLs with every query.</p>', ALM_NAME); ?>
|
747 |
+
</div>
|
748 |
+
</div>
|
749 |
+
</div>
|
750 |
+
<?php
|
751 |
+
$seo_url = 'http://connekthq.com/plugins/ajax-load-more/seo/';
|
752 |
+
if (has_action('alm_seo_installed')){
|
753 |
+
echo '<a class="btn installed" href="'. $seo_url .'" target="_blank"><i class="fa fa-check-square"></i> Installed</a> ';
|
754 |
+
}else{
|
755 |
+
echo '<a class="btn" href="'. $seo_url .'" target="_blank"><i class="fa fa-download"></i> Purchase & Install</a>';
|
756 |
+
}
|
757 |
+
?>
|
758 |
+
</div>
|
759 |
+
<!-- End SEO -->
|
760 |
|
761 |
</div>
|
762 |
|
763 |
<div class="cnkt-sidebar">
|
764 |
<div class="cta">
|
765 |
+
<h3><?php _e('Add-on Updates', ALM_NAME); ?></h3>
|
766 |
+
<p><?php _e('All add-ons are installed as stand alone plugins and will receive plugin update notifications.', ALM_NAME); ?></p>
|
767 |
</div>
|
768 |
<?php include( plugin_dir_path( __FILE__ ) . 'includes/cta/writeable.php'); ?>
|
769 |
</div>
|
783 |
|
784 |
add_action( 'admin_init', 'alm_admin_init');
|
785 |
function alm_admin_init(){
|
786 |
+
|
787 |
register_setting(
|
788 |
'alm-setting-group',
|
789 |
'alm_settings',
|
792 |
|
793 |
add_settings_section(
|
794 |
'alm_general_settings',
|
795 |
+
'Global Settings',
|
796 |
'alm_general_settings_callback',
|
797 |
'ajax-load-more'
|
798 |
);
|
836 |
'ajax-load-more',
|
837 |
'alm_general_settings'
|
838 |
);
|
839 |
+
|
840 |
+
if(has_action('alm_seo_installed')){
|
841 |
+
|
842 |
+
add_settings_section(
|
843 |
+
'alm_seo_settings',
|
844 |
+
'SEO Settings',
|
845 |
+
'alm_seo_settings_callback',
|
846 |
+
'ajax-load-more'
|
847 |
+
);
|
848 |
+
add_settings_field(
|
849 |
+
'_alm_seo_permalinks',
|
850 |
+
__('SEO Permalinks', ALM_NAME ),
|
851 |
+
'_alm_seo_permalinks_callback',
|
852 |
+
'ajax-load-more',
|
853 |
+
'alm_seo_settings'
|
854 |
+
);
|
855 |
+
add_settings_field(
|
856 |
+
'_alm_seo_scroll',
|
857 |
+
__('Scroll to Page', ALM_NAME ),
|
858 |
+
'_alm_seo_scroll_callback',
|
859 |
+
'ajax-load-more',
|
860 |
+
'alm_seo_settings'
|
861 |
+
);
|
862 |
+
add_settings_field(
|
863 |
+
'_alm_seo_speed',
|
864 |
+
__('Scroll Speed', ALM_NAME ),
|
865 |
+
'_alm_seo_speed_callback',
|
866 |
+
'ajax-load-more',
|
867 |
+
'alm_seo_settings'
|
868 |
+
);
|
869 |
+
|
870 |
+
}
|
871 |
}
|
872 |
|
873 |
|
880 |
*/
|
881 |
|
882 |
function alm_general_settings_callback() {
|
883 |
+
echo '<p>' . __('Customize your version of Ajax Load More by updating the fields below.', ALM_NAME) . '</p>';
|
884 |
}
|
885 |
|
886 |
|
1027 |
$html .= '<option value="white" ' . $selected6 .'>White</option>';
|
1028 |
$html .= '</select>';
|
1029 |
|
1030 |
+
$html .= '<div class="clear"></div><div class="ajax-load-more-wrap '.$color.'"><span>'.__('Preview', ALM_NAME) .'</span><button class="alm-load-more-btn loading" disabled="disabled">Show More</button></div>';
|
1031 |
echo $html;
|
1032 |
?>
|
1033 |
<script>
|
1061 |
}
|
1062 |
|
1063 |
|
1064 |
+
/*
|
1065 |
+
* alm_seo_settings_callback
|
1066 |
+
* SEO Setting Heading
|
1067 |
+
*
|
1068 |
+
* @since 2.3.0
|
1069 |
+
*/
|
1070 |
+
|
1071 |
+
function alm_seo_settings_callback() {
|
1072 |
+
$html = '<p>' . __('Customize your installation of the <a href="http://connekthq.com/plugins/ajax-load-more/seo/">Search Engine Optimization</a> add-on.', ALM_NAME) . '</p>';
|
1073 |
+
|
1074 |
+
echo $html;
|
1075 |
+
}
|
1076 |
+
|
1077 |
+
|
1078 |
+
|
1079 |
+
/*
|
1080 |
+
* _alm_seo_permalinks
|
1081 |
+
* Select permalink type
|
1082 |
+
*
|
1083 |
+
* @since 2.3.0
|
1084 |
+
*/
|
1085 |
+
|
1086 |
+
function _alm_seo_permalinks_callback() {
|
1087 |
+
|
1088 |
+
$options = get_option( 'alm_settings' );
|
1089 |
+
|
1090 |
+
if(!isset($options['_alm_seo_permalinks']))
|
1091 |
+
$options['_alm_seo_permalinks'] = 'pretty';
|
1092 |
+
|
1093 |
+
|
1094 |
+
$html = '<p style="padding-bottom: 15px; overflow: hidden;">Select your WordPress <a href="options-permalink.php"><strong>Permalink structure</strong></a>.</p>';
|
1095 |
+
$html .= '<input type="radio" id="_alm_seo_type_one" name="alm_settings[_alm_seo_permalinks]" value="pretty"' . checked( 'pretty', $options['_alm_seo_permalinks'], false ) . '/>';
|
1096 |
+
$html .= '<label for="_alm_seo_type_one">'.__('Pretty Permalinks (mod_rewrite) <br/><span>http://example.com/2012/post-name/</span>', ALM_NAME).'</label><br/>';
|
1097 |
+
|
1098 |
+
$html .= '<input type="radio" id="_alm_seo_type_two" name="alm_settings[_alm_seo_permalinks]" value="default"' . checked( 'default', $options['_alm_seo_permalinks'], false ) . '/>';
|
1099 |
+
$html .= '<label for="_alm_seo_type_two">'.__('Default (Ugly) <br/><span>http://example.com/?p=N</span>', ALM_NAME).'</label>';
|
1100 |
+
|
1101 |
+
echo $html;
|
1102 |
+
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
|
1106 |
+
|
1107 |
+
/*
|
1108 |
+
* _alm_seo_scroll_callback
|
1109 |
+
* Set the speed of auto scroll
|
1110 |
+
*
|
1111 |
+
* @since 2.3.0
|
1112 |
+
*/
|
1113 |
+
|
1114 |
+
function _alm_seo_scroll_callback() {
|
1115 |
+
|
1116 |
+
$options = get_option( 'alm_settings' );
|
1117 |
+
|
1118 |
+
if(!isset($options['_alm_seo_scroll']))
|
1119 |
+
$options['_alm_seo_scroll'] = '1';
|
1120 |
+
|
1121 |
+
$html = '<input type="hidden" name="alm_settings[_alm_seo_scroll]" value="0" />';
|
1122 |
+
$html .= '<input type="checkbox" name="alm_settings[_alm_seo_scroll]" id="alm_scroll_page" value="1"'. (($options['_alm_seo_scroll']) ? ' checked="checked"' : '') .' />';
|
1123 |
+
$html .= '<label for="alm_scroll_page">'.__('Enable window scrolling.<br/><span>If scrolling is enabled, the users window will scroll to the current page on \'Load More\' button click and while interacting with the forward and back browser buttons.</span>', ALM_NAME).'</label>';
|
1124 |
+
|
1125 |
+
echo $html;
|
1126 |
+
}
|
1127 |
+
|
1128 |
+
|
1129 |
+
|
1130 |
+
/*
|
1131 |
+
* _alm_seo_speed_callback
|
1132 |
+
* Set the speed of auto scroll
|
1133 |
+
*
|
1134 |
+
* @since 2.3.0
|
1135 |
+
*/
|
1136 |
+
|
1137 |
+
function _alm_seo_speed_callback() {
|
1138 |
+
|
1139 |
+
$options = get_option( 'alm_settings' );
|
1140 |
+
|
1141 |
+
if(!isset($options['_alm_seo_speed']))
|
1142 |
+
$options['_alm_seo_speed'] = '1000';
|
1143 |
+
|
1144 |
+
|
1145 |
+
echo '<label for="alm_settings[_alm_seo_speed]">'.__('Set the scrolling speed of the page in milliseconds. <br/><span>e.g. 1 second = 1000</span>', ALM_NAME).'</label><br/><input type="number" class="sm" id="alm_settings[_alm_seo_speed]" name="alm_settings[_alm_seo_speed]" step="50" min="0" value="'.$options['_alm_seo_speed'].'" placeholder="1000" /> ';
|
1146 |
+
|
1147 |
+
?>
|
1148 |
+
<script>
|
1149 |
+
// Check if Scroll to Page != true
|
1150 |
+
if(!jQuery('input#alm_scroll_page').is(":checked")){
|
1151 |
+
jQuery('input#alm_scroll_page').parent().parent('tr').next('tr').hide();
|
1152 |
+
}
|
1153 |
+
jQuery('input#alm_scroll_page').change(function() {
|
1154 |
+
var el = jQuery(this);
|
1155 |
+
if(el.is(":checked")) {
|
1156 |
+
el.parent().parent('tr').next('tr').show();
|
1157 |
+
}else{
|
1158 |
+
el.parent().parent('tr').next('tr').hide();
|
1159 |
+
}
|
1160 |
+
});
|
1161 |
+
|
1162 |
+
</script>
|
1163 |
+
<?php
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
|
admin/css/admin.css
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
color:#666;
|
16 |
position: relative;
|
17 |
font-family: 'Open Sans', sans-serif;
|
18 |
-
max-width:
|
19 |
}
|
20 |
|
21 |
.ajax-load-more *{
|
@@ -212,7 +212,8 @@
|
|
212 |
overflow:hidden;
|
213 |
}
|
214 |
.ajax-load-more #taxonomy-extended,
|
215 |
-
.ajax-load-more #meta-query-extended
|
|
|
216 |
display: none;
|
217 |
overflow: hidden;
|
218 |
}
|
@@ -232,6 +233,7 @@
|
|
232 |
font-size: 14px;
|
233 |
padding: 5px 8px;
|
234 |
width: auto;
|
|
|
235 |
display: inline-block;
|
236 |
clear: both;
|
237 |
border-radius: 3px;
|
@@ -258,6 +260,10 @@
|
|
258 |
|
259 |
.checkboxes{}
|
260 |
.checkboxes input,
|
|
|
|
|
|
|
|
|
261 |
.checkboxes label,
|
262 |
.radio input,
|
263 |
.radio label{
|
@@ -270,13 +276,40 @@
|
|
270 |
.radio input{
|
271 |
margin-left: 3px;
|
272 |
}
|
273 |
-
.ajax-load-more input[type=text]
|
|
|
274 |
padding: 10px;
|
275 |
line-height: 1.3;
|
276 |
border: 1px solid #ccc;
|
277 |
width: 60%;
|
278 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
.ajax-load-more input[type=text],
|
|
|
280 |
.ajax-load-more textarea{
|
281 |
background: #f7f7f7;
|
282 |
}
|
@@ -578,14 +611,22 @@
|
|
578 |
display: inline-block;
|
579 |
clear: both;
|
580 |
float: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
}
|
582 |
.form-table label + textarea{
|
583 |
margin-top: 10px;
|
584 |
}
|
585 |
.form-table label span{
|
586 |
-
opacity: 0.5;
|
587 |
font-size: 13px;
|
588 |
-
|
589 |
}
|
590 |
|
591 |
.admin.ajax-load-more .form-table textarea{
|
@@ -606,25 +647,24 @@
|
|
606 |
resize: none;
|
607 |
}
|
608 |
|
609 |
-
.admin.ajax-load-more input[type=radio],
|
610 |
-
.admin.ajax-load-more input[type=checkbox]{
|
611 |
-
margin-top: 0 !important;
|
612 |
-
}
|
613 |
.admin.ajax-load-more .form-table input[type=radio],
|
614 |
.admin.ajax-load-more .form-table input[type=checkbox]{
|
615 |
-
margin-top: -4px !important;
|
616 |
margin-right: 10px;
|
|
|
617 |
}
|
618 |
|
619 |
.admin.ajax-load-more.settings input[type=text],
|
|
|
620 |
.admin.ajax-load-more.settings .select2-container{
|
621 |
margin-top:10px;
|
622 |
}
|
623 |
.admin.ajax-load-more.settings .ajax-load-more-wrap {
|
624 |
position: relative;
|
625 |
-
top:10px;
|
626 |
-
padding: 10px
|
627 |
-
border
|
|
|
|
|
628 |
}
|
629 |
.admin.ajax-load-more.settings .ajax-load-more-wrap button{
|
630 |
margin: 0 !important;
|
@@ -643,11 +683,11 @@
|
|
643 |
/* Table Overrides */
|
644 |
.admin.ajax-load-more.settings .form-table td,
|
645 |
.admin.ajax-load-more.settings .form-table th{
|
646 |
-
padding:
|
647 |
}
|
648 |
|
649 |
-
.admin.ajax-load-more.settings .form-table
|
650 |
-
|
651 |
}
|
652 |
|
653 |
.header-wrap{
|
@@ -676,17 +716,17 @@
|
|
676 |
top: -2px;
|
677 |
}
|
678 |
.ajax-load-more h2.addon-title{
|
679 |
-
font-size:
|
680 |
font-weight: 600 !important;
|
681 |
-
color: #
|
682 |
padding: 0;
|
683 |
-
margin: 0 0
|
684 |
-
padding: 0 0
|
685 |
border-bottom: 1px solid #efefef;
|
686 |
}
|
687 |
.ajax-load-more p.addon-intro{
|
688 |
-
font-size:
|
689 |
-
line-height:
|
690 |
color: #999 !important;
|
691 |
}
|
692 |
|
@@ -707,7 +747,7 @@
|
|
707 |
}
|
708 |
.ajax-load-more p.desc{
|
709 |
font-size: 12px !important;
|
710 |
-
padding: 0 0 8px
|
711 |
}
|
712 |
|
713 |
.ajax-load-more p.back2top{
|
15 |
color:#666;
|
16 |
position: relative;
|
17 |
font-family: 'Open Sans', sans-serif;
|
18 |
+
max-width: 1100px;
|
19 |
}
|
20 |
|
21 |
.ajax-load-more *{
|
212 |
overflow:hidden;
|
213 |
}
|
214 |
.ajax-load-more #taxonomy-extended,
|
215 |
+
.ajax-load-more #meta-query-extended,
|
216 |
+
.ajax-load-more #seo-extended{
|
217 |
display: none;
|
218 |
overflow: hidden;
|
219 |
}
|
233 |
font-size: 14px;
|
234 |
padding: 5px 8px;
|
235 |
width: auto;
|
236 |
+
margin-top: 0;
|
237 |
display: inline-block;
|
238 |
clear: both;
|
239 |
border-radius: 3px;
|
260 |
|
261 |
.checkboxes{}
|
262 |
.checkboxes input,
|
263 |
+
.radio input{
|
264 |
+
margin-top: 2px;
|
265 |
+
}
|
266 |
+
.checkboxes input,
|
267 |
.checkboxes label,
|
268 |
.radio input,
|
269 |
.radio label{
|
276 |
.radio input{
|
277 |
margin-left: 3px;
|
278 |
}
|
279 |
+
.ajax-load-more input[type=text],
|
280 |
+
.ajax-load-more input[type=number]{
|
281 |
padding: 10px;
|
282 |
line-height: 1.3;
|
283 |
border: 1px solid #ccc;
|
284 |
width: 60%;
|
285 |
}
|
286 |
+
|
287 |
+
.ajax-load-more input[type=number].sm{
|
288 |
+
width: 100px;
|
289 |
+
}
|
290 |
+
|
291 |
+
.ajax-load-more ::-webkit-input-placeholder {
|
292 |
+
color: #999;
|
293 |
+
font-style: italic;
|
294 |
+
}
|
295 |
+
|
296 |
+
.ajax-load-more :-moz-placeholder { /* Firefox 18- */
|
297 |
+
color: #999;
|
298 |
+
font-style: italic;
|
299 |
+
}
|
300 |
+
|
301 |
+
.ajax-load-more ::-moz-placeholder { /* Firefox 19+ */
|
302 |
+
color: #999;
|
303 |
+
font-style: italic;
|
304 |
+
}
|
305 |
+
|
306 |
+
.ajax-load-more :-ms-input-placeholder {
|
307 |
+
color: #999;
|
308 |
+
font-style: italic;
|
309 |
+
}
|
310 |
+
|
311 |
.ajax-load-more input[type=text],
|
312 |
+
.ajax-load-more input[type=number],
|
313 |
.ajax-load-more textarea{
|
314 |
background: #f7f7f7;
|
315 |
}
|
611 |
display: inline-block;
|
612 |
clear: both;
|
613 |
float: none;
|
614 |
+
vertical-align: top;
|
615 |
+
padding: 0 0 10px;
|
616 |
+
max-width: 90%;
|
617 |
+
}
|
618 |
+
.form-table input[type=radio],
|
619 |
+
.form-table input[type=checkbox]{
|
620 |
+
vertical-align: top;
|
621 |
+
margin-top: 0 !important;
|
622 |
+
max-width: 8%;
|
623 |
}
|
624 |
.form-table label + textarea{
|
625 |
margin-top: 10px;
|
626 |
}
|
627 |
.form-table label span{
|
|
|
628 |
font-size: 13px;
|
629 |
+
color: #999;
|
630 |
}
|
631 |
|
632 |
.admin.ajax-load-more .form-table textarea{
|
647 |
resize: none;
|
648 |
}
|
649 |
|
|
|
|
|
|
|
|
|
650 |
.admin.ajax-load-more .form-table input[type=radio],
|
651 |
.admin.ajax-load-more .form-table input[type=checkbox]{
|
|
|
652 |
margin-right: 10px;
|
653 |
+
margin-top: 0 !important;
|
654 |
}
|
655 |
|
656 |
.admin.ajax-load-more.settings input[type=text],
|
657 |
+
.admin.ajax-load-more.settings input[type=number],
|
658 |
.admin.ajax-load-more.settings .select2-container{
|
659 |
margin-top:10px;
|
660 |
}
|
661 |
.admin.ajax-load-more.settings .ajax-load-more-wrap {
|
662 |
position: relative;
|
663 |
+
top: 10px;
|
664 |
+
padding: 10px;
|
665 |
+
border: 1px dashed #ccc;
|
666 |
+
display: inline-block;
|
667 |
+
margin-top:10px;
|
668 |
}
|
669 |
.admin.ajax-load-more.settings .ajax-load-more-wrap button{
|
670 |
margin: 0 !important;
|
683 |
/* Table Overrides */
|
684 |
.admin.ajax-load-more.settings .form-table td,
|
685 |
.admin.ajax-load-more.settings .form-table th{
|
686 |
+
padding: 30px 0;
|
687 |
}
|
688 |
|
689 |
+
.admin.ajax-load-more.settings .form-table p{
|
690 |
+
margin-top: 0;
|
691 |
}
|
692 |
|
693 |
.header-wrap{
|
716 |
top: -2px;
|
717 |
}
|
718 |
.ajax-load-more h2.addon-title{
|
719 |
+
font-size: 22px !important;
|
720 |
font-weight: 600 !important;
|
721 |
+
color: #555 !important;
|
722 |
padding: 0;
|
723 |
+
margin: 0 0 16px;
|
724 |
+
padding: 0 0 14px;
|
725 |
border-bottom: 1px solid #efefef;
|
726 |
}
|
727 |
.ajax-load-more p.addon-intro{
|
728 |
+
font-size: 18px !important;
|
729 |
+
line-height: 23px !important;
|
730 |
color: #999 !important;
|
731 |
}
|
732 |
|
747 |
}
|
748 |
.ajax-load-more p.desc{
|
749 |
font-size: 12px !important;
|
750 |
+
padding: 0 0 8px 30px;
|
751 |
}
|
752 |
|
753 |
.ajax-load-more p.back2top{
|
admin/editor.php
CHANGED
@@ -25,38 +25,37 @@ function alm_ajax_tinymce(){
|
|
25 |
}
|
26 |
|
27 |
|
28 |
-
|
29 |
-
// registers the buttons for use
|
30 |
-
function alm_friendly_buttons($buttons) {
|
31 |
-
array_push($buttons, 'alm_shortcode_button');
|
32 |
-
return $buttons;
|
33 |
-
}
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
// filters the tinyMCE buttons and adds our custom buttons
|
38 |
add_action('admin_head', 'alm_shortcode_buttons');
|
39 |
function alm_shortcode_buttons() {
|
40 |
// Don't bother doing this stuff if the current user lacks permissions
|
41 |
if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
|
42 |
return;
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
}
|
50 |
|
51 |
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
// add the button to the tinyMCE bar
|
54 |
-
function alm_tinymce_plugin($plugin_array) {
|
55 |
-
|
56 |
-
|
57 |
-
$options = get_option( 'alm_settings' );
|
58 |
-
if($options['_alm_hide_btn'] != '1'){
|
59 |
-
$plugin_array['alm_shortcode_button'] = plugins_url( '/js/editor-btn.js' , __FILE__ );
|
60 |
-
return $plugin_array;
|
61 |
-
}
|
62 |
}
|
25 |
}
|
26 |
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
// filters the tinyMCE buttons and adds our custom buttons
|
29 |
add_action('admin_head', 'alm_shortcode_buttons');
|
30 |
function alm_shortcode_buttons() {
|
31 |
// Don't bother doing this stuff if the current user lacks permissions
|
32 |
if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
|
33 |
return;
|
34 |
+
|
35 |
+
// Check options for hiding shortcode builder
|
36 |
+
$options = get_option( 'alm_settings' );
|
37 |
+
if($options['_alm_hide_btn'] != '1'){
|
38 |
+
// Add only in Rich Editor mode
|
39 |
+
if ( get_user_option('rich_editing') == 'true') {
|
40 |
+
// filter the tinyMCE buttons and add our own
|
41 |
+
add_filter("mce_external_plugins", "alm_tinymce_plugin");
|
42 |
+
add_filter('mce_buttons', 'alm_friendly_buttons');
|
43 |
+
}
|
44 |
}
|
45 |
}
|
46 |
|
47 |
|
48 |
|
49 |
+
// registers the buttons for use
|
50 |
+
function alm_friendly_buttons($buttons) {
|
51 |
+
array_push($buttons, 'alm_shortcode_button');
|
52 |
+
return $buttons;
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
// add the button to the tinyMCE bar
|
58 |
+
function alm_tinymce_plugin($plugin_array) {
|
59 |
+
$plugin_array['alm_shortcode_button'] = plugins_url( '/js/editor-btn.js' , __FILE__ );
|
60 |
+
return $plugin_array;
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
admin/img/add-ons/seo-add-ons.jpg
ADDED
Binary file
|
admin/img/add-ons/unlimited-add-ons.jpg
CHANGED
Binary file
|
admin/shortcode-builder/js/shortcode-builder.js
CHANGED
@@ -18,7 +18,16 @@ jQuery(document).ready(function($) {
|
|
18 |
*/
|
19 |
|
20 |
_alm.buildShortcode = function(){
|
21 |
-
output = '[ajax_load_more';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
// ---------------------------
|
24 |
// - Repeater
|
@@ -198,9 +207,10 @@ jQuery(document).ready(function($) {
|
|
198 |
// - Posts Per Page
|
199 |
// ---------------------------
|
200 |
|
201 |
-
var posts_per_page = $('.posts_per_page select').val();
|
202 |
if(posts_per_page > 0 && posts_per_page !== 5 && $('.posts_per_page select').hasClass('changed'))
|
203 |
-
output += ' posts_per_page="'+posts_per_page+'"';
|
|
|
204 |
|
205 |
|
206 |
// ---------------------------
|
@@ -245,7 +255,7 @@ jQuery(document).ready(function($) {
|
|
245 |
var btn_lbl = $('.btn-label input').val();
|
246 |
btn_lbl = $.trim(btn_lbl);
|
247 |
if(btn_lbl !== '' && $('.btn-label input').hasClass('changed'))
|
248 |
-
output += ' button_label="'+btn_lbl+'"';
|
249 |
|
250 |
|
251 |
output += ']'; //Close shortcode
|
@@ -261,6 +271,8 @@ jQuery(document).ready(function($) {
|
|
261 |
|
262 |
//Select 'post' by default
|
263 |
$('.post_types input[type=checkbox]#chk-post').prop('checked', true).addClass('changed');
|
|
|
|
|
264 |
|
265 |
|
266 |
$(document).on('change keyup', '.alm_element', function() {
|
@@ -270,10 +282,11 @@ jQuery(document).ready(function($) {
|
|
270 |
if(!$('.post_types input[type=checkbox]:checked').length > 0){
|
271 |
$('.post_types input[type=checkbox]#chk-post').prop('checked', true);
|
272 |
}
|
|
|
273 |
// If Tax Term Operator is not selected, select 'IN'.
|
274 |
if(!$('#tax-operator-select input[type=radio]:checked').length > 0){
|
275 |
$('#tax-operator-select input[type=radio]#tax-in-radio').prop('checked', true);
|
276 |
-
}
|
277 |
|
278 |
_alm.buildShortcode();
|
279 |
});
|
18 |
*/
|
19 |
|
20 |
_alm.buildShortcode = function(){
|
21 |
+
output = '[ajax_load_more';
|
22 |
+
|
23 |
+
|
24 |
+
// ---------------------------
|
25 |
+
// - SEO
|
26 |
+
// ---------------------------
|
27 |
+
|
28 |
+
var seo = $('.seo input[name=seo]:checked').val();
|
29 |
+
if(seo !== 'false' && seo != undefined)
|
30 |
+
output += ' seo="'+seo+'"';
|
31 |
|
32 |
// ---------------------------
|
33 |
// - Repeater
|
207 |
// - Posts Per Page
|
208 |
// ---------------------------
|
209 |
|
210 |
+
var posts_per_page = $('.posts_per_page select').val();
|
211 |
if(posts_per_page > 0 && posts_per_page !== 5 && $('.posts_per_page select').hasClass('changed'))
|
212 |
+
output += ' posts_per_page="'+posts_per_page+'"';
|
213 |
+
|
214 |
|
215 |
|
216 |
// ---------------------------
|
255 |
var btn_lbl = $('.btn-label input').val();
|
256 |
btn_lbl = $.trim(btn_lbl);
|
257 |
if(btn_lbl !== '' && $('.btn-label input').hasClass('changed'))
|
258 |
+
output += ' button_label="'+btn_lbl+'"';
|
259 |
|
260 |
|
261 |
output += ']'; //Close shortcode
|
271 |
|
272 |
//Select 'post' by default
|
273 |
$('.post_types input[type=checkbox]#chk-post').prop('checked', true).addClass('changed');
|
274 |
+
//Select SEO 'false' by default
|
275 |
+
$('.seo input[type=radio]#seo-false').prop('checked', true).addClass('changed');
|
276 |
|
277 |
|
278 |
$(document).on('change keyup', '.alm_element', function() {
|
282 |
if(!$('.post_types input[type=checkbox]:checked').length > 0){
|
283 |
$('.post_types input[type=checkbox]#chk-post').prop('checked', true);
|
284 |
}
|
285 |
+
|
286 |
// If Tax Term Operator is not selected, select 'IN'.
|
287 |
if(!$('#tax-operator-select input[type=radio]:checked').length > 0){
|
288 |
$('#tax-operator-select input[type=radio]#tax-in-radio').prop('checked', true);
|
289 |
+
}
|
290 |
|
291 |
_alm.buildShortcode();
|
292 |
});
|
admin/shortcode-builder/shortcode-builder.php
CHANGED
@@ -1,6 +1,33 @@
|
|
1 |
<span class="toggle-all"><span class="inner-wrap"><em class="collapse"><?php _e('Collapse All', ALM_NAME); ?></em><em class="expand"><?php _e('Expand All', ALM_NAME); ?></em></span></span>
|
2 |
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
<?php
|
5 |
|
6 |
// List available repeaters
|
@@ -471,7 +498,6 @@
|
|
471 |
</div>
|
472 |
</div>
|
473 |
</div>
|
474 |
-
<div class="clear"></div>
|
475 |
-
|
476 |
|
|
|
477 |
|
1 |
<span class="toggle-all"><span class="inner-wrap"><em class="collapse"><?php _e('Collapse All', ALM_NAME); ?></em><em class="expand"><?php _e('Expand All', ALM_NAME); ?></em></span></span>
|
2 |
|
3 |
|
4 |
+
|
5 |
+
<?php if(has_action('alm_seo_installed')){ ?>
|
6 |
+
<!-- SEO -->
|
7 |
+
<div class="row input seo" id="alm-seo">
|
8 |
+
<h3 class="heading"><?php _e('SEO (Search Engine Optimization)', ALM_NAME); ?></h3>
|
9 |
+
<div class="expand-wrap">
|
10 |
+
<div class="section-title">
|
11 |
+
<p><?php _e('Enable address bar URL rewrites as users page through ajax loaded content.', ALM_NAME); ?></p>
|
12 |
+
</div>
|
13 |
+
<div class="wrap">
|
14 |
+
<div class="inner">
|
15 |
+
<ul>
|
16 |
+
<li>
|
17 |
+
<input class="alm_element" type="radio" name="seo" value="true" id="seo-true" >
|
18 |
+
<label for="seo-true"><?php _e('True', ALM_NAME); ?></label>
|
19 |
+
</li>
|
20 |
+
<li>
|
21 |
+
<input class="alm_element" type="radio" name="seo" value="false" id="seo-false" checked>
|
22 |
+
<label for="seo-false"><?php _e('False', ALM_NAME); ?></label>
|
23 |
+
</li>
|
24 |
+
</ul>
|
25 |
+
</div>
|
26 |
+
</div>
|
27 |
+
</div>
|
28 |
+
</div>
|
29 |
+
<?php } ?>
|
30 |
+
|
31 |
<?php
|
32 |
|
33 |
// List available repeaters
|
498 |
</div>
|
499 |
</div>
|
500 |
</div>
|
|
|
|
|
501 |
|
502 |
+
<div class="clear"></div>
|
503 |
|
ajax-load-more.php
CHANGED
@@ -6,15 +6,12 @@ Description: A simple solution for lazy loading WordPress posts and pages with A
|
|
6 |
Author: Darren Cooney
|
7 |
Twitter: @KaptonKaos
|
8 |
Author URI: http://connekthq.com
|
9 |
-
Version: 2.
|
10 |
License: GPL
|
11 |
Copyright: Darren Cooney & Connekt Media
|
12 |
-
*/
|
13 |
-
|
14 |
-
|
15 |
-
define('ALM_VERSION', '2.2.8');
|
16 |
-
define('ALM_RELEASE', 'November 25, 2014');
|
17 |
-
|
18 |
/*
|
19 |
* alm_install
|
20 |
* Create table for storing repeater
|
@@ -42,23 +39,19 @@ function alm_install() {
|
|
42 |
|
43 |
//Insert default data in newly created table
|
44 |
$wpdb->insert($table_name , array('name' => 'default', 'repeaterDefault' => $defaultRepeater, 'pluginVersion' => ALM_VERSION));
|
45 |
-
}
|
46 |
}
|
47 |
|
48 |
|
49 |
|
50 |
if( !class_exists('AjaxLoadMore') ):
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
function __construct(){
|
55 |
-
|
56 |
define('ALM_PATH', plugin_dir_path(__FILE__));
|
57 |
define('ALM_URL', plugins_url('', __FILE__));
|
58 |
define('ALM_ADMIN_URL', plugins_url('admin/', __FILE__));
|
59 |
define('ALM_NAME', '_ajax_load_more');
|
60 |
-
define('ALM_TITLE', 'Ajax Load More');
|
61 |
-
|
62 |
|
63 |
add_action('wp_ajax_ajax_load_more_init', array(&$this, 'alm_query_posts'));
|
64 |
add_action('wp_ajax_nopriv_ajax_load_more_init', array(&$this, 'alm_query_posts'));
|
@@ -143,6 +136,7 @@ if( !class_exists('AjaxLoadMore') ):
|
|
143 |
function alm_shortcode( $atts, $content = null ) {
|
144 |
$options = get_option( 'alm_settings' ); //Get plugin options
|
145 |
extract(shortcode_atts(array(
|
|
|
146 |
'repeater' => 'default',
|
147 |
'post_type' => 'post',
|
148 |
'post_format' => '',
|
@@ -165,9 +159,9 @@ if( !class_exists('AjaxLoadMore') ):
|
|
165 |
'max_pages' => '5',
|
166 |
'pause' => 'false',
|
167 |
'transition' => 'slide',
|
168 |
-
'button_label' => 'Older Posts'
|
169 |
),
|
170 |
-
|
171 |
|
172 |
// Get container elements (ul | div)
|
173 |
$container_element = 'ul';
|
@@ -188,7 +182,91 @@ if( !class_exists('AjaxLoadMore') ):
|
|
188 |
$lang = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : '';
|
189 |
|
190 |
$ajaxloadmore = '<div id="ajax-load-more" class="ajax-load-more-wrap '. $btn_color .'">';
|
191 |
-
$ajaxloadmore .= '<'.$container_element.' class="alm-listing'. $classname . '"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
$ajaxloadmore .= '</div>';
|
193 |
|
194 |
return $ajaxloadmore;
|
@@ -243,8 +321,8 @@ if( !class_exists('AjaxLoadMore') ):
|
|
243 |
$offset = (isset($_GET['offset'])) ? $_GET['offset'] : 0;
|
244 |
$lang = (isset($_GET['lang'])) ? $_GET['lang'] : '';
|
245 |
|
246 |
-
// Set up initial args
|
247 |
-
|
248 |
$args = array(
|
249 |
'post_type' => $postType,
|
250 |
'posts_per_page' => $numPosts,
|
@@ -253,6 +331,7 @@ if( !class_exists('AjaxLoadMore') ):
|
|
253 |
'orderby' => $orderby,
|
254 |
'post_status' => 'publish',
|
255 |
'ignore_sticky_posts' => false,
|
|
|
256 |
);
|
257 |
|
258 |
// Category
|
@@ -283,7 +362,7 @@ if( !class_exists('AjaxLoadMore') ):
|
|
283 |
// Exclude posts
|
284 |
// - Please see plugin examples for more info on excluding posts
|
285 |
if(!empty($exclude)){
|
286 |
-
$exclude=explode(",",$exclude);
|
287 |
$args['post__not_in'] = $exclude;
|
288 |
}
|
289 |
|
@@ -367,7 +446,8 @@ if( !class_exists('AjaxLoadMore') ):
|
|
367 |
while ($alm_query->have_posts()): $alm_query->the_post();
|
368 |
$template = $repeater;
|
369 |
$include = '';
|
370 |
-
$found = false;
|
|
|
371 |
|
372 |
// If is Custom Repeaters add-on
|
373 |
if( $type == 'repeater' && has_action('alm_repeater_installed' ))
|
6 |
Author: Darren Cooney
|
7 |
Twitter: @KaptonKaos
|
8 |
Author URI: http://connekthq.com
|
9 |
+
Version: 2.3.1
|
10 |
License: GPL
|
11 |
Copyright: Darren Cooney & Connekt Media
|
12 |
+
*/
|
13 |
+
define('ALM_VERSION', '2.3.1');
|
14 |
+
define('ALM_RELEASE', 'December 9, 2014');
|
|
|
|
|
|
|
15 |
/*
|
16 |
* alm_install
|
17 |
* Create table for storing repeater
|
39 |
|
40 |
//Insert default data in newly created table
|
41 |
$wpdb->insert($table_name , array('name' => 'default', 'repeaterDefault' => $defaultRepeater, 'pluginVersion' => ALM_VERSION));
|
42 |
+
}
|
43 |
}
|
44 |
|
45 |
|
46 |
|
47 |
if( !class_exists('AjaxLoadMore') ):
|
48 |
+
class AjaxLoadMore {
|
49 |
+
function __construct(){
|
|
|
|
|
|
|
50 |
define('ALM_PATH', plugin_dir_path(__FILE__));
|
51 |
define('ALM_URL', plugins_url('', __FILE__));
|
52 |
define('ALM_ADMIN_URL', plugins_url('admin/', __FILE__));
|
53 |
define('ALM_NAME', '_ajax_load_more');
|
54 |
+
define('ALM_TITLE', 'Ajax Load More');
|
|
|
55 |
|
56 |
add_action('wp_ajax_ajax_load_more_init', array(&$this, 'alm_query_posts'));
|
57 |
add_action('wp_ajax_nopriv_ajax_load_more_init', array(&$this, 'alm_query_posts'));
|
136 |
function alm_shortcode( $atts, $content = null ) {
|
137 |
$options = get_option( 'alm_settings' ); //Get plugin options
|
138 |
extract(shortcode_atts(array(
|
139 |
+
'seo' => false,
|
140 |
'repeater' => 'default',
|
141 |
'post_type' => 'post',
|
142 |
'post_format' => '',
|
159 |
'max_pages' => '5',
|
160 |
'pause' => 'false',
|
161 |
'transition' => 'slide',
|
162 |
+
'button_label' => 'Older Posts',
|
163 |
),
|
164 |
+
$atts));
|
165 |
|
166 |
// Get container elements (ul | div)
|
167 |
$container_element = 'ul';
|
182 |
$lang = defined('ICL_LANGUAGE_CODE') ? ICL_LANGUAGE_CODE : '';
|
183 |
|
184 |
$ajaxloadmore = '<div id="ajax-load-more" class="ajax-load-more-wrap '. $btn_color .'">';
|
185 |
+
$ajaxloadmore .= '<'.$container_element.' class="alm-listing'. $classname . '"';
|
186 |
+
$ajaxloadmore .= ' data-repeater="'.$repeater.'"';
|
187 |
+
$ajaxloadmore .= ' data-post-type="'.$post_type.'"';
|
188 |
+
$ajaxloadmore .= ' data-post-format="'.$post_format.'"';
|
189 |
+
$ajaxloadmore .= ' data-category="'.$category.'"';
|
190 |
+
$ajaxloadmore .= ' data-taxonomy="'.$taxonomy.'"';
|
191 |
+
$ajaxloadmore .= ' data-taxonomy-terms="'.$taxonomy_terms.'"';
|
192 |
+
$ajaxloadmore .= ' data-taxonomy-operator="'.$taxonomy_operator.'"';
|
193 |
+
$ajaxloadmore .= ' data-tag="'.$tag.'"';
|
194 |
+
$ajaxloadmore .= ' data-meta-key="'.$meta_key.'"';
|
195 |
+
$ajaxloadmore .= ' data-meta-value="'.$meta_value.'"';
|
196 |
+
$ajaxloadmore .= ' data-meta-compare="'.$meta_compare.'"';
|
197 |
+
$ajaxloadmore .= ' data-author="'.$author.'"';
|
198 |
+
$ajaxloadmore .= ' data-search="'.$search.'"';
|
199 |
+
$ajaxloadmore .= ' data-order="'.$order.'"';
|
200 |
+
$ajaxloadmore .= ' data-orderby="'.$orderby.'"';
|
201 |
+
$ajaxloadmore .= ' data-exclude="'.$exclude.'"';
|
202 |
+
$ajaxloadmore .= ' data-offset="'.$offset.'"';
|
203 |
+
|
204 |
+
// Posts per page
|
205 |
+
$wp_posts_per_page = get_option( 'posts_per_page' );
|
206 |
+
|
207 |
+
/* If posts per page on settings -> reading is great than shortcode value
|
208 |
+
& the SEO add-on is installed.
|
209 |
+
Set $posts_per_page to be new value
|
210 |
+
*/
|
211 |
+
if($wp_posts_per_page > $posts_per_page && has_action('alm_seo_installed') && $seo)
|
212 |
+
$posts_per_page = $wp_posts_per_page;
|
213 |
+
|
214 |
+
$ajaxloadmore .= ' data-posts-per-page="'.$posts_per_page.'"';
|
215 |
+
|
216 |
+
$ajaxloadmore .= ' data-lang="'.$lang.'"';
|
217 |
+
$ajaxloadmore .= ' data-scroll="'.$scroll.'"';
|
218 |
+
$ajaxloadmore .= ' data-max-pages="'.$max_pages.'"';
|
219 |
+
$ajaxloadmore .= ' data-pause="'.$pause.'"';
|
220 |
+
$ajaxloadmore .= ' data-button-label="'.$button_label.'"';
|
221 |
+
$ajaxloadmore .= ' data-transition="'.$transition.'"';
|
222 |
+
|
223 |
+
if(has_action('alm_seo_installed') && $seo){
|
224 |
+
|
225 |
+
// Get scroll speed
|
226 |
+
$seo_scroll_speed = '1000';
|
227 |
+
if(isset($options['_alm_seo_speed'])){
|
228 |
+
$seo_scroll_speed = ''.$options['_alm_seo_speed'];
|
229 |
+
}
|
230 |
+
|
231 |
+
// Enabled Scrolling
|
232 |
+
$ajaxloadmore .= ' data-test-seo-scroll="'.$options['_alm_seo_scroll'].'"';
|
233 |
+
$seo_enable_scroll = $options['_alm_seo_scroll'];
|
234 |
+
if(!isset($seo_enable_scroll) || empty($seo_enable_scroll)){
|
235 |
+
$seo_enable_scroll = 'true';
|
236 |
+
}else{
|
237 |
+
if($seo_enable_scroll == '1'){
|
238 |
+
$seo_enable_scroll = 'true';
|
239 |
+
}else{
|
240 |
+
$seo_enable_scroll = 'false';
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
// Permalink Structure
|
245 |
+
$seo_permalink = 'pretty';
|
246 |
+
if(isset($options['_alm_seo_permalinks'])){
|
247 |
+
$seo_permalink = ''.$options['_alm_seo_permalinks'];
|
248 |
+
}
|
249 |
+
|
250 |
+
// Get $paged var from WP
|
251 |
+
if ( get_query_var('paged') ) {
|
252 |
+
$current_page = get_query_var('paged');
|
253 |
+
} elseif ( get_query_var('page') ) {
|
254 |
+
$current_page = get_query_var('page');
|
255 |
+
} else {
|
256 |
+
$current_page = 1;
|
257 |
+
}
|
258 |
+
$ajaxloadmore .= ' data-seo="'.$seo.'"';
|
259 |
+
$ajaxloadmore .= ' data-seo-start-page="'.$current_page.'"';
|
260 |
+
$ajaxloadmore .= ' data-seo-scroll="'.$seo_enable_scroll.'"';
|
261 |
+
$ajaxloadmore .= ' data-seo-scroll-speed="'.$seo_scroll_speed.'"';
|
262 |
+
$ajaxloadmore .= ' data-seo-permalink="'.$seo_permalink.'"';
|
263 |
+
|
264 |
+
//Get posts per page option from /wp-admin/options-reading.php
|
265 |
+
//$ajaxloadmore .= ' data-posts-per-page="'.$posts_per_page.'"';
|
266 |
+
|
267 |
+
}
|
268 |
+
|
269 |
+
$ajaxloadmore .= '></'.$container_element.'>';
|
270 |
$ajaxloadmore .= '</div>';
|
271 |
|
272 |
return $ajaxloadmore;
|
321 |
$offset = (isset($_GET['offset'])) ? $_GET['offset'] : 0;
|
322 |
$lang = (isset($_GET['lang'])) ? $_GET['lang'] : '';
|
323 |
|
324 |
+
// Set up initial args
|
325 |
+
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
|
326 |
$args = array(
|
327 |
'post_type' => $postType,
|
328 |
'posts_per_page' => $numPosts,
|
331 |
'orderby' => $orderby,
|
332 |
'post_status' => 'publish',
|
333 |
'ignore_sticky_posts' => false,
|
334 |
+
'paged' => $paged,
|
335 |
);
|
336 |
|
337 |
// Category
|
362 |
// Exclude posts
|
363 |
// - Please see plugin examples for more info on excluding posts
|
364 |
if(!empty($exclude)){
|
365 |
+
$exclude = explode(",",$exclude);
|
366 |
$args['post__not_in'] = $exclude;
|
367 |
}
|
368 |
|
446 |
while ($alm_query->have_posts()): $alm_query->the_post();
|
447 |
$template = $repeater;
|
448 |
$include = '';
|
449 |
+
$found = false;
|
450 |
+
//array_push($exclude, $post->ID); // Push post IDs into exclude array
|
451 |
|
452 |
// If is Custom Repeaters add-on
|
453 |
if( $type == 'repeater' && has_action('alm_repeater_installed' ))
|
core/js/ajax-load-more.js
CHANGED
@@ -37,9 +37,41 @@
|
|
37 |
alm.offset = alm.content.data('offset');
|
38 |
alm.transition = alm.content.data('transition');
|
39 |
alm.lang = alm.content.data('lang');
|
40 |
-
alm.posts_per_page = alm.content.data('posts-per-page');
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
// Check for pause on init
|
44 |
// Pause could be used to hold the loading of posts for a button click.
|
45 |
if (alm.pause === undefined) {
|
@@ -130,7 +162,7 @@
|
|
130 |
orderby: alm.content.data('orderby'),
|
131 |
search: alm.content.data('search'),
|
132 |
exclude: alm.content.data('exclude'),
|
133 |
-
numPosts: alm.
|
134 |
pageNumber: alm.page,
|
135 |
offset: alm.offset,
|
136 |
lang: alm.lang
|
@@ -148,6 +180,12 @@
|
|
148 |
if (alm.init) {
|
149 |
alm.button.text(alm.button_label);
|
150 |
alm.init = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
}
|
152 |
if (alm.data.length > 0) {
|
153 |
alm.el = $('<div class="' + alm.prefix + 'reveal"/>');
|
@@ -173,10 +211,19 @@
|
|
173 |
}
|
174 |
});
|
175 |
}
|
176 |
-
|
|
|
177 |
if ($.isFunction($.fn.almComplete)) {
|
178 |
$.fn.almComplete(alm);
|
179 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
} else {
|
182 |
alm.button.delay(alm.speed).removeClass('loading').addClass('done');
|
37 |
alm.offset = alm.content.data('offset');
|
38 |
alm.transition = alm.content.data('transition');
|
39 |
alm.lang = alm.content.data('lang');
|
40 |
+
alm.posts_per_page = alm.content.data('posts-per-page');
|
41 |
+
|
42 |
+
|
43 |
+
/* SEO ADD-ON */
|
44 |
+
// - get SEO values from shortcode
|
45 |
+
// - Added v2.3
|
46 |
+
|
47 |
+
alm.seo = alm.content.data('seo'); // true | false
|
48 |
+
if (alm.seo === undefined)
|
49 |
+
alm.seo = false;
|
50 |
+
|
51 |
+
alm.permalink = alm.content.data('seo-permalink');
|
52 |
+
alm.start_page = alm.content.data('seo-start-page');
|
53 |
+
|
54 |
+
if(alm.start_page){
|
55 |
+
|
56 |
+
alm.seo_scroll = alm.content.data('seo-scroll');
|
57 |
+
alm.seo_scroll_speed = alm.content.data('seo-scroll-speed');
|
58 |
+
|
59 |
+
alm.isPaged = false;
|
60 |
+
|
61 |
+
if(alm.start_page > 1) {
|
62 |
+
alm.isPaged = true; // Is this a $paged page > 1 ?
|
63 |
+
alm.posts_per_page = alm.start_page * alm.posts_per_page;
|
64 |
+
}
|
65 |
+
|
66 |
+
}
|
67 |
+
/* END SEO Add-on */
|
68 |
+
|
69 |
+
|
70 |
+
//Prevent loading of unnessasry posts - move user to top of page
|
71 |
+
// Removed v2.3.0
|
72 |
+
$(window).scrollTop(0);
|
73 |
+
|
74 |
+
|
75 |
// Check for pause on init
|
76 |
// Pause could be used to hold the loading of posts for a button click.
|
77 |
if (alm.pause === undefined) {
|
162 |
orderby: alm.content.data('orderby'),
|
163 |
search: alm.content.data('search'),
|
164 |
exclude: alm.content.data('exclude'),
|
165 |
+
numPosts: alm.posts_per_page,
|
166 |
pageNumber: alm.page,
|
167 |
offset: alm.offset,
|
168 |
lang: alm.lang
|
180 |
if (alm.init) {
|
181 |
alm.button.text(alm.button_label);
|
182 |
alm.init = false;
|
183 |
+
|
184 |
+
if(alm.isPaged){
|
185 |
+
alm.posts_per_page = alm.content.data('posts-per-page'); // Reset our posts per page variable
|
186 |
+
alm.page = alm.start_page - 1; // Set our new page #
|
187 |
+
}
|
188 |
+
|
189 |
}
|
190 |
if (alm.data.length > 0) {
|
191 |
alm.el = $('<div class="' + alm.prefix + 'reveal"/>');
|
211 |
}
|
212 |
});
|
213 |
}
|
214 |
+
|
215 |
+
// ALM Complete
|
216 |
if ($.isFunction($.fn.almComplete)) {
|
217 |
$.fn.almComplete(alm);
|
218 |
}
|
219 |
+
|
220 |
+
// ALM SEO
|
221 |
+
// - Only run if a single instance is on the page.
|
222 |
+
if($(".ajax-load-more-wrap").length === 1){
|
223 |
+
if ($.isFunction($.fn.almSEO) && alm.seo) {
|
224 |
+
$.fn.almSEO(alm);
|
225 |
+
}
|
226 |
+
}
|
227 |
|
228 |
} else {
|
229 |
alm.button.delay(alm.speed).removeClass('loading').addClass('done');
|
core/js/ajax-load-more.min.js
CHANGED
@@ -11,4 +11,22 @@
|
|
11 |
* Twitter: @KaptonKaos
|
12 |
*/
|
13 |
|
14 |
-
(function(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
* Twitter: @KaptonKaos
|
12 |
*/
|
13 |
|
14 |
+
(function($){"use strict";$.ajaxloadmore=function(el){var alm=this;alm.AjaxLoadMore={};alm.page=0;alm.speed=300;alm.proceed=false;alm.init=true;alm.loading=true;alm.finished=false;alm.window=$(window);alm.button_label='';alm.data;alm.el=el;alm.content=$('.alm-listing',alm.el);alm.scroll=true;alm.prefix='alm-';alm.repeater=alm.content.data('repeater');alm.max_pages=alm.content.data('max-pages');alm.pause=alm.content.data('pause');alm.offset=alm.content.data('offset');alm.transition=alm.content.data('transition');alm.lang=alm.content.data('lang');alm.posts_per_page=alm.content.data('posts-per-page');alm.seo=alm.content.data('seo');if(alm.seo===undefined)
|
15 |
+
alm.seo=false;alm.permalink=alm.content.data('seo-permalink');alm.start_page=alm.content.data('seo-start-page');if(alm.start_page){alm.seo_scroll=alm.content.data('seo-scroll');alm.seo_scroll_speed=alm.content.data('seo-scroll-speed');alm.isPaged=false;if(alm.start_page>1){alm.isPaged=true;alm.posts_per_page=alm.start_page*alm.posts_per_page;}}
|
16 |
+
$(window).scrollTop(0);if(alm.pause===undefined){alm.pause=false;}
|
17 |
+
if(alm.repeater===undefined){alm.repeater='default';}
|
18 |
+
if(alm.max_pages===undefined){alm.max_pages=5;}
|
19 |
+
if(alm.max_pages==='none'){alm.max_pages=1000000;}
|
20 |
+
if(alm.transition===undefined){alm.transition='slide';}else if(alm.transition==="fade"){alm.transition='fade';}else{alm.transition='slide';}
|
21 |
+
if(alm.content.data('offset')===undefined){alm.offset=0;}else{alm.offset=alm.content.data('offset');}
|
22 |
+
if(alm.content.data('button-label')===undefined){alm.button_label='Older Posts';}else{alm.button_label=alm.content.data('button-label');}
|
23 |
+
if(alm.content.data('scroll')===undefined){alm.scroll=true;}else if(alm.content.data('scroll')===false){alm.scroll=false;}else{alm.scroll=true;}
|
24 |
+
alm.post_type=alm.content.data('post-type');alm.post_type=alm.post_type.split(",");alm.el.append('<div class="'+alm.prefix+'btn-wrap"><button id="load-more" class="'+alm.prefix+'load-more-btn more">'+alm.button_label+'</button></div>');alm.button=$('.alm-load-more-btn',alm.el);alm.AjaxLoadMore.loadPosts=function(){alm.button.addClass('loading');alm.loading=true;$.ajax({type:"GET",url:alm_localize.ajaxurl,data:{action:'ajax_load_more_init',nonce:alm_localize.alm_nonce,repeater:alm.repeater,postType:alm.post_type,postFormat:alm.content.data('post-format'),category:alm.content.data('category'),author:alm.content.data('author'),taxonomy:alm.content.data('taxonomy'),taxonomy_terms:alm.content.data('taxonomy-terms'),taxonomy_operator:alm.content.data('taxonomy-operator'),meta_key:alm.content.data('meta-key'),meta_value:alm.content.data('meta-value'),meta_compare:alm.content.data('meta-compare'),tag:alm.content.data('tag'),order:alm.content.data('order'),orderby:alm.content.data('orderby'),search:alm.content.data('search'),exclude:alm.content.data('exclude'),numPosts:alm.posts_per_page,pageNumber:alm.page,offset:alm.offset,lang:alm.lang},dataType:"html",beforeSend:function(){if(alm.page!=1){alm.button.addClass('loading');}},success:function(data){alm.data=$(data);if(alm.init){alm.button.text(alm.button_label);alm.init=false;if(alm.isPaged){alm.posts_per_page=alm.content.data('posts-per-page');alm.page=alm.start_page-1;}}
|
25 |
+
if(alm.data.length>0){alm.el=$('<div class="'+alm.prefix+'reveal"/>');alm.el.append(alm.data);alm.el.hide();alm.content.append(alm.el);if(alm.transition==='fade'){alm.el.fadeIn(alm.speed,'alm_easeInOutQuad',function(){alm.loading=false;alm.button.delay(alm.speed).removeClass('loading');if(alm.data.length<alm.posts_per_page){alm.finished=true;alm.button.addClass('done');}});}else{alm.el.slideDown(alm.speed,'alm_easeInOutQuad',function(){alm.loading=false;alm.button.delay(alm.speed).removeClass('loading');if(alm.data.length<alm.posts_per_page){alm.finished=true;alm.button.addClass('done');}});}
|
26 |
+
if($.isFunction($.fn.almComplete)){$.fn.almComplete(alm);}
|
27 |
+
if($(".ajax-load-more-wrap").length===1){if($.isFunction($.fn.almSEO)&&alm.seo){$.fn.almSEO(alm);}}}else{alm.button.delay(alm.speed).removeClass('loading').addClass('done');alm.loading=false;alm.finished=true;}},error:function(jqXHR,textStatus,errorThrown){alm.loading=false;alm.button.removeClass('loading');}});};alm.button.on('click',function(){if(alm.pause===true){alm.pause=false;alm.AjaxLoadMore.loadPosts();}
|
28 |
+
if(!alm.loading&&!alm.finished&&!$(this).hasClass('done')){alm.loading=true;alm.page++;alm.AjaxLoadMore.loadPosts();}});alm.AjaxLoadMore.isVisible=function(){alm.visible=false;if(alm.el.is(":visible")){alm.visible=true;}
|
29 |
+
return alm.visible;};if(alm.scroll){alm.window.bind("scroll touchstart",function(){if(alm.AjaxLoadMore.isVisible()){var content_offset=alm.button.offset();if(!alm.loading&&!alm.finished&&alm.window.scrollTop()>=Math.round(content_offset.top-(alm.window.height()-150))&&alm.page<(alm.max_pages-1)&&alm.proceed&&!alm.pause){alm.loading=true;alm.page++;alm.AjaxLoadMore.loadPosts();}}});}
|
30 |
+
if(alm.pause===true){alm.button.text(alm.button_label);alm.loading=false;}else{alm.AjaxLoadMore.loadPosts();}
|
31 |
+
setTimeout(function(){alm.proceed=true;},1000);$.easing.alm_easeInOutQuad=function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;};};$.fn.ajaxloadmore=function(){return this.each(function(){$(this).data('alm',new $.ajaxloadmore($(this)));});}
|
32 |
+
if($(".ajax-load-more-wrap").length)$(".ajax-load-more-wrap").ajaxloadmore();})(jQuery);
|
core/repeater/default.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<li>
|
2 |
-
<?php if ( has_post_thumbnail() ) { the_post_thumbnail(array(100,100));
|
3 |
-
}?>
|
4 |
-
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
|
5 |
-
<p class="entry-meta">
|
6 |
-
|
7 |
-
</p>
|
8 |
-
<?php the_excerpt(); ?>
|
9 |
</li>
|
1 |
<li>
|
2 |
+
<?php if ( has_post_thumbnail() ) { the_post_thumbnail(array(100,100));
|
3 |
+
}?>
|
4 |
+
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
|
5 |
+
<p class="entry-meta">
|
6 |
+
<?php the_time("F d, Y"); ?>
|
7 |
+
</p>
|
8 |
+
<?php the_excerpt(); ?>
|
9 |
</li>
|