Skip to main content
edited title
Link
prosti
  • 4.3k
  • 4
  • 25
  • 45

How does the 'the_post_navigation()' work for CPT's?

Source Link
Benjamin
  • 185
  • 2
  • 14

How does the 'the_post_navigation()' work for CPT's

In the twentyfifteen theme on the single.php template they are using the fairly new function 'the_post_navigation'. It seems to work for Custom Post Types (CPTs) but I cannot figure out how it does this.

Ultimately, what I would like to do is set the '$taxonomy' parameter in the below function to the current post. However, I cannot figure out how to get the taxonomy of a Post on a single post page.

// How to set $taxonomy to current post taxonomy
get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy = 'category' );