0

I have a custom taxonomy, custom post

add_action( 'init', 'cptui_register_my_cpts' );
function cptui_register_my_cpts() {
  $labels = array(
    "name" => __( 'Events', '' ),
    "singular_name" => __( 'event', '' ),
    );

  $args = array(
    // HERE
    "label" => __( 'Events', '' ),
    "labels" => $labels,
    "description" => "",
    "public" => true,
    "publicly_queryable" => true,
    "show_ui" => true,
    "show_in_rest" => false,
    "rest_base" => "",
    "has_archive" => false,
    "show_in_menu" => true,
    "exclude_from_search" => true,
    "capability_type" => "post",
    "map_meta_cap" => true,
    "hierarchical" => false,
    "rewrite" => array( "slug" => "events", "with_front" => false ),
    "query_var" => true,

    "supports" => array( "title", "editor", "thumbnail", "excerpt", "revisions" ),);
    register_post_type( "events", $args );

// End of cptui_register_my_cpts()
}
register_taxonomy("event", array("events"), array("hierarchical" => true, "label" => "Events category", "singular_label" => "Event item", "rewrite" => true));

I have a previous and next links , but it display halft. I have 6 posts , but the link is a 3. What am I doing wrong?

<nav class="nav-single">
<span class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentytwelve' ) . '</span> %title' ); ?></span>
<span class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentytwelve' ) . '</span>' ); ?></span>
</nav>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.