perch_blogs()

Output a list of blogs with the perch_blogs() function. In Perch Runway you can set up multiple blogs. Use this function to output a list of the configured blogs.

Requires

Parameters

Type Description
Array Options array, see table below
Boolean Set to true to have the value returned instead of echoed.

Options array

Name Value
template The template to use.
skip-template true/false. Return an array rather than HTML.
cache true/false. By default, output is cached for 10 minutes.
filter Results can be filtered using the same filter options as perch_content_custom(). Includes support for multiple filters.
sort The ID of a field to sort by.
sort-order ASC/DESC
start Int. The start position. Defaults to 1. Not compatible with pagination.
return-html true/false. For use with skip-template. Adds the HTML onto the end of the returned array
paginate True or false. Whether to use pagination.
count Integer. (When used with paginate) The number of items to show per page if pagination is being used.
pagination-var The URL query string parameter name to use for the page number. Defaults to page.
page-links True or false. Create numbered page links as well as previous and next links.
page-link-template The template to use (if not the default) to generate the page links.
page-link-style shortened or all. By default a shortened set of page links are generated. If you want a link for every page, set to all.

Usage examples

Output a list of blogs using the default template blog/blog.html.

<?php perch_blogs(); ?>

An options array can be passed as the first argument.

<?php
    perch_blogs(array(
        'template' => 'my_blog_template.html',
    ));
?>