Okay
  Public Ticket #540290
Can't browse portfolio within tag?
Closed

Comments

  • Bartek started the conversation

    The problem
    I cannot browse portfolio withing one particular tag

    Situation

    1. I've created tag and category for an item.
    2. I've created page with "portfolio" component. Every page has it's own portfolio component with different tag filtering (the example URL has "anieliska" tag).
    3. When I open an item and press "Next" or "Previous" - I browse the whole portfolio, not the particular tag.

    Is it possible to limit the browsing to this one particular tag?

  •  895
    TheFox replied

    Hello Bartek,

    What you want to do is to change the navigation of the Single portfolio post to only link to post that have the same tags right?

    If you want to do this then go edit the single-portfolio.php file

    and change the lines 345 - 347 from

       <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); ?>
    <div class=\"single_port_navigation\"><a href=\"<?php if($rd_data[\'rd_bc_portlink\']){echo esc_url($rd_data[\'rd_bc_portlink\']);} ?>\" class=\"all_projects_btn\"><span class=\"ap_top_point\"></span><span class=\"ap_bottom_point\"></span></a><?php $prev = get_permalink(get_adjacent_post(false,\'\',false)); if ($prev != get_permalink()) { ?><a href=\"<?php echo esc_url($prev); ?>\" class=\"next_project\"><?php echo __(\'Next\', \'thefoxwp\'); ?></a><?php } ?><?php $next = get_permalink(get_adjacent_post(false,\'\',true)); if ($next != get_permalink()) { ?><a href=\"<?php echo esc_url($next); ?>\" class=\"previous_project\"><?php echo __(\'Previous\', \'thefoxwp\'); ?></a><?php } ?></div>

    to

       <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); ?>
    <div class=\"single_port_navigation\"><a href=\"<?php if($rd_data[\'rd_bc_portlink\']){echo esc_url($rd_data[\'rd_bc_portlink\']);} ?>\" class=\"all_projects_btn\"><span class=\"ap_top_point\"></span><span class=\"ap_bottom_point\"></span></a><?php $prev = get_permalink(get_adjacent_post(true,\'\',false,\'tagportfolio\')); if ($prev != get_permalink()) { ?><a href=\"<?php echo esc_url($prev); ?>\" class=\"next_project\"><?php echo __(\'Next\', \'thefoxwp\'); ?></a><?php } ?><?php $next = get_permalink(get_adjacent_post(true,\'\',true,\'tagportfolio\')); if ($next != get_permalink()) { ?><a href=\"<?php echo esc_url($next); ?>\" class=\"previous_project\"><?php echo __(\'Previous\', \'thefoxwp\'); ?></a><?php } ?></div>

    if they have the sames tags then a next or previous link should appear.

    Do not hesitate to contact us if you have other questions.

    Regards

  • Bartek replied

    What you want to do is to change the navigation of the Single portfolio post to only link to post that have the same tags right?

    That\'s right!

    The solution is working like a charm! :-)

  •  895