jquery - Infinite scroll on mobile and pagination on desktop -
i want set infinite scroll plugin on wordpress theme. domain "http://www.unionsnetworksindacale.eu/". plugin asks 4 items: https://s.w.org/plugins/infinite-scroll/screenshot-1.png?r=1204131. i'm not able find selectors. want apply infinite scroll on mobile version. help!!!! :) thanks!
it seems using "forceful" wordpress theme "copa themes" , using this plugin.
as far saw, didn't modify element classes. classes names configuration page be:
content selector class name: main-content
navigation selector class name: main-nav
next selector class name: next page-numbers
item selector class name: entry-content
i took class names official demo site of theme , matched theme. these should work perfectly.
so far, plugin doesn't support "only mobile" mood. if desperate, can hack (but won't suggest anyway break when plugin updates , have hack everytime update theme/plugin).
so can javascript. @ first, edit plugin , remove "wp_enqueue_script" function plugin doesn't load js file when page loads. can use following condition check browser width , load js manually on demand:
<script> if (screen && screen.width < 360) { document.write('<script type="text/javascript" src="plugin_js_location"><\/script>'); } </script>
which not idea @ imo.
a better approach using wp_is_mobile() function while enqueuing plugin js. can replace line 80 in plugin following code (i used version 2.6.2 code):
if ( wp_is_mobile() ) { add_action( 'wp_enqueue_scripts', array( &$this, 'enqueue_js' ) ); }
hope helps.
Comments
Post a Comment