Exemple #1
0
/**
 * Returns the author description of the author associated with a given archive
 * page.
 *
 * @since 1.7
 *
 * @return string
 */
function the_archive_author_description()
{
    $current_author = the_archive_author();
    return isset($current_author->user_description) ? $current_author->user_description : '';
}
/**
 * tarski_bodyid() - Outputs the id that should be applied to the document body.
 * 
 * @since 1.7
 * @param boolean $return
 * @global object $post
 * @global object $wp_query
 * @return string $body_id
 * @hook filter tarski_bodyid
 * Filter the document id value.
 */
function tarski_bodyid($return = false)
{
    global $post, $wp_query;
    if (is_home()) {
        $body_id = 'home';
    } elseif (is_search()) {
        $body_id = 'search';
    } elseif (is_page()) {
        $body_id = 'page-' . $post->post_name;
    } elseif (is_single()) {
        $body_id = 'post-' . $post->post_name;
    } elseif (is_category()) {
        $cat_ID = intval(get_query_var('cat'));
        $category =& get_category($cat_ID);
        $body_id = 'cat-' . $category->category_nicename;
    } elseif (is_tag()) {
        $tag_ID = intval(get_query_var('tag_id'));
        $tag =& get_term($tag_ID, 'post_tag');
        $body_id = 'tag-' . $tag->slug;
    } elseif (is_author()) {
        $author = the_archive_author();
        $body_id = 'author-' . $author->user_login;
    } elseif (is_date()) {
        $year = get_query_var('year');
        $monthnum = get_query_var('monthnum');
        $day = get_query_var('day');
        $body_id = "date";
        if (is_year()) {
            $body_id .= '-' . $year;
        } elseif (is_month()) {
            $body_id .= '-' . $year . '-' . $monthnum;
        } elseif (is_day()) {
            $body_id .= '-' . $year . '-' . $monthnum . '-' . $day;
        }
    } elseif (is_404()) {
        $body_id = '404';
    } else {
        $body_id = 'unknown';
    }
    $body_id = apply_filters('tarski_bodyid', $body_id);
    if ($return) {
        return $body_id;
    } else {
        echo $body_id;
    }
}
/**
 * the_archive_author_description() - Returns the author description of the author associated with a given archive page.
 * 
 * @return string
 */
function the_archive_author_description()
{
    $current_author = the_archive_author();
    return $current_author->user_description;
}