/**
 * Add comic archive output to Comic Archive page content
 *
 * @access private
 * @param string $content Page content being filtered
 * @return string
 */
function mangapress_create_comicarchive_page($content)
{
    global $post, $wp_query;
    if (!mangapress_is_queried_page('comicarchive_page')) {
        return $content;
    }
    $old_query = $wp_query;
    $wp_query = mangapress_get_all_comics_for_archive();
    if (!$wp_query) {
        return apply_filters('the_comicarchive_content_error', '<p class="error">No comics were found.</p>');
    }
    ob_start();
    require mangapress_get_content_template('comicarchive_page');
    $content = ob_get_clean();
    $wp_query = $old_query;
    wp_reset_query();
    return apply_filters('the_comicarchive_content', $content);
}
/**
 * Add Latest Comic to page content
 *
 * @global WP_Post $post WordPress post object
 * @param string $content Post content being filtered
 * @return string
 */
function mangapress_add_comic_to_latestcomic_page($content)
{
    global $post, $wp_query;
    if (!mangapress_is_queried_page('latestcomic_page')) {
        return $content;
    }
    $image_sizes = get_intermediate_image_sizes();
    $old_query = $wp_query;
    $wp_query = mangapress_get_latest_comic();
    if (!$wp_query || $wp_query->get('name') == 'no-comic-found') {
        return apply_filters('the_latest_comic_content_error', '<p class="error">No recent comics were found.</p>');
    }
    $thumbnail_size = isset($image_sizes['comic-page']) ? $image_sizes['comic-page'] : 'large';
    $post = $wp_query->posts[0];
    setup_postdata($post);
    ob_start();
    require mangapress_get_content_template('latestcomic_page');
    $content = ob_get_clean();
    $wp_query = $old_query;
    wp_reset_postdata();
    return apply_filters('the_latest_comic_content', $content);
}