<?php if(theaisle_elated_options()->getOptionValue('portfolio_single_hide_pagination') !== 'yes') : ?>
    <?php
    $back_to_link = get_post_meta(get_the_ID(), 'portfolio_single_back_to_link', true);
    $nav_same_category = theaisle_elated_options()->getOptionValue('portfolio_single_nav_same_category') == 'yes';
    ?>
    <div class="eltdf-ps-navigation">
        <?php if(get_previous_post() !== '') : ?>
            <div class="eltdf-ps-prev">
                <?php if($nav_same_category) {
	                previous_post_link('%link','<span class="eltdf-ps-nav-mark">'. esc_html__( 'Previous Post', 'theaisle-core' ) .'</span>', true, '', 'portfolio-category');
                } else {
	                previous_post_link('%link','<span class="eltdf-ps-nav-mark">'. esc_html__( 'Previous Post', 'theaisle-core' ) .'</span>');
                } ?>
            </div>
        <?php endif; ?>

        <?php if($back_to_link !== '') : ?>
            <div class="eltdf-ps-back-btn">
                <a itemprop="url" href="<?php echo esc_url(get_permalink($back_to_link)); ?>">
                    <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
                     width="27.85px" height="27.944px" viewBox="0 0 27.85 27.944" enable-background="new 0 0 27.85 27.944" xml:space="preserve">
                    <rect x="0.559" y="0.631" fill="none" stroke="#818491" stroke-miterlimit="10" width="11.875" height="11.875"/>
                    <rect x="15.412" y="0.631" fill="none" stroke="#818491" stroke-miterlimit="10" width="11.875" height="11.875"/>
                    <rect x="0.559" y="15.533" fill="none" stroke="#818491" stroke-miterlimit="10" width="11.875" height="11.875"/>
                    <rect x="15.412" y="15.533" fill="none" stroke="#818491" stroke-miterlimit="10" width="11.875" height="11.875"/>
                    </svg>
                </a>
            </div>
        <?php endif; ?>

        <?php if(get_next_post() !== '') : ?>
            <div class="eltdf-ps-next">
                <?php if($nav_same_category) {
                    next_post_link('%link', '<span class="eltdf-ps-nav-mark">'. esc_html__( 'Next Post', 'theaisle-core' ) .'</span>', true, '', 'portfolio-category');
                } else {
                    next_post_link('%link', '<span class="eltdf-ps-nav-mark">'. esc_html__( 'Next Post', 'theaisle-core' ) .'</span>');
                } ?>
            </div>
        <?php endif; ?>
    </div>
<?php endif; ?>