Forum

Thread tagged as: Question

Array of HTML strings from _custom()?

I'm curious if there is a Perch way of getting an array of HTML strings, one for each result. I'll try to explain...

In this case I'm using perch_blog_custom() but same could apply to perch_content_custom().

$thePosts = perch_blog_custom(array(
                'category' => perch_get('cat'),
                'template' => 'post_in_list.html',
            ),true);

// var_dump($thePosts) = One long string.

I'm looking for an array with each blog post html string separately. Does this make sense?

Nicholas Nelson

Nicholas Nelson 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It does, but there's not. It's a nice idea though.

Alrighty, I wrote a little php to iterate through perch calls to get what I was looking for. Thanks!