adding nav: prev/next to menu only in posts
-
I have a portfolio-single.php file that imports the header menu. Problem is I want it to import the header menu with an added “previous/next” buttons. I’ve got the code, as it came with the theme (copied it from the footer area of the orig portfolio-single.php).
Where can I add this navigation code so that it only appears in the header in one section of the site: portfolio items. The theme has been coded with portfolio items acting the same as posts.
When I added it to the header it appeared on the homepage and on the portfolio page, so I’m thinking, maybe I need to import a new php file into the portfolio php, child-theme?
Appreciate your feedback.
<?php <div class="portfolio-meta"> <nav id="nav-single"> <?php if ( get_next_post() ) : ?> <span class="sep"> | </span> <span class="nav-previous"><?php next_post_link( '%link', __( '<i class="icon-caret-left"></i> Previous', 'mega' ) ); ?></span> <?php endif; ?> <?php if ( get_previous_post() ) : ?> <span class="sep"> | </span> <span class="nav-next"><?php previous_post_link( '%link', __( 'Next <i class="icon-caret-right"></i>', 'mega' ) ); ?></span> <?php endif; ?> </nav> </div> ?>
The topic ‘adding nav: prev/next to menu only in posts’ is closed to new replies.