Forum

Thread tagged as: Question

Using perch_content_custom to get all regions from a page

Hello,

I'd like to pull all of a page's content into a big array using something like perch_content_custom. I have the page path, and I know all the region names so I could do 6/7 different perch_content_custom calls to get each region individually. Is there a way to get all the regions together with one query? Something similar to the following (which didn't work for me):

$content = perch_content_custom('*', array(
    'page' => '/valid-page-path.php',
    'skip-template' => true,
    'raw' => true
));

How would you suggest I retrieve the content from all regions on a page in one go?

Thanks!

Oliver Lowe

Oliver Lowe 0 points

  • 4 years ago
Duncan Revell

Duncan Revell 78 points
Registered Developer

As per the docs here, (right down at the bottom of the page), the region parameter of perch_content_custom can acccept an array of region names.

Ah, thanks didn't spot that. That will do I think!