Home Forums WoodMart support forum Local time in woodmart. Reply To: Local time in woodmart.

#515983

Matimti
Participant

I pasted this code: it didn’t work, then I re-pasted it to the first few lines of the child theme’s function.php file from the top, and I noticed that after re-pasting, the appearance of the quotation marks changed, as shown below – it works.

Please note that these are two different quotation marks:

add_filter( ‘woodmart_wp_timezone_element’, ‘__return_true’ ); ( this code is ok)

add_filter( ‘woodmart_wp_timezone_element’, ‘__return_true’ );

The difference between these quotation marks is crucial in programming:

Straight Quotation Marks: ‘ ‘ – These are standard quotation marks used in most programming languages, including PHP. They are straight-lined and look the same at both the beginning and the end of a string. For example: ‘__return_true’.

Curly or Typographic Quotation Marks: ‘ ’ – These quotation marks are often used in printed texts and have an aesthetic, slightly curved shape. They differ at the beginning and end of a string. However, in the context of programming, these quotation marks can cause errors because the programming language interprets them differently from the standard straight quotation marks. They are not recognized as proper syntax for defining strings in languages like PHP.

In your case, changing from curly to straight quotation marks corrected the syntax error, enabling the code to work properly.