# Use featured image in post navigation

**URL:** <https://community.wpbeaverbuilder.com/t/use-featured-image-in-post-navigation/14307>\
**Category:** Snippets\
**Created:** [April 13, 2021, 4:10pm UTC](https://community.wpbeaverbuilder.com/t/use-featured-image-in-post-navigation/14307 "2021-04-13T16:10:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pross](https://community.wpbeaverbuilder.com/user_avatar/community.wpbeaverbuilder.com/pross/32/883_2.png) [@pross](https://community.wpbeaverbuilder.com/u/pross)\
**Post date:** [April 13, 2021, 4:10pm UTC](https://community.wpbeaverbuilder.com/t/use-featured-image-in-post-navigation/14307/1 "2021-04-13T16:10:54Z")

</div>

```
add_filter( 'fl_theme_builder_post_nav', function( $args ) {

	$next_post = get_next_post();
	$previous_post = get_previous_post();
	if ( isset( $next_post->ID ) ) {
		$args['next_text'] = '<span class="post-title">%title</span>' . get_the_post_thumbnail( $next_post->ID, 'thumbnail' );
	}
	if ( isset( $previous_post->ID ) ) {
		$args['prev_text'] = '<span class="post-title">%title</span>' . get_the_post_thumbnail( $previous_post->ID, 'thumbnail' );
	}
	return $args;
} );
```
