About Sridhar Katakam
I am an independent WordPress web consultant with 10 years of experience in WordPress theme installation, customization, administration, maintenance, support, documentation, troubleshooting and PSD/design to WP.
Genesis and WordPress Tutorials
Session expired
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.
My portfolio in Portfolio Pro is has three portfolio types within the portfolio. One can view the entire portfolio, or one of the three portfolio types. Are there variations to this code snippet that allows one to go to the previous or next portfolio item within a portfolio type? Right now the previous/next links go through the entire portfolio.
Thanks
Yes.
Hope you have paid attention to
?
Sorry Sridhar but no luck.
Below is the php for my portfolio on http://rroden.com/portfolio/ When I leave “previous_post_link();” & “next_post_link();” as they are, next/previous buttons work.
But when I edited links to by adding into the parentheses ( ‘« %link’, ‘%title’, true, ”, ‘book_type’ );” with any combination of possible options to replace ‘book_type” it only breaks the button.
// Add post navigation for “portfolio” CPT
add_action( ‘genesis_after_loop’, ‘sk_prev_next_post_nav’ );
function sk_prev_next_post_nav() {
if ( ! is_singular( ‘portfolio’ ) ) // Replace ‘portfolio’ with the name of your CPT
return;
genesis_markup( array(
'html5' => '',
'xhtml' => '',
'context' => 'adjacent-entry-pagination',
) );
echo '';
previous_post_link();
echo '';
echo '';
next_post_link();
echo '';
echo '</div>';
}
Any ideas? – Thanks
Hi Sridhar,
I experience the same as the previous poster…
When using: previous_post_link(); the link appears, but does not stay in the category. I use the code as:
if ( ! is_singular( ‘post’ ) )
When I use: previous_post_link ( ‘« %link’, ‘%title’, true, ‘ ‘, ‘nieuws’ );
‘nieuws’ is the category I want the navigation to stay in – When using that code, the previous link just does not appear.
I checked a lot of other sites and the codex, but just can not get it to work
Are you talking about posts or CPT entries?
Is
nieuws
the built-in WordPress category or a custom taxonomy?In the end changed the last bit to:
previous_post_link( ‘« %link’, ‘%title’, true );
– and now it works 🙂