Created
February 21, 2018 10:05
-
-
Save Youhan/a833e8aadff560ac064324de7322aeda to your computer and use it in GitHub Desktop.
override portfolio nav - toranj wp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ---------------------------------------------------------------------------------------- | |
* Override portfolio nav | |
* ---------------------------------------------------------------------------------------- | |
*/ | |
function owlab_portfolio_single_nav() { | |
$next = get_next_post(); | |
$prev = get_previous_post(); | |
$prev_class = "fa-angle-left"; | |
$next_class = "fa-angle-right"; | |
if ( is_rtl() ){ | |
$next_class = "fa-angle-left"; | |
$prev_class = "fa-angle-right"; | |
} | |
if ($next OR $prev){ | |
?> | |
<ul class="portfolio-nav"> | |
<?php if ( $prev ) : ?> | |
<li> | |
<a class="portfolio-prev" href="<?php echo get_permalink( $prev->ID ); ?>"> | |
<i class="fa <?php echo $prev_class; ?>"></i> | |
<span><?php _e('Prev','toranj') ?></span> | |
</a> | |
</li> | |
<?php endif; ?> | |
<li class="portfolio-back-li"> | |
<a class="portfolio-back" href="<?php echo get_post_type_archive_link('owlabpfl');?>"> | |
<i class="fa fa-bars"></i> | |
<span><?php _e('All','toranj') ?></span> | |
</a> | |
</li> | |
<?php if ( $next ) : ?> | |
<li> | |
<a class="portfolio-next" href="<?php echo get_permalink( $next->ID ); ?>"> | |
<i class="fa <?php echo $next_class; ?>"></i> | |
<span><?php _e('Next','toranj') ?></span> | |
</a> | |
</li> | |
<?php endif; ?> | |
</ul><?php | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment