You are here

wp_blog.theme.inc in WP Blog - a WordPress-style blogging module. 7

Theme functions for the WP blog module.

File

wp_blog.theme.inc
View source
<?php

/**
 * @file
 * Theme functions for the WP blog module.
 */

/**
 * Return HTML for the 'BLog Archive' block, which provides a hierarchical list
 * of years and months, with a count of the number of blog-posts for each
 * month, linking to the view that lists the posts for that year/month.
 */
function theme_wp_blog_archive($element) {
  $items = array();
  $items[] = $element['element']['show_all_link'];
  $archive = $element['element']['archive'];
  foreach ($archive as $year) {
    $item = array(
      'data' => t('!year [@count]', array(
        '!year' => l($year['text'], $year['url']),
        '@count' => $year['count'],
      )),
      'children' => array(),
    );
    foreach ($year['months'] as $month) {
      $item['children'][] = array(
        'data' => t('!month [@count]', array(
          '!month' => l($month['text'], $month['url']),
          '@count' => $month['count'],
        )),
      );
    }
    $items[] = $item;
  }
  return theme('item_list', array(
    'items' => $items,
  ));
}

Functions

Namesort descending Description
theme_wp_blog_archive Return HTML for the 'BLog Archive' block, which provides a hierarchical list of years and months, with a count of the number of blog-posts for each month, linking to the view that lists the posts for that year/month.