WordPress.org

Ready to get started?Download WordPress

Forums

Contextual Related Posts
[resolved] Incompatibility with 3.4.2? (11 posts)

  1. otravers
    Member
    Posted 1 year ago #

    Contextual Related Posts was working well with WP 3.4.2 for a site I'm about to relaunch. I just upgraded both my local dev and staging environments to WP 3.4.2, and now they show the same 5 related entries no matter what the entry I'm on. I tried recreating the index, and even uninstalling and reinstalling the plugin, and still get the same behavior.

    Can others who updated to 3.4.2 replicate this?

    http://wordpress.org/extend/plugins/contextual-related-posts/

  2. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    I haven't seen such behaviour ever.

    You should uninstall the plugin from Plugins page by deactivating and then deleting the plugin. It should clean up all plugin settings.

    You can just readd them back.

    Do those entries still exist?

  3. otravers
    Member
    Posted 1 year ago #

    These entries still exist. I went through a whole cycle of disable/uninstall/reinstall/reindex and still get the same issue. Where should I look in the database to manually delete the index built by your plugin?

  4. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    This is saved in your wp_posts database. It is the indices starting with crp_

    Can I see the URL of your site?

  5. otravers
    Member
    Posted 1 year ago #

    After further tests, I have found that the plugin itself still works, but only when I let it add its content to posts. When I use:

    if(function_exists('echo_ald_crp')) echo_ald_crp();

    I still get the same 5 unrelated entries no matter the displayed post. Does that help? This is not on a live site right now, just in dev, so it's hard to share a URL.

    Edit: I just found that echo_ald_crp() still works for me, but only within the WP loop. I'm pretty sure that until I upgraded from WP 3.4.1 to 3.4.2 I had CRP working for me outside of the loop.

    Am I supposed to only use CRP within the loop? This diminished its value as a tool to place related posts wherever you want. Is there a way to put its output into a PHP variable as opposed to directly echo it?

  6. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    otravers, it works wherever the post variable is set, which is usually in the loop. If the post variable is lost (e.g. outside the loop), the plugin cannot find the correct information.

    I'm testing a version to set make the post variable global that should ideally help the plugin to pull data outside the loop.

    In this scenario, you have an issue with non-single pages, i.e. if you want related posts in the index or home or archives etc.

  7. otravers
    Member
    Posted 1 year ago #

    For maximum flexibility in terms of placement and look & feel, it would be great to have the ability to only retrieve IDs for the related entries and leave everything else to the developer, inside or outside the loop.

  8. otravers
    Member
    Posted 1 year ago #

    To be more specific on my code, until 3.4.1 the following query, made after having closed the loop, was properly picked up by the echo_ald_crp() function:

    $the_query = new WP_Query('p=$thePostID');
    $the_query->the_post();

    Since 3.4.2 it looks like echo_ald_crp() is oblivious to the value returned by that query and only works within the loop.

  9. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    Is this specific to your theme? If so, which theme are you using?

  10. otravers
    Member
    Posted 1 year ago #

    It's a custom theme made in-house. For now we've moved related articles within the loop, which restricts our layout options somewhat. You can see it in action at:
    http://www.marketingcharts.com/wp/direct/data-dive-us-online-ad-spend-per-user-2000-2011-22956/

    FYI I installed the Log Deprecated Notices WP plugin which returned this about your plugin:

    Argument in add_options_page()
    Used in wp-content/plugins/contextual-related-posts/admin.inc.php on line 346.

    Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. Deprecated in version 2.0.

    I don't think it has anything to do with the original topic of this thread but I thought I'd mention it in passing.

  11. Ajay
    Member
    Plugin Author

    Posted 1 year ago #

    otravers,

    That's an "error" that I haven't managed to figure out why the plugin gives. According to the author they just return messages that are generated by WordPress. However, the codex doesn't mention that this function is deprecated.

    Regarding the layout, I see it beautifully, though I think you mean the comments section is moved left?

    You can try a <div style="clear:both"></div> which usually fixes this issue

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.