This is the code that worked for me. I have a custom post type called “feature” defined like this:
$args = array(
'label' => 'feature',
'description' => 'Product feature pages',
'labels' => array(
'name' => 'Features',
'singular_name' => 'Feature',
'menu_name' => 'Feature',
'parent_item_colon' => 'Parent Feature:',
'all_items' => 'All Features',
'view_item' => 'View Feature',
'add_new_item' => 'Add New Feature',
'add_new' => 'New Feature',
'edit_item' => 'Edit Feature',
'update_item' => 'Update Feature',
'search_items' => 'Search Feature',
'not_found' => 'No Features found',
'not_found_in_trash' => 'No Features found in Trash',
),
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'custom-fields', 'page-attributes', ),
'taxonomies' => array( 'category' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => '',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'feature',
);
register_post_type( 'feature', $args );
Then I create a file called single-feature.php
in my theme folder, and inside that file I have:
<ul class="pager">
<li class="previous">
<?php
previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous feature', 'mistcrm' ) . '</span> %title' ); ?>
</li>
<li class="next">
<?php
next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next feature', 'mistcrm' ) . '</span>' ); ?>
</li>
</ul>