I am attempting to display entries from a specific channel 7 days before and 7 days after an entry_date from another entry. I don't want to use a plugin because.
Here's how I am getting / calculating the 7 days prior / 7 days after:
{exp:channel:entries channel="pd_request_form" entry_id="{segment_2}"} <?php $php_7_days_before = date ("Y-m-d H:i", floor('{entry_date}' - 604800)); ?>{/exp:channel:entries}
{exp:channel:entries channel="pd_request_form" entry_id="{segment_2}"} <?php $php_7_days_after = date ("Y-m-d H:i", floor('{entry_date}' + 604800)); ?>{/exp:channel:entries}
Here's what works:
{exp:channel:entries channel="pd_request_form" dynamic="no" start_on="2013-01-10 00:00" stop_before="2013-01-24 00:00"}
{title} - {entry_date}<br />
{/exp:channel:entries}
The dynamic="no" is there because the URL has an entry_id in it. I see entries I would expect to see.
Here's what also works:
<?php echo $php_7_days_before; ?>
<?php echo $php_7_days_after; ?>
When I say it works I mean, it produces output that looks correct to me.
But here is what isn't working:
{exp:channel:entries channel="pd_request_form" dynamic="no" start_on="<?php echo $php_7_days_before; ?>" stop_before="<?php echo $php_7_days_after; ?>"}
{title} - {entry_date}<br />
{/exp:channel:entries}
I think I'm missing something simple, but I'm not seeing it.