Parsing Errors, Can't Update Custom CSS
-
I attempted to use the following snippet to add Rel=”lightbox to my embedded images.
/*add_filter(‘the_content’, ‘my_addlightboxrel’);
stom CSSfunction my_addlightboxrel($content) {
global $post;
$pattern =”/<a(.*?)href=(‘|\”)(.*?).(bmp|gif|jpeg|jpg|png)(‘|\”)(.*?)>/i”;
$replacement = ‘<a$1href=$2$3.$4$5 rel=”lightbox” title=”‘.$post->post_title.'”$6>’;
$content = preg_replace($pattern, $replacement, $content);
return $content;
}*/I added it to my twenty twelve child theme’s functions.php file. It did’t do anything. I foolishly added it the parent theme and now I get the following Parsing error messages:
“Parse error: syntax HED 11/20/1411/20/14error, unexpected ‘rel’ (T_STRING) in /home/content/p3pnexwpnas06_data01/59/2299259/html/wp-content/themes/twentytwelve/functioWns.php on line 501”
I had backups of the function.php and uploaded via ftp. It looks like that corrected that error. But the Custom CSS in the child theme is not working now so my customizations are gone. When I try to update the Custom CSS it gives this error message even after removing the Custom CSS content:
“Warning: Cannot modify header information – headers already sent by (output started at /home/content/p3pnexwpnas06_data01/59/2299259/html/wp-content/themes/twentytwelve/functions.php:1) in /home/content/p3pnexwpnas06_data01/59/2299259/html/wp-includes/pluggable.php on line 1173”
Really need help/direction. Thanks in advance.
The topic ‘Parsing Errors, Can't Update Custom CSS’ is closed to new replies.