• Resolved kayjenx

    (@kayjenx)


    Any time I make any changes to the function.php, even when I added a code to the child theme, theme function.php, I get this error when I try to load my site. Only thing that fixes it is a restore from a back up.

    Parse error: syntax error, unexpected ‘(‘ in /home/content/p3pnexwpnas06_data03/36/2281336/html/wp-content/themes/writerstrapwithstore/functions.php on line 8

    I notice that when I activate the theme it displays a similar error to the top of my admin page. I am wondering if this is why. I am using the Crayonux theme Writer Strap.

    I removed the lines I added to the code but this does not reverse the problem.

Viewing 8 replies - 1 through 8 (of 8 total)
  • webbrewers

    (@webbrewers)

    Parse error: syntax error, unexpected ‘(‘ is telling you there’s an extra ( or something missing that makes the ( redundant in your code. Look at the referenced line and see if you can debug it.

    ishan001

    (@ishan001)

    If possible, paste this file somewhere (like pastebin) and post the link here. I can take a look and see what’s causing issue.

    Thread Starter kayjenx

    (@kayjenx)

    Hi,

    Here’s the link to the code:

    Thanks for your offer to help.

    ishan001

    (@ishan001)

    Are you sure this is the correct file? This seems to be alright.

    Did you copy this via FTP?

    Thread Starter kayjenx

    (@kayjenx)

    I copied it from the Appearance > editor > functions.php

    I have changed some other files but this one always gives me white screen. I don’t even see anything on the line 8 which it says has the error :S

    Thread Starter kayjenx

    (@kayjenx)

    <?php
    // Exit if accessed directly
    if ( !defined('ABSPATH')) exit;
    
    /* Add custom functions below */
    // Add custom class to home page
    function my_class_names($classes) {
    	if ( is_page(404)() ) {
    		$classes[] = 'custom navy-seaport-e';
    	}
    	return $classes;
    }
    add_filter('body_class','my_class_names');

    This is the code form the child theme that I tried to add a body_class to a specific page that I want to change the content width of.

    ishan001

    (@ishan001)

    I guess you saved functions.php and when you try to save, you get this error.

    The thing is, file is saved and next time, it won’t be saved.

    You have to log in via FTP.

    The problem is in line 8 here. You have:

    if ( is_page(404)() ) {

    You have extra parantheses here. You need change this to:

    if ( is_page(404) ) {

    That should fix this. But you need to edit via FTP or cPanel.

    Let me know if that helps. ??

    Thread Starter kayjenx

    (@kayjenx)

    Thank you. This seemed to help. using the FTP. I decided against editing the function.php, but it’s easier to make changes via FTP. Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to Fix White Screen of death’ is closed to new replies.