1

Is there a way to get category posts from a certain year?

I know how to get all posts posted in a certain year -> www.example.com/**year**/

or with months -> wwx.example.com/year/month (that's how the default archive works)

Is there a trick to get for wwx.example/year/category/

Thanks!

1 Answer 1

1

Is there a trick to get for wwx.example.com/year/category/

The main query is open to public query variables like year and cat so without pretty permalinks you could try

www.example.com/?year=2022&cat=5

where 5 is the category id as an example and with pretty permalinks it would be redirected to

www.example.com/2022/?cat=5
3
  • 1
    Great it worked! The only thing I would add for anybody looking and this answer in the future is that "5" is the category ID...
    – Zan Lah
    May 22 at 18:15
  • Thanks for the help!
    – Zan Lah
    May 22 at 18:15
  • Glad to hear it helped Zan. I will update to make it more clear
    – birgire
    May 22 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.