hdotyoung
Forum Replies Created
-
Doesn’t work. Same error. Have you had any success with this fix? I assume you tested it elsewhere?
Yep, errors out on the default twentyeleven theme as well:
Parse error: syntax error, unexpected ''('' (T_CONSTANT_ENCAPSED_STRING) in /home/vsb/public_html/wp-content/themes/twentyeleven/functions.php on line 42
And no, double quotes doesn’t make a difference, unfortunately. Still that stubborn error.
This is the entirety of functions.php:
<?php /** * @package WordPress * @subpackage VSB_Custom_Theme */ function filter_tptn_list_count( $tptn_list_count ) { $tptn_list_count = preg_replace(? '(', '', $tptn_list_count ); $tptn_list_count = preg_replace(? ')', '', $tptn_list_count ); return $tptn_list_count; } add_filter( 'tptn_list_count', 'filter_tptn_list_count' ); ?>
So it looks like line 8 (or line 45 when I don’t delete everything else) is:
$tptn_list_count = preg_replace(? '(', '', $tptn_list_count );
or, before your most recent suggestion:
$tptn_list_count = str_replace(? '(', '', $tptn_list_count );
Same error. I again removed every other function but this one and still:
Parse error: syntax error, unexpected ''('' (T_CONSTANT_ENCAPSED_STRING) in /home/vsb/public_html/wp-content/themes/VSB2014/functions.php on line 8
Hi Ajay,
The php is closed properly; the ?> is in place. I have a few other functions in there I wrote previously and they’re working as expected.
I tried the snippet above previous to my response yesterday. Tried it again today as the sole function in the file and it still threw that same T_CONSTANT_ENCAPSED_STRING syntax error I pasted above. I’m at a loss unfortunately.
Hey Ajay, thanks for the response.
The error I get using the snippet you posted on github is:
Parse error: syntax error, unexpected 'array' (T_ARRAY) in /home/vsb/public_html/wp-content/themes/VSB2014/functions.php on line 45
And the error I get using the second one is:
Parse error: syntax error, unexpected ''('' (T_CONSTANT_ENCAPSED_STRING) in /home/vsb/public_html/wp-content/themes/VSB2014/functions.php on line 45
Any ideas? Thanks again.
Hi, Ajay. Thanks a lot for the plugin. I was trying to remove the parentheses as well but this function throws an array error. Is there an update or alternate method?