I have a news section on our website and I want to only show the current years articles unless it is January, February or March. Since those months are at the beginning of the year, I don't want the page to not have any content. I have been able to figure out the PHP to get the current date and subtract 2 years (so I can show last year's posts). I also figured out how to do the {if/if:elseif} statements to check which month we are currently in and if it is January do this. February do this.
Trevor Griffith
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Trevor
Contact Trevor, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack