Forum

Thread tagged as: Problem, Runway, Blog

perch blog categories with skip template

Working on the newest version of Perch Runway, and the newest version of Perch Blog.

If I try to return the category listing as an array, it will generally work once, and on every subsequent refresh thereafter it will only return a string with "ArrayArrayArray" etc.

Tested both locally and on live server. Both with PHP 7. Standard blog templates.

$kategorier = perch_blog_categories(array(
        'skip-template' => true,
    ), true);

    var_dump($kategorier);
Eddie Dale

Eddie Dale 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

That sounds like a caching bug. You'd be better to use perch_categories() in any case.

Thank you for the reply, Drew.

It was indeed a caching bug. I've now set the page to PERCH_DEVELOPMENT_MODE and it works. This also solved some other issues I had with blog templates.

Is there any way to just turn off the blog caching, without setting Perch in dev-mode?

(The reason I preferred not use perch_categories() by the way, was because I also needed a category count, which perch_categories doesn't provide but the blog version does)

Drew McLellan

Drew McLellan 2638 points
Perch Support

You can turn the cache of in the options for each of the functions:

'cache' => false,