Support » Plugin: Contextual Related Posts » Error after updating to new version

  • Resolved alex1721

    (@alex1721)


    Hi,

    I just update to the new version of the contextual related post plugin and this error appear:

    Can’t use function return value in write context in /plugins/contextual-related-posts/includes/content.php on line 66.

    Any help?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • I have the exact same problem!
    I’m using Contextual Related Posts for several years on several Websites and the plugin was always FANTASTIC!
    I know that WordPress does many updates automatically now and following one of them – on ONE of my Websites – Contextual Related Posts plugin produced a fatal error which is why I had to delete it.
    The error: Fatal error: Can’t use function return value in write context in /………/……../public_html/wp-content/plugins/contextual-related-posts/includes/content.php on line 66
    How I tried to fix the problem: I downloaded the latest version of the plugin from WordPress to my pc and compared lines 66 of both files, the one I had to delete and the brand new download. They were identical!
    I tried to download Contextual Related Posts through my self-hosted Website’s WP admin, but the plugin couldn’t be activated because activation attempts cause fatal error.
    I’m using the latest version of WordPress and was using the latest version of Contextual Related Posts.
    Any suggestions? I REALLY miss the plugin!

    I have fixed it and it works!

    Original command
    —————–
    if ( ! empty( crp_get_option( ‘exclude_on_post_types’ ) )

    Change to
    ————
    if ( ! get_option( crp_get_option( ‘exclude_on_post_types’ ) )

    just ! empty with ! get_option

    Edit file content.php

    • This reply was modified 3 months, 3 weeks ago by  redymedan.

    Hi redymedan,

    Thank you so much.

    I just did it and it works perfectly.

    Great!

    I was also troubled with the same error.
    It was very helpful!
    Great!

    Thank you, Redymedan!
    I followed your advice too and yes, it worked. You are brilliant! I felt quite lost without CRP and I sincerely appreciate your help.

    Plugin Author Ajay

    (@ajay)

    You can change that part of line by removing the ! empty check.

    if ( crp_get_option( ‘exclude_on_post_types’ )

    Also, if I’m not mistaken this error is because of PHP versions older than 5.5. Could you’ll please check and ask your hosts to upgrade your version of PHP if this is the case.

    WordPress has now ended support for versions older than 5.6 – https://wptavern.com/wordpress-ends-support-for-php-5-2-5-5-bumps-minimum-required-php-version-to-5-6

    I’ll also issued a fix to the plugin that should work.

    • This reply was modified 3 months, 3 weeks ago by  Ajay.
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.