Forum

Thread tagged as: Question, Discussion, Blog

perch_blog_date_archive_months()

Hello

I am working with the perch_blog_date_archive_months() function at the moment and have everything working ok. However, I need to have it seperated by section so it only returns results from the correct blog section. I did find an old question about it in the archived forum but wondered if there had been an update?

This was the old forum post:


Hi,

I'm using the blog for two pages on my website. The blog has two categories, and each page pulls posts from different categories. I am trying to have a sidebar menu with an archive of the posts from only the category showing on that page. I am currently using <?php perch_blog_date_archive_months(); ?>, but it is showing the posts from both categories.

Can you please show me how to have an archive menu only showing posts from 1 blog category?

Thank you so much! Joel 23 Aug 2013, 02:15 AM

That function doesn't currently accept a category option, but it's on our list to do.


Just wondered really. If there is nothing out of the box for it, has anyone managed to find a workaround?

Thanks all!

Michael Wilkinson

Michael Wilkinson 6 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

perch_blog_date_archive_months() doesn't take many options - it needs modernising, I'm afraid. That said, I'm not convince of its utility.

Michael Wilkinson

Michael Wilkinson 6 points
Registered Developer

Hi Drew

Ok, thanks. Is there another way I could do it? My clients website has a news and case studies sections so I need to show the archives for each section. I was thinking maybe using perch_blog_custom to return the data and manipulating that. Does that sound achievable?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that's a way forward. You could use perch:if different to section it.