Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Portfolio page – Next and Previous buttons
New Landing › How can we help? › Themeforest Theme Support › Dante › Portfolio page – Next and Previous buttons
- This topic has 12 replies, 5 voices, and was last updated 10 years by Rui Guerreiro – SUPPORT.
-
Posted in: Dante
-
July 29, 2014 at 9:12 pm #95843
Is there a way to exclude a specific portfolio category from the Previous and Next Buttons on the Portfolio-Single page template?
We do not want Client coverage to show up as users flip through our portfolio itmes
July 30, 2014 at 9:32 am #95992Hi
Unfortunately not sorry. I’ve noticed you have removed the navigation now? That is the only solution
– Kyle
July 30, 2014 at 3:42 pm #96171I think there is actually a way to adjust the PHP code in the single-portfolio.php to exclude a specific category (since I am not a PHP expert – I reached this) however all the code I have added to the file doex not seem to exclude the one category I am trying hide.
<ul class=”pagination-wrap bar-styling portfolio-pagination clearfix”>
<li class=”prev”><?php next_post_link(‘%link’, ‘<i class=”ss-navigateleft”></i>’); ?>
<?php if ($portfolio_page) { ?>
<li class=”index”>“><i class=”ss-layergroup”></i>
<?php } ?>
<li class=”next”><?php previous_post_link(‘%link’, ‘<i class=”ss-navigateright”></i>’); ?>I know there is a way to exclude a specific category in this piece of code I just haven’t found the right code to do it. I am hoping your PHP experts can tell me the proper way to do it.
I have only hidden the post navigation temporarily, until I can implement the exclude category code.
July 30, 2014 at 3:51 pm #96176I will forward this to the developer to see if it is possible
– Kyle
July 30, 2014 at 4:23 pm #96190I was actually trying to solve a similar problem but came across this that should help you. It has an example for excluding the category.
http://codex.wordpress.org/Function_Reference/next_post_link
July 30, 2014 at 6:44 pm #96213Thanks audiophreak, but I tried both both the
$excluded_terms = ‘293’, and the
TRUE, ‘293’,In the PHP code above. But neither of them seemed to work. Here is how I had the code listed
<ul class=”pagination-wrap bar-styling portfolio-pagination clearfix”>
<li class=”prev”><?php next_post_link(‘%link’, TRUE, ‘293’, ‘<i class=”ss-navigateleft”></i>’); ?>
<?php if ($portfolio_page) { ?>
<li class=”index”>“><i class=”ss-layergroup”></i>
<?php } ?>
<li class=”next”><?php previous_post_link(‘%link’, TRUE, ‘293’, ‘<i class=”ss-navigateright”></i>’); ?>AND
<ul class=”pagination-wrap bar-styling portfolio-pagination clearfix”>
<li class=”prev”><?php next_post_link(‘%link’, $excluded_terms = ‘293’, ‘<i class=”ss-navigateleft”></i>’); ?>
<?php if ($portfolio_page) { ?>
<li class=”index”>“><i class=”ss-layergroup”></i>
<?php } ?>
<li class=”next”><?php previous_post_link(‘%link’, $excluded_terms = ‘293’, ‘<i class=”ss-navigateright”></i>’); ?>Do you think I might be missing something else?
July 31, 2014 at 3:59 am #96273This is the code you want:
<?php next_post_link('%link', '<i class="ss-navigateleft"></i>', true, '', 'portfolio-category'); ?>
and
<?php previous_post_link('%link', '<i class="ss-navigateright"></i>', true, '', 'portfolio-category'); ?>
– Ed
July 31, 2014 at 3:35 pm #96552Sadly that did not work. Any other ideas?
July 31, 2014 at 3:44 pm #96553Sorry, misread the question. I haven’t tried it, but this should be correct:
<?php next_post_link('%link', '<i class="ss-navigateleft"></i>', false, '293', 'portfolio-category'); ?>
and
<?php previous_post_link('%link', '<i class="ss-navigateright"></i>', false, '293', 'portfolio-category'); ?>
– Ed
July 31, 2014 at 3:52 pm #96557nope this didn’t work either.
July 31, 2014 at 4:12 pm #96568Hmm.. Well that is the code as specified here: http://codex.wordpress.org/Function_Reference/next_post_link
Nothing in the theme would cause that not to work.
– Ed
July 31, 2014 at 4:34 pm #96571I know I am confused too.
August 1, 2014 at 12:38 pm #96839Sorry that you didn’t make it work 🙁
-Rui
-
Posted in: Dante
You must be logged in and have valid license to reply to this topic.