WordPress.org

Ready to get started?Download WordPress

Forums

Network Latest Posts
[resolved] New comments assigned to wrong post (8 posts)

  1. snapalot
    Member
    Posted 1 year ago #

    Hi Jose

    I've tested the 'random' parameter and it works great; I use the Prototype theme from themehybrid.com to place your widget After Singular (a widget area only displayed on singlepost before the comments).

    I have one problem now: when new comments are added to a post, the comment gets assigned to the wrong post. Could your plugin have something to do with this? Maybe not resetting a global variable, WP Query or something?

    http://wordpress.org/extend/plugins/network-latest-posts/

  2. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    Have you tried deactivating Network Latest Posts and tested if the comments are registered under the right post?

    It is pretty strange, because NLPosts doesn't use any global variable, it switches blogs but after pulling posts it switches back to the current one (if this were causing problems all posts displayed would be the same), it doesn't write anything to the database all the requests are read-only.

    Did you asked on Theme Hybrid forums? Maybe there's a bug related to the theme?

    Check my first suggestion and please keep me up to date.

  3. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    I've been testing in my local environment and it works, all comments are being published under the right posts with NLPosts active and running. I don't think this issue is related to this plugin but I'm leaving the thread opened to see what you find out.

    Cheers.

  4. snapalot
    Member
    Posted 1 year ago #

    Hi Jose

    Thanks for leaving the thread open.

    I tried deactivating and reactivating the plugin. I had to modify the comment_post_id field in the wp-comments table in my database to associate the comments with the correct posts.

    When I have the plugin enabled, but remove the widget from single post, new comments get published correctly.

    To be clear: I use NLP's widget in a widget area after the end of a single post and before the comments. I'll keep testing and ask Justin Tadlock if he has any ideas.

    This plugin does exactly what I want with great flexibility otherwise.

  5. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    Well this was breaking my mental health, it took me a while to figure out what was happening. Actually it only happens when you place Network Latest Posts before the comments, so I went through the comments functions to see what was happening.

    I discovered it uses WordPress $wpdb global as my plugin does and I wasn't reseting the posts variables after displaying the results, as a consequence comments took some variables pulled from the posts listed through the plugin.

    I fixed this and pushed the new version 3.1.7 which hopefully closes this issue. I've tested this and it works, but I will let you test it and close this thread if it works.

    Cheers.

  6. snapalot
    Member
    Posted 1 year ago #

    Good morning Jose

    This is great news! I'll update and test it today.

    Thank you
    Kobus

  7. snapalot
    Member
    Posted 1 year ago #

    Hi Jose

    I tested and the problem is fixed. See it in action here.

    Thanks again!
    Kobus

  8. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    Great news Kobus!,

    Nice to see it in action, good work!.

    Thanks for your feedback. I'm glad it worked.

    Cheers.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic