AltoFocus problem displaying a Post (Fatal error) in content-single.php

  • Unknown's avatar

    I have installed the theme AltoFocus on my own server.

    I set it up, that it will show on the home page the featured images of the last posts.

    This so far works fine but whenever I click on one of the images there comes a php error when the browser tries to display the post.

    The whole browser window stays blank and if you look inside the pages source code there is an error message:

    <main id=”main” class=”site-main” role=”main”>

    <b>Fatal error</b>: Can’t use function return value in write context in <b>[…]/wp-content/themes/altofocus-wpcom/components/post/content-single.php</b> on line <b>30</b>

    If I try another theme everything works fine.

    I first thought it could be, that the pictures are too wide (more than 1200 px wide) but I tried it also with a picture uploaded that is 1200 px wide in the original file.

    Link to the site: http://kionconcerts.de/2017/08/26/soulfire-hi-fi/

    I have the following PlugIns installed:

    Akismet Anti-Spam 3.3.4

    Hello Dolly 1.6

    Thanks for your support

  • It sounds like your host is probably running an older version of PHP, since the code causing the error is valid as of PHP 5.6. Could you please verify what version of PHP you’re running? Is your host able to upgrade? PHP is now up to version 7.1.

    My colleague Laurel put together some backwards-compatible code to replace the problematic file, which should work in PHP 5.3. You can download it here:

    https://cloudup.com/cw-U5VsDyMa (Edit: updated file)

    Use an FTP program to replace this file:

    /components/post/content-single.php

    Let me know how it goes.

  • Unknown's avatar

    Hey Kathryn,

    great, updating to PHP 7.0.6 helped for me. I did not need to replace the content-single.php file.

    Thank you very much

    Ki

  • timethief – it’s fine for this person to post here. Altofocus is not in the WordPress.org directory yet, and we’re happy to answer questions about it here as it doesn’t really have a “home.”

  • ki0007 – glad to hear you were able to upgrade your PHP version, thanks for confirming that did the trick!

  • Unknown's avatar

    @kathrynwp

    Altofocus is not in the WordPress.org forum yet

    Understood. :)

  • Unknown's avatar

    About the worpress.org forum, that was actually the place where I placed my question first.

    They explained to me, I should post it here.

  • The topic ‘AltoFocus problem displaying a Post (Fatal error) in content-single.php’ is closed to new replies.