So I’m trying to show text at the end of each post but from this month only and only in one category. I tried different codes that I found here but none of them really worked or what I needed. Here is example of what I like to do. Hope it make sense.
if(in_category(tags) && date(from June 2015) )
{
?>
<p>See related news <a href="#">here</a>.</p>
<p>Subscribe to our monthly e-newsletter <a href="#">here</a>.</p>
<?php } ?>
if i am not wrong by understanding your quest you need to use
date_query
along withtax_query
To check in the Category you should use condition :
get month of every post date and compare it with current month number or hardcode month number like for
June
use06
you can check for php date formats hereFor
in_category
parameters see thisCheck the below code . Here I had used category ‘Uncategorized’ .you can use your tag there.
hope this will help. add this code in your functions.php