Multiple Portfolio Navigation Issue

  • Posted in : Read WP
  • Yingying
    Participant

    Hi!

    I have two portfolio pages (i.e. two departments). the bottom navigation navigates both departments, instead of within each department. How can I fix this?

    Yingying

    Mehmet S.
    Keymaster

    Please be more descriptive.

    Yingying
    Participant

    I mean the PREVIOUS PROJECT and NEXT PROJECT does not navigate within a single department.

    Example:
    I have 2 departments DeptA and DeptB and made them into 2 portfolio pages, but when I navigate DeptA portfolio items, in PREVIOUS PROJECT or NEXT PROJECT there can be links to portfolio items from DeptB.

    Yingying
    Participant

    Also when I have 2 separate pages for DeptA and DeptB, the link “Back to Portfolio” is broken.

    Yingying
    Participant

    By “broken” I meant the “Back to Portfolio” link should bring user back to the parent portfolio department (single portfolio post under DeptA should bring users back to DeptA department page, single portfolio post under DeptB should bring users back to DeptB department page, ), but the current link brings user back to a portfolio page.

    Mehmet S.
    Keymaster

    – go to Appearance > Editor > single-portfolio.php

    – find:

    previous_post_link( '<h4>' . __( 'PREVIOUS PROJECT', 'read' ) . '</h4>%link', '<span class="meta-nav">←</span> %title' );
    

    – and:

    next_post_link( '<h4>' . __( 'NEXT PROJECT', 'read' ) . '</h4>%link', '%title <span class="meta-nav">→</span>' );
    

    – edit:

    previous_post_link( '<h4>' . __( 'PREVIOUS PROJECT', 'read' ) . '</h4>%link', '<span class="meta-nav">←</span> %title', TRUE );
    

    – and:

    next_post_link( '<h4>' . __( 'NEXT PROJECT', 'read' ) . '</h4>%link', '%title <span class="meta-nav">→</span>', TRUE );
    

    Note: “Back to Portfolio” link doesn’t work on multiple portfolios, only for the Portfolio page template. I will improve it. You can hide it at this time:

    – use this in your custom css field:

    .back-to-portfolio { display: none; }
    
    Yingying
    Participant

    I hided the “Back to Portfolio” link.

    For the navigation within same portfolio category, it doesn’t work. I see the parameter TRUE in “previous_post_link” and “next_post_link” is for Category, but in this theme the portfolio items do not use Categories (I tried wp_list_cats(), and it only listed blog categories). Did it work on your side?

    Yingying
    Participant

    Hi! Want to see if you had a chance to see my issue. I’m working on a website that needs to be public as soon as possible, and I got blocked by this issue… thanks!

    Mehmet S.
    Keymaster

    Edit:

    previous_post_link( '<h4>' . __( 'PREVIOUS PROJECT', 'read' ) . '</h4>%link', '<span class="meta-nav">←</span> %title', true, ' ', 'department' );
    
    next_post_link( '<h4>' . __( 'NEXT PROJECT', 'read' ) . '</h4>%link', '%title <span class="meta-nav">→</span>', true, ' ', 'department' );
    
Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register