This is my first time posting a question here, and I truly appreciate any suggestions that might be able to help me.

I'm trying to call a Wordpress PHP function from within a PHP if else statement, to get it to display the more recent date when comparing get\_the\_modified\_date() and get\_the\_date().

Here is my code:

```
if ( $date1 > $date2 ) { 
echo 'This page was last updated on <span class="date updated"><?php echo get_the_modified_date(\'F j, Y\');?></span>.<hr /></div>';
} else {
echo 'This page was last updated on <span class="date updated"><?php echo get_the_date(\'F j, Y\');?></span>.<hr /></div>';
}
?>

```

Any thoughts on how to get this to parse correctly? I tried commenting out the ('F j, Y') with \ but it doesn't display the date at all -- all that is displayed is:

"This page was last updated on ."

Thank you all!