Ejemplo n.º 1
0
function ceo_display_comic_post_home()
{
    global $wp_query, $post;
    if (is_front_page() && !is_paged() && !ceo_pluginfo('disable_comic_blog_on_home_page')) {
        if (class_exists('Jetpack') && Jetpack::is_module_active('minileven') && wp_is_mobile()) {
            echo '<div style="margin: 10px; background: #fff; padding: 10px;">';
        }
        $order = ceo_pluginfo('display_first_comic_on_home_page') ? 'asc' : 'desc';
        $chapter_on_home = '';
        $chapter_on_home = get_term_by('id', ceo_pluginfo('chapter_on_home'), 'chapters');
        $chapter_on_home = !is_wp_error($chapter_on_home) && !empty($chapter_on_home) ? '&chapters=' . $chapter_on_home->slug : '';
        $query_args = 'post_type=comic&showposts=1&order=' . $order . $chapter_on_home;
        apply_filters('ceo_display_comic_post_home_query', $query_args);
        $comicFrontpage = new WP_Query();
        $comicFrontpage->query($query_args);
        while ($comicFrontpage->have_posts()) {
            $comicFrontpage->the_post();
            if (current_theme_supports('post-formats')) {
                get_template_part('content', 'comic');
            } elseif (function_exists('comicpress_display_post')) {
                comicpress_display_post();
            } elseif (function_exists('easel_display_post')) {
                easel_display_post();
            } elseif (function_exists('comic_easel_custom_display_post')) {
                comic_easel_custom_display_post();
            } else {
                ceo_display_comic_post();
            }
        }
        if (ceo_pluginfo('enable_comments_on_homepage')) {
            global $withcomments;
            $withcomments = true;
            comments_template('', true);
        }
        wp_reset_query();
        if (class_exists('Jetpack') && Jetpack::is_module_active('minileven') && wp_is_mobile()) {
            echo '</div>';
        }
        echo '<div id="blogheader"></div>';
    } elseif (is_archive() && (isset($wp_query->query_vars['taxonomy']) && isset($wp_query->query_vars['chapters'])) && $wp_query->query_vars['taxonomy'] == 'chapters' && !is_paged()) {
        if (ceo_pluginfo('enable_chapter_landing') && ceo_pluginfo('enable_blog_on_chapter_landing')) {
            $order = ceo_pluginfo('enable_chapter_landing_first') ? 'asc' : 'desc';
            $comic_args = array('showposts' => 1, 'posts_per_page' => 1, 'post_type' => 'comic', 'order' => $order, 'chapters' => $wp_query->query_vars['chapters']);
            $comicFrontpage = new WP_Query();
            $comicFrontpage->query($comic_args);
            while ($comicFrontpage->have_posts()) {
                $comicFrontpage->the_post();
                if (current_theme_supports('post-formats')) {
                    get_template_part('content', 'comic');
                } elseif (function_exists('comicpress_display_post')) {
                    comicpress_display_post();
                } elseif (function_exists('easel_display_post')) {
                    easel_display_post();
                } elseif (function_exists('comic_easel_custom_display_post')) {
                    comic_easel_custom_display_post();
                } else {
                    ceo_display_comic_post();
                }
            }
            if (ceo_pluginfo('enable_comments_on_chapter_landing')) {
                global $withcomments;
                $withcomments = true;
                comments_template('', true);
            }
            wp_reset_query();
        }
    }
}
Ejemplo n.º 2
0
function ceo_display_comic_post_home()
{
    global $wp_query, $post;
    if (is_front_page() && !is_paged() && !ceo_pluginfo('disable_comic_blog_on_home_page')) {
        $order = ceo_pluginfo('display_first_comic_on_home_page') ? 'asc' : 'desc';
        $chapter_on_home = '';
        $chapter_on_home = get_term_by('id', ceo_pluginfo('chapter_on_home'), 'chapters');
        $chapter_on_home = !is_wp_error($chapter_on_home) && !empty($chapter_on_home) ? '&chapters=' . $chapter_on_home->slug : '';
        $query_args = 'post_type=comic&showposts=1&order=' . $order . $chapter_on_home;
        apply_filters('ceo_display_comic_post_home_query', $query_args);
        $comicFrontpage = new WP_Query();
        $comicFrontpage->query($query_args);
        while ($comicFrontpage->have_posts()) {
            $comicFrontpage->the_post();
            if (current_theme_supports('post-formats')) {
                get_template_part('content', 'comic');
            } elseif (function_exists('comicpress_display_post')) {
                comicpress_display_post();
            } elseif (function_exists('easel_display_post')) {
                easel_display_post();
            } elseif (function_exists('comic_easel_custom_display_post')) {
                comic_easel_custom_display_post();
            } else {
                ceo_display_comic_post();
            }
        }
        if (ceo_pluginfo('enable_comments_on_homepage')) {
            global $withcomments;
            $withcomments = true;
            comments_template('', true);
        }
        wp_reset_query();
        echo '<div id="blogheader"></div>';
    }
}