<?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?>

<!-- Entry Navigation -->
<div class="entry-post-navigation"><?php
	$prev_post = get_previous_post();
	if( !empty( $prev_post ) ):	?>

		<div class="post-prev-link">

			<div class="nav-title-wrap">
				<p><a href="<?php echo get_permalink( $prev_post->ID ); ?>" title="<?php echo esc_attr($prev_post->post_title); ?>"><?php esc_html_e('Previous Story','advenx'); ?></a></p>
				<span class="zmdi zmdi-long-arrow-left zmdi-hc-fw"></span>
				<h3><a href="<?php echo get_permalink( $prev_post->ID ); ?>" title="<?php echo esc_attr($prev_post->post_title); ?>"><?php
					if( get_the_title( $prev_post->ID ) == '') {
						echo esc_html__('Previous Post', 'advenx');
					} else {
						echo "$prev_post->post_title";
					} ?></a>
				</h3>
			</div>

		</div>
		<?php
	else: ?>
		<div class="post-prev-link no-post">
			<div class="nav-title-wrap">
				<span class="zmdi zmdi-long-arrow-left zmdi-hc-fw"></span>
				<h3><?php echo esc_html__('No previous story to show!', 'advenx'); ?></h3>
			</div>
		</div>
		<?php
	endif;

	$next_post = get_next_post();
	if( !empty( $next_post ) ):	?>
		<div class="post-next-link">

			<div class="nav-title-wrap">
				<p><a href="<?php echo get_permalink( $next_post->ID ); ?>" title="<?php echo esc_attr($next_post->post_title); ?>"><?php esc_html_e('Next Story','advenx'); ?></a></p>
				<span class="zmdi zmdi-long-arrow-right zmdi-hc-fw"></span>
				<h3><a href="<?php echo get_permalink( $next_post->ID ); ?>" title="<?php echo esc_attr($next_post->post_title); ?>"><?php
					if(get_the_title( $next_post->ID ) == '') {
						echo esc_html__('Next Post', 'advenx');
					} else {
						echo "$next_post->post_title";
					} ?></a>
				</h3>
			</div>

		</div>
		<?php
	else: ?>
		<div class="post-next-link no-post">
			<div class="nav-title-wrap">
				<span class="zmdi zmdi-long-arrow-right zmdi-hc-fw"></span>
				<h3><?php echo esc_html__('No next story to show!', 'advenx'); ?></h3>
			</div>
		</div>
		<?php
	endif; ?>
</div><!-- Entry Navigation -->