• Resolved archaeis

    (@archaeis)


    It’s been a few days since I updated the theme. Suddenly today I get this whenever I lead the homepage:

    Parse error: syntax error, unexpected ‘:’ in /home/content/65/10216865/html/wp-content/themes/baskerville/index.php on line 6

    And this whenever I load another page on the site:

    Parse error: syntax error, unexpected ‘:’ in /home/content/65/10216865/html/wp-content/themes/baskerville/header.php on line 16

    Any ideas?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @archaeis,

    Sorry about that. The latest version of Baskerville uses a type of code conditional called a shorthand ternary, which is supported in PHP 5.3 or later. Your website is probably hosted on a server running an older version of PHP. WordPress recommends version 7 or later, but offers support for version 5.2.4 and later: https://www.ads-software.com/about/requirements/

    I’ve changed it back to the non-shorthand variant of the conditional to fix this issue, but I’ll have to wait another two hours before submitting the update, since I just uploaded a new version of Baskerville and the review process needs a little breathing room.

    — Anders

    Theme Author Anders Norén

    (@anlino)

    For now, you can fix the issue on your own installation by going to Admin > Editor and following these steps:

    1. Open index.php.
    2. Go to line 6 and replace the following: $paged = get_query_var( 'paged' ) ?: 1; with $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
    3. Click the Update file button.
    1. Open header.php.
    2. Go to line 16 and replace the following: <?php $background_image_url = get_header_image() ?: get_template_directory_uri() . '/images/header.jpg'; ?> with <?php $background_image_url = get_header_image() ? get_header_image() : get_template_directory_uri() . '/images/header.jpg'; ?>.
    3. Click the Update file button.

    These are the same changes that the update going live later today will contain, and they should fix the error.

    — Anders

    Theme Author Anders Norén

    (@anlino)

    The update has been submitted and should be live shortly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Parse Error?’ is closed to new replies.