23

I get this error:

"Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in [wordpress dir]/wp-content/themes/[my-theme]/functions.php on line 14"

And line 14 is just a simple use command...

Line 13-15:

add_action('headway_setup_child_theme', array('HeadwaySchematic', 'init'), 1);
use mfbcaptheme\mobilebrowsertheme;
require_once 'mobilebrowsertheme.php';

This is on a client's site and it works just fine on my test site....Not sure what would cause this error.

icc97
  • 11,395
  • 8
  • 76
  • 90
Greg
  • 245
  • 1
  • 2
  • 5
  • 5
    Please reopen this question. The answer to this question - upgrade PHP 5.2 to 5.3 was relevant to a lot of people in 2013 and is still relevant today. So it is likely to help future visitors. – icc97 Oct 07 '15 at 09:58

1 Answers1

42

Make sure they are running PHP 5.3 or later. If they are running an earlier version they won't have support for namespaces.

John Conde
  • 217,595
  • 99
  • 455
  • 496