• 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 7 replies - 1 through 7 (of 7 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 5 years, 11 months ago by redymedan.
    Thread Starter alex1721

    (@alex1721)

    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 5 years, 11 months ago by Ajay.

    Hello!
    after updating the new version of Contextual Related Post plugin I have an error in the related post titles that show title in both languages >>e.g. [it:]Benefici del Cloud Computing [en:]Cloud computing benefits[:]

    The website is multilingual (Italian and English), so I need just the right language post.
    I have been using Qtranslate-x plugin to enable multilingual contents, til now everything was working very good.
    I tried other plugins but they didn’t work too (thumbnails for related post showed 2 or 3 titles together instead of one; inline related post has the same issu of CRP).

    I though may be an issue with Qtranslate-x?

    Anyone can help me to fix CRP or suggest me plugins for related post that support multilingual sites?

    Thank you so much!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Error after updating to new version’ is closed to new replies.