Where to put PHP?

Hi, I tried pasting this simple php into my functions.php file but it just made my website get an error. I tried it in a text editor and just using MAMP and it works. How do I get it to work on Xtheme?
in my functions.php…

<?php date_default_timezone_set('Canada/Mountain'); $today = date('F j, Y'); ?>

Then in my html …

			<h3>Today's Date:</h3>
			<p><?php echo $today; ?></p> 

TIA!
Rena

Hi Rena,

Thanks for writing in! In WordPress, you need to use Actions and Filters to pass data to your templates. We have the following guide here (https://theme.co/apex/forum/t/customizations-actions-and-filters-in-x-pro/208).

We also have a customization best practices guide here (https://theme.co/apex/forum/t/customizations-best-practices/205).

Hope that helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.