Disable for Next / Prev thumbnails in my theme.
-
Hey, strange question, might be too difficult to bother you with…
Basically, at the moment, I have a conditional statement for my blog/archive page that only shows the thumbnail generated by Featured Video Plus, but now i’m attempting to pull thumbnails for the Next & Previous nav buttons on the single blog posts. My code isn’t perfect as i’m not getting titles at the moment, but I am getting the featured images to show up there.. But now I need to stop the featured videos from loading in there and just show the generated thumbnails.
If anyone can help that would be amazing, if you want a tip, just let me know and I will gladly send you $$ over paypal. This one seems a little trickier especially since i’m a total PHP noob, but trying my best. PS, i’m sure there is a cleaner way to accomplish this, but was hoping someone could offer some assistance. Name your price if you need compensation.
if ( ! function_exists( 'twentythirteen_post_nav' ) ) : /** * Display navigation to next/previous post when applicable. * * @since Twenty Thirteen 1.0 * * @return void */ function twentythirteen_post_nav() { global $post; // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; ?> <nav class="navigation post-navigation" role="navigation"> <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentythirteen' ); ?></h1> <div class="nav-links"> <?php $prevPost = get_previous_post(); $prevthumbnail = get_the_post_thumbnail($prevPost->ID); ?> <?php previous_post_link( '%link', $prevthumbnail, _x( '<span class="genericon genericon-previous"></span> %title', 'Previous post link', 'twentythirteen' ) ); ?> <?php $nextPost = get_next_post(); $nextthumbnail = get_the_post_thumbnail($nextPost->ID); ?> <?php next_post_link( '%link', $nextthumbnail, _x( '%title <span class="genericon genericon-next"></span>', 'Next post link', 'twentythirteen' ) ); ?> </div><!-- .nav-links --> </nav><!-- .navigation --> <?php } endif;
- The topic ‘Disable for Next / Prev thumbnails in my theme.’ is closed to new replies.