• Divi’s Projects pages are essentially a Custom Post Type. There is a template called single-projects.php in which I have the following Post Navigation code for my Previous / Next buttons:

    <?php if ( $is_page_builder_used ) : ?>
    
    <div class="nav-single wpc-post-nav clearfix topns">
    	<span class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'Divi' ) . '</span> Prev' ); ?></span>
    
    	<span class="nav-next"><?php next_post_link( '%link', 'Next <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'Divi' ) . '</span>' ); ?></span>
    </div><!-- .nav-single -->
    
    <?php endif; ?>

    This is all fine and dandy except that I have 5 categories for my projects and this will just advance through the different Projects according to publication date with no regard for the categories.

    I have tried the various options I see on WP Codex for post types, but they do not work for Projects. I don’t know why. The code I typed above works fine, but if I add any of the options suggested in the Codex, the buttons either disappear or there is simply no change in functionality.

    I’m not sure if there’s some special way of doing this for Custom Post Types or if Divi’s Projects pages are just very different. I have asked on the Divi forum and got no answers.

  • The topic ‘[Theme: Divi] Post Navigation within same category on Project pages’ is closed to new replies.