Title: Load More function create duplicate post
Last modified: August 21, 2020

---

# Load More function create duplicate post

 *  Resolved [pulaoo](https://wordpress.org/support/users/pulaoo/)
 * (@pulaoo)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/load-more-function-create-duplicate-post/)
 * Hi,
 * I am using the load more function through elementor pro and figured out today
   that it creates a duplicate of my post after the load more has been clicked.
 * Does anybody have a way to fix it?
 * Thank you
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fload-more-function-create-duplicate-post%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [esalari](https://wordpress.org/support/users/esalari/)
 * (@esalari)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/load-more-function-create-duplicate-post/#post-13347978)
 * I have the same issue. Also, it removes some posts to be shown.
 * I assume, after the load more feature has been triggered, some posts will be 
   shown again (duplicated) instead of showing the remaining posts that have not
   been rendered yet.
 *  Plugin Author [dudaster](https://wordpress.org/support/users/dudaster/)
 * (@dudaster)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/load-more-function-create-duplicate-post/#post-13355689)
 * Working on a fix but you can alter the query using this method:
    [https://developers.elementor.com/custom-query-filter/](https://developers.elementor.com/custom-query-filter/)
 * And you can filter the posts that are shown.
 * Also are there more then one posts widgets on page?
 *  [esalari](https://wordpress.org/support/users/esalari/)
 * (@esalari)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/load-more-function-create-duplicate-post/#post-13357094)
 * Would you mind elaborate on this? Her is what I did but not working. Please let
   me know how to make it work:
 * Snippet:
    // Showing multiple post types in Posts Widget add_action( ‘elementor/
   query/my_custom_filter’, function( $query ) { // Here we set the query to fetch
   posts with // post type of ‘custom-post-type1’ and ‘custom-post-type2’ $query-
   >set( ‘post_type’, [ ‘post’ ] ); } );
 * and under Edit Post > Query > Query ID I put this:
    my_custom_filter
 * Is that right?
 * thanks
    -  This reply was modified 5 years, 9 months ago by [esalari](https://wordpress.org/support/users/esalari/).
 *  [esalari](https://wordpress.org/support/users/esalari/)
 * (@esalari)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/load-more-function-create-duplicate-post/#post-13357113)
 * Also, is it possible to remove the change in the URL for pagination? In other
   words, when the user scrolls down, the URL changes from mysite.com/ to mysite.
   com/page/1/ and mysite.com/page/2/ and so on. This can cause some issues when
   users refreshes the page and the user will see a 404-page error. So, it would
   be great to disable page URL change/update on the scroll.
 * Thanks
 *  [esalari](https://wordpress.org/support/users/esalari/)
 * (@esalari)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/load-more-function-create-duplicate-post/#post-13357178)
 * Also tried this in my Child Theme with no luck:
 * add_action(‘elementor/query/my_custom_filter’, function($query){
    $query -> set(‘
   order’, ‘random’); });
 *  Plugin Author [dudaster](https://wordpress.org/support/users/dudaster/)
 * (@dudaster)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/load-more-function-create-duplicate-post/#post-13391204)
 * you can use this custom query filter hook:
 *     ```
       // Adding a custom filter to post widget
       add_action( 'elementor/query/uniq_rand', function( $query ) {
       	// Here we set the query 
       	if($query->query['paged']==1 || !isset($_SESSION['rand_seed'])) {
       		$_SESSION['rand_seed'] = rand();
       	}
       	$query->set( 'orderby','RAND('.$_SESSION['rand_seed'].')' );
       } );
       ```
   
 * In Posts Widget in Custom Query ID you set: `uniq_rand` .
    Also make sure you
   have this line on the top of the functions.php for this hook to work: `session_start();`

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

The topic ‘Load More function create duplicate post’ is closed to new replies.

 * ![](https://ps.w.org/ele-custom-skin/assets/icon.svg?rev=3536751)
 * [ECS - Ele Custom Skin for Elementor](https://wordpress.org/plugins/ele-custom-skin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ele-custom-skin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ele-custom-skin/)
 * [Active Topics](https://wordpress.org/support/plugin/ele-custom-skin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ele-custom-skin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ele-custom-skin/reviews/)

## Tags

 * [duplicate posts](https://wordpress.org/support/topic-tag/duplicate-posts/)
 * [load more](https://wordpress.org/support/topic-tag/load-more/)

 * 6 replies
 * 8 participants
 * Last reply from: [dudaster](https://wordpress.org/support/users/dudaster/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/load-more-function-create-duplicate-post/#post-13391204)
 * Status: resolved