Title: Duplicate posts
Last modified: May 21, 2025

---

# Duplicate posts

 *  Resolved [joanlaura404](https://wordpress.org/support/users/joanlaura404/)
 * (@joanlaura404)
 * [1 year ago](https://wordpress.org/support/topic/duplicate-posts-73/)
 * Have version 2.9.70 installed and setup to display a custom post type with a 
   custom layout using in the instructions provided. I have filter turned off and
   everything looks great except I’ve noticed that when using the Load More pagination
   option, the items are repeating. In my case I have 20 items, 4 per row. When 
   loading more I end up with the right amount of items display but there are multiple
   being repeated. When I switch to numeric pagination type, everything displays
   correctly. I also tried Scroll Infinity option and that also shows repeated items.

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

 *  Plugin Author [YMC](https://wordpress.org/support/users/wssoffice21/)
 * (@wssoffice21)
 * [1 year ago](https://wordpress.org/support/topic/duplicate-posts-73/#post-18477786)
 * Hi!
 * Send us a link to the page of your site where the filter is located. We need 
   to test it on your side since everything works correctly on our side.
    -  This reply was modified 1 year ago by [YMC](https://wordpress.org/support/users/wssoffice21/).
 *  Plugin Author [YMC](https://wordpress.org/support/users/wssoffice21/)
 * (@wssoffice21)
 * [1 year ago](https://wordpress.org/support/topic/duplicate-posts-73/#post-18478729)
 * We hope that you were able to solve your issue.
 *  Thread Starter [joanlaura404](https://wordpress.org/support/users/joanlaura404/)
 * (@joanlaura404)
 * [1 year ago](https://wordpress.org/support/topic/duplicate-posts-73/#post-18478780)
 * Here is our staging site homepage: [https://wordpress-881001-5452117.cloudwaysapps.com/](https://wordpress-881001-5452117.cloudwaysapps.com/)
 * We’re using the shortcode after the Premier Private Outfitters title. Outfitters
   is the custom post type, and there are a total of 18 published outfitters. After
   you click View More twice it shows 18 blocks but you can see some are repeated.
 * Here is the code I have in my functions.php for the custom layout
 *     ```wp-block-code
       function my_custom_post_layout( $layout, $post_id) {    $outfitter_title = get_the_title( $post_id );    $outfitter_link = get_permalink($post_id);    $outfitter_img = get_the_post_thumbnail_url( $post_id, 'full' );       $layout = '';       $layout .= '<a href="';       $layout .= $outfitter_link;       $layout .= '"><div class="hp-out-block" style="position:relative; background-image: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.8)),url(';       $layout .= $outfitter_img;       $layout .= ');"><h3 class="white-text fs-30 font-proh">';       $layout .= $outfitter_title;       $layout .= '</h3></div></a>';     return $layout;  }  add_filter( 'ymc_post_custom_layout_47569_1', 'my_custom_post_layout', 10, 2 );
       ```
   
 *  Plugin Author [YMC](https://wordpress.org/support/users/wssoffice21/)
 * (@wssoffice21)
 * [1 year ago](https://wordpress.org/support/topic/duplicate-posts-73/#post-18478909)
 * Check the code for correctness: this is the code you should have
 * function my_custom_post_layout( $layout, $post_id, $filter_id, $increment_post,
   $arrOptions ) {
   $outfitter_title = get_the_title( $post_id );$outfitter_link 
   = get_permalink($post_id);$outfitter_img = get_the_post_thumbnail_url( $post_id,‘
   full’ );
 *     ```wp-block-code
       $layout = '';  
       $layout .= $outfitter_title;  
       $layout .= $outfitter_link;    
   
       return $layout; 
       ```
   
 * }
   add_filter( ‘ymc_post_custom_layout_47569_1’, ‘my_custom_post_layout’, 10, 
   5 );
 * In addition, fix the errors that are on the site, as this may cause a failure
   in the execution of Ajax requests – [https://prnt.sc/rExvxzsaSvLe](https://prnt.sc/rExvxzsaSvLe)
 *  Thread Starter [joanlaura404](https://wordpress.org/support/users/joanlaura404/)
 * (@joanlaura404)
 * [1 year ago](https://wordpress.org/support/topic/duplicate-posts-73/#post-18479438)
 * Thanks for your help, I looked for any scripts that could be conflicting and 
   disabled any unnecessary plugins but could not find the source. I also did find
   that with number pagination it was duplicating as well. Unfortunately, I’m not
   the original developer of this site and there is lots of code in this theme that
   may be causing the issue since I’ve never experienced a problem with your plugin
   before. You can mark this as resolved, we’re unable to invest more time into 
   investigating the theme issue. But thank you again for taking the time to respond
   🙂

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

The topic ‘Duplicate posts’ is closed to new replies.

 * ![](https://ps.w.org/ymc-smart-filter/assets/icon-128x128.png?rev=3354891)
 * [YMC Filter](https://wordpress.org/plugins/ymc-smart-filter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ymc-smart-filter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ymc-smart-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/ymc-smart-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ymc-smart-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ymc-smart-filter/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [joanlaura404](https://wordpress.org/support/users/joanlaura404/)
 * Last activity: [1 year ago](https://wordpress.org/support/topic/duplicate-posts-73/#post-18479438)
 * Status: resolved