예제 #1
0
function enlightenment_wp_actions()
{
    if (!is_page()) {
        add_action('enlightenment_before_content', 'enlightenment_archive_location');
    }
    add_action('enlightenment_content', 'enlightenment_the_loop');
    enlightenment_lead_entry_hooks();
    if (is_single()) {
        add_action('enlightenment_entry_footer', 'enlightenment_entry_utility');
        if ('post' == get_post_type()) {
            add_action('enlightenment_entry_footer', 'enlightenment_autor_hcard');
        }
    }
    if (is_singular()) {
        add_action('enlightenment_after_entry_footer', 'comments_template');
    } else {
        add_action('enlightenment_after_entries_list', 'enlightenment_posts_nav');
    }
    add_action('enlightenment_before_comments_list', 'comments_number');
    add_action('enlightenment_before_comments_list', 'enlightenment_comments_nav');
    add_action('enlightenment_comments', 'wp_list_comments');
    add_action('enlightenment_after_comments_list', 'enlightenment_comments_nav');
    add_action('enlightenment_after_comments', 'comment_form');
    add_action('enlightenment_footer', 'enlightenment_copyright_notice');
    add_action('enlightenment_footer', 'enlightenment_credit_links');
}
예제 #2
0
function enlightenment_post_format_hooks()
{
    if (!is_singular()) {
        enightenment_clear_entry_hooks();
        if (has_post_format('gallery')) {
            add_action('enlightenment_entry_header', 'the_title', 10, 2);
            add_action('enlightenment_entry_header', 'enlightenment_entry_meta');
            add_action('enlightenment_entry_content', 'enlightenment_entry_gallery');
            add_action('enlightenment_entry_content', 'the_excerpt');
        } elseif (has_post_format('image')) {
            add_action('enlightenment_entry_header', 'the_title', 10, 2);
            add_action('enlightenment_entry_header', 'enlightenment_entry_meta');
            add_action('enlightenment_entry_content', 'enlightenment_entry_image');
            add_action('enlightenment_entry_content', 'the_excerpt');
        } elseif (has_post_format('video')) {
            add_action('enlightenment_entry_header', 'the_title', 10, 2);
            add_action('enlightenment_entry_header', 'enlightenment_entry_meta');
            add_action('enlightenment_entry_content', 'enlightenment_entry_video');
            add_action('enlightenment_entry_content', 'the_excerpt');
        } elseif (has_post_format('audio')) {
            add_action('enlightenment_entry_header', 'the_title', 10, 2);
            add_action('enlightenment_entry_header', 'enlightenment_entry_meta');
            add_action('enlightenment_entry_content', 'enlightenment_entry_audio');
            add_action('enlightenment_entry_content', 'the_excerpt');
        } elseif (has_post_format('aside')) {
            add_action('enlightenment_entry_content', 'the_content');
            add_action('enlightenment_entry_footer', 'enlightenment_entry_meta');
        } elseif (has_post_format('link')) {
            add_action('enlightenment_entry_header', 'the_title', 10, 2);
            add_action('enlightenment_entry_header', 'enlightenment_entry_meta');
            add_action('enlightenment_entry_content', 'the_excerpt');
        } elseif (has_post_format('quote')) {
            add_action('enlightenment_entry_header', 'enlightenment_entry_blockquote');
            add_action('enlightenment_entry_footer', 'enlightenment_entry_meta');
        } elseif (has_post_format('status')) {
            add_action('enlightenment_entry_content', 'enlightenment_entry_author_avatar');
            add_action('enlightenment_entry_content', 'the_content');
            add_action('enlightenment_entry_footer', 'enlightenment_entry_meta');
        } elseif (has_post_format('chat')) {
            add_action('enlightenment_entry_header', 'the_title', 10, 2);
            add_action('enlightenment_entry_header', 'enlightenment_entry_meta');
            add_action('enlightenment_entry_content', 'the_content');
        } else {
            enlightenment_lead_entry_hooks();
        }
    }
}