Syntax error – add action
-
Hi. I am new to WordPress and have been fairly successful in creating a child theme and changing a few things around using tips I found on the various forums. So I thought I’d get adventurous and try my own bit of coding to add my own text below the “Cart Totals” area on my site. I wrote the following:
/* Add custom text after the “Cart Totals” */
add_action(‘after_cart_totals’,’my_cart_text’);
function my_cart_text() { echo ‘<p id= “mytxt”>This is my custom text.</p>
}
When I go to the Cart page I get the following:
Parse error: syntax error, unexpected ”<p id= “mytxt”>This is my cus’ (T_ENCAPSED_AND_WHITESPACE) in /home/content/p3pnexwpnas04_data03/46/2966846/html/wp-content/themes/storefront_child/functions.php on line 111
I have tried to find where the syntax error is but I can’t. I know it will be glaringly obvious to someone, but would some kind soul please let me know where I went wrong, or if indeed I’m totally on the wrong bus? Cheers.
- The topic ‘Syntax error – add action’ is closed to new replies.