Jetpack Related Posts – Duplicate Entries
-
Ever since the last update to Jetpack related posts, all of my related posts are showing duplicate entries.
The commit that caused this is the following:
https://github.com/Automattic/jetpack/commit/04fbdf4430dce0c6c41ad390b6fbaaf3b3911ba8Specifically, the below lines of code:
– wp_enqueue_script( ‘jetpack_related-posts’, plugins_url( ‘related-posts.js’, __FILE__ ), $dependencies, self::VERSION );
+ wp_enqueue_script(
+ ‘jetpack_related-posts’,
+ Jetpack::get_file_url_for_environment(
+ ‘_inc/build/related-posts/related-posts.min.js’,
+ ‘modules/related-posts/related-posts.js’
+ ),
+ $dependencies,
+ self::VERSION
+ );If I remove the commit and roll back to the single line wp_enqueue_script, the problem goes away. I suspect the script is somehow loading twice and causing related posts to show up twice.
In essence, “jp-relatedposts-items” is being reproduced twice. I manually rolled back the change and it works for now, but I would appreciate a long term solution so that I don’t have to deal with this with each Jetpack update.
Thanks!
- The topic ‘Jetpack Related Posts – Duplicate Entries’ is closed to new replies.