Reading. Collections can hold stories, * chapters, recommendations, posts, and even other collections. * * @package WordPress * @subpackage Fictioneer * @since 4.0 * @see partials/_collection-header.php * @see partials/_collection-statistics.php */ ?>
ID ); $this_breadcrumb = [$title, get_the_permalink()]; $current_page = max( 1, get_query_var( 'pg', 1 ) ?: 1 ); // Paged not available // Prepare raw query (because meta query takes far too long) $raw_query_args = array ( 'post_type' => 'any', 'post_status' => 'publish', 'post__in' => $featured_list, 'ignore_sticky_posts' => 1, 'posts_per_page' => -1, 'no_found_rows' => true ); $raw_query = new WP_Query( $raw_query_args ); // Filter raw results (yes, this is the fastest and cleanest way I could find) $featured_list = []; foreach ( $raw_query->posts as $raw_post ) { if ( fictioneer_get_field( 'fictioneer_story_hidden', $raw_post->ID ) || fictioneer_get_field( 'fictioneer_chapter_hidden', $raw_post->ID ) ) { continue; } $featured_list[] = $raw_post->ID; } // Prepare paginated featured query $query_args = array ( 'post_type' => 'any', 'post__in' => $featured_list, 'ignore_sticky_posts' => 1, 'orderby' => 'modified', 'order' => 'DESC', 'paged' => $current_page, 'posts_per_page' => get_option( 'posts_per_page', 8 ), 'update_post_meta_cache' => false, // Already updated in superset of raw query 'update_post_term_cache' => false // Already updated in superset of raw query ); // Query featured posts $featured_query = new WP_Query( $query_args ); // Prime author cache if ( function_exists( 'update_post_author_caches' ) ) { update_post_author_caches( $featured_query->posts ); } // Arguments for hooks and templates/etc. $hook_args = array( 'collection' => $post, 'collection_id' => $post->ID, 'title' => $title, 'current_page' => $current_page, 'max_pages' => $featured_query->max_num_pages, 'featured_list' => $featured_list, 'featured_query' => $featured_query ); ?>
'fcn_collection', 'post_id' => get_the_ID(), 'breadcrumbs' => array( [fcntr( 'frontpage' ), get_home_url()] ) ); // Add recommendation list breadcrumb (if set) $collections_page_id = intval( get_option( 'fictioneer_collections_page', -1 ) ?: -1 ); if ( $collections_page_id > 0 ) { $collections_page_title = trim( get_the_title( $collections_page_id ) ); $collections_page_title = empty( $collections_page_title ) ? __( 'Stories', 'fictioneer' ) : $collections_page_title; $footer_args['breadcrumbs'][] = array( $collections_page_title, fictioneer_get_assigned_page_link( 'fictioneer_collections_page' ) ); } // Add current breadcrumb $footer_args['breadcrumbs'][] = $this_breadcrumb; // Get footer with breadcrumbs get_footer( null, $footer_args ); ?>