Processing Categories from perch_page_attributes.
As Simon stated at the end of this thread (forum.grabaperch.com/forum/01-20-2017-categories-in-page-attributes?page=1#reply-48876), the catPath isn't returned when using skip-template to return page attributes. So I'm trying to get the category information by using a template as described by Mark Melling in that same thread.
I am able to then process the category correctly and have the correct blog posts returned when there's only one category specified. However, I can't figure out how to get it to work when there's more than one category specified.
Here's my code:
<?php $blog_cats = perch_page_attributes(['template' => '_show_blog' ],true); $blog_cats = trim($blog_cats); echo($blog_cats); perch_blog_custom([ 'template' => 'story_jump_listing_carousel', 'sort' => 'postDateTime', 'sort-order' => 'DESC', 'sort-type' => 'alpha', 'category' => $blog_cats, 'category-match'=> 'any' ]); ?>
the page attributes template
_show_blog is set to output the categories like this:
if one category is specified, the template returns:
for more than one category, the template returns:
So those are the values for
It works for one category, not for more than one.
I've tried several different ways to try and pass in the multiple values but I can't figure out what would work. Any help would be much appreciated.