-
Posted in : Read WP
-
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
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.Also when I have 2 separate pages for DeptA and DeptB, the link “Back to Portfolio” is broken.
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.
– 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; }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?
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!
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' );
You must be logged in and have valid license to reply to this topic.