Title: alextsoi's Replies | WordPress.org

---

# alextsoi

  [  ](https://wordpress.org/support/users/alextsoi/)

 *   [Profile](https://wordpress.org/support/users/alextsoi/)
 *   [Topics Started](https://wordpress.org/support/users/alextsoi/topics/)
 *   [Replies Created](https://wordpress.org/support/users/alextsoi/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/alextsoi/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/alextsoi/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/alextsoi/engagements/)
 *   [Favorites](https://wordpress.org/support/users/alextsoi/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] is there any post ordering plugin that works with Infinite Scroll?](https://wordpress.org/support/topic/is-there-any-post-ordering-plugin-that-works-with-infinite-scroll/)
 *  [alextsoi](https://wordpress.org/support/users/alextsoi/)
 * (@alextsoi)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/is-there-any-post-ordering-plugin-that-works-with-infinite-scroll/#post-8240921)
 * I am using jetpack version 4.3.1. My fix is in the below, so far so good.
 *     ```
       add_filter( 'infinite_scroll_query_args', 'jetpack_infinite_scroll_query_args' );
   
       function jetpack_infinite_scroll_query_args( $args ) {
   
           // Customize the ordering
           $args['orderby'] = 'meta_value_num';
           $args['meta_key'] = 'YOUR_META_KEY';
           $args['order'] = 'DESC';
   
           try{
           	// Get the start page, if the request is from 1st page, it will be 0,  and then no need to do decrement.
           	$startPage = intval($_POST['query_args']['paged']);
           	if($startPage != 0) $startPage--;
   
               // Adding $args is to avoid the people making infinite scrolling request in
               // non 1st page
           	$currentPage = ($args['paged'] + $startPage);
   
           }catch(Exception $x){
               // If error exists, I just use back the paged argument
           	$currentPage = $args['paged'];
           }
   
           // Using offset is used to override the paged args which will be used in WP_Query
           $args['offset'] = $args['posts_per_page'] * $currentPage;
   
           return $args;
       }
       ```
   
 * If you will use infinite scroll for custom post type with meta_key ordering, 
   you have to change the query params in ‘pre_get_posts’ hook too to make the post
   display consistent.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Favicon by RealFaviconGenerator] Report Error if using WPML together](https://wordpress.org/support/topic/report-error-if-using-wpml-together/)
 *  Thread Starter [alextsoi](https://wordpress.org/support/users/alextsoi/)
 * (@alextsoi)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/report-error-if-using-wpml-together/#post-7082590)
 * Sorry for the late response, and my version (3.2.7) is older than 3.3.4, so the
   problem I mentioned may be fixed in newer version. Sorry again for helping me
   checking the code for a long time ><
 * Please feel free to close the ticket. Thank you very much
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Favicon by RealFaviconGenerator] Report Error if using WPML together](https://wordpress.org/support/topic/report-error-if-using-wpml-together/)
 *  Thread Starter [alextsoi](https://wordpress.org/support/users/alextsoi/)
 * (@alextsoi)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/report-error-if-using-wpml-together/#post-7082543)
 * The problem is the value of a variable called $ajax_url is wrong in line 236 
   of the attached file. The ajax request URL return 404 such that it makes the 
   plugin unable to work.
 * I saw the language slug is added in the $ajax_url, i.e. [http://YOUR_DOMAIN.com/en/admin_ajax.phpXXXXX](http://YOUR_DOMAIN.com/en/admin_ajax.phpXXXXX),
   and if I remove the language slug, the ajax request will be processed successfully.
   Since I don’t have time to check on the details, but I think the WPML may did
   something while generating the variable $ajax_url.
 * P.S. my default website language is not english, but chinese, so the site may
   automatically add some language slug to the URL.
    P.S. only line 236 of the attached
   file ( appearance.php ) is changed, otherwise are same as the RealFaviconGenerator
   plugin.
 * Temp link: [https://github.com/alextsoi/temp-fix-RealFaviconGenerator/blob/master/appearance.php](https://github.com/alextsoi/temp-fix-RealFaviconGenerator/blob/master/appearance.php)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Favicon by RealFaviconGenerator] Report Error if using WPML together](https://wordpress.org/support/topic/report-error-if-using-wpml-together/)
 *  Thread Starter [alextsoi](https://wordpress.org/support/users/alextsoi/)
 * (@alextsoi)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/report-error-if-using-wpml-together/#post-7082536)
 * I am sorry, I just saw your reply. I will upload the sample code of the file 
   with incorrect ajax url within today. For WPML, I think you may need to ask WPML
   team since there are multiple plugins for WPML.
 * My simple guess is “WPML probably added a function to a hook for building url”.

Viewing 4 replies - 1 through 4 (of 4 total)