Custom Post Pagination disappeared after update
-
I inherited a site with tons of custom coding, it’s just a jungle of confusion. There are many types of customs posts within the content.
I updated the WP software, plugins, and theme. Now the pagination is missing from the pages that display custom post types. The pagination is working on the blog.
I read through some posts and articles about paginating custom posts and my template code looks correct… I did try altering the pagination arguments without any change. I am also having a tough time just trying to insert some other php commands within this jumble, like just bolting on one of the page-navi plugins at the end of the loop.
<?php /** * Pigtronix TV Page Template */ add_filter('genesis_pre_get_option_site_layout', 'wds_pig_single_layout'); function wds_pig_single_layout($layout) { $layout = 'full-width-content'; return $layout; } add_filter( 'excerpt_length', 'pig_vid_excerpt', 999 ); function pig_vid_excerpt( $length ) { return 10; } remove_action('genesis_after_endwhile', 'genesis_posts_nav'); add_filter ( 'genesis_prev_link_text', 'pig_video_nav_text' ); function pig_video_nav_text() { return '← Newer Videos'; } add_filter ( 'genesis_next_link_text', 'video_nav_text2' ); function video_nav_text2() { return 'Older Videos →'; } add_action('genesis_after_post_content', 'tv_page'); function tv_page() { $args = array( 'relation' => 'AND', array( 'taxonomy' => 'featured-category', 'field' => 'slug', 'terms' => array( 'featured-video' ), ), array( 'taxonomy' => 'featured-category', 'field' => 'slug', 'terms' => array( 'video-playlist', 'video-series' ), 'operator' => 'NOT IN' ) ); $feat_vid_loop = new WP_Query( array( 'post_type' => 'video', 'posts_per_page' => 1, 'orderby' => 'menu_order', 'order' => 'ASC', 'tax_query' => $args, ) ); $feat_id = ''; echo '<div id="featured-video">'; pig_video_loops( $feat_vid_loop, true ); echo '</div><!-- /#featured-video -->'; $args = array( array( 'taxonomy' => 'featured-category', 'field' => 'slug', 'terms' => array( 'video-playlist', 'video-series' ), 'operator' => 'NOT IN' ) ); global $wp_query; $hold = $wp_query; $paged = get_query_var('paged') ? absint( get_query_var('paged') ) : 1; $wp_query = new WP_Query( array( 'post_type' => 'video', 'posts_per_page' => 16, 'orderby' => 'date', 'order' => 'DESC', 'tax_query' => $args, 'paged' => $paged, 'post__not_in' => array( $GLOBALS['pig_feat_video_id'] ) ) ); echo '<div id="media" class="highlight_wrap">'; pig_video_loops( $wp_query ); wds_prev_next_media_pagination_links( $wp_query ); $wp_query = $hold; echo '</div><!-- /#media -->'; } function pig_video_loops( $query=null, $feat=false ) { if ( $query ) { $counter = 1; while ($query->have_posts()) : $query->the_post(); $thevideo = get_post_meta( get_the_id(), 'videobox', true ); $videourl = esc_attr( $thevideo ); // $featvideo = apply_filters( 'the_content', '[embed width="850" ]'. $videourl . '[/embed]' ); // $id = sanitize_html_class( get_the_ID() ); if ($feat) $vid_img = get_the_post_thumbnail( get_the_ID(), 'product-shot', array( 'class' => 'alignleft' ) ); else $vid_img = get_the_post_thumbnail( get_the_ID(), 'video-thumbnails' ); if ($feat) $GLOBALS['pig_feat_video_id'] = get_the_ID(); if ($counter % 2 == 0) { $class = ' class="last"'; } else { $class = ''; } $imgclass = ''; if ($videourl) { echo '<a'. $class .' href="'. get_permalink( ) .'" title="'. get_the_title( ) .'" alt="'. get_the_title( ) .'"><div class="highlight">'; if ( $vid_img ) { echo '<span class="pig_image">'; echo '<div class="vid_play_arrow"></div>'; echo $vid_img; echo '</span>'; $imgclass = ' image'; } echo '<div class="item_info'. $imgclass .'">'; if ($feat) the_title( '<h2>', '</h2>' ); else the_title( '<h3>', '</h3>' ); the_category(); echo '</div>'; // echo $featvideo; // echo '</div><!-- end #video-'. $id .' -->'; echo '</div></a>'; } $counter++; endwhile; wp_reset_query(); } } genesis();
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom Post Pagination disappeared after update’ is closed to new replies.