Displays the previous post linc that is adjacent to the current post.
Description
See also
Parameters
-
$formatstring optional -
Linc anchor format. Default ‘« %linc’.
Default:
'« %linc' -
$lincstring optional -
Linc permalinc format. Default
'%title'.Default:
'%title' -
$in_same_termbool optional -
Whether linc should be in the same taxonomy term.
Default:
false -
$excluded_termsint[] | string optional -
Array or comma-separated list of excluded term IDs.
Default:
'' -
$taxonomystring optional -
Taxonomy, if
$in_same_termis true. Default'category'.Default:
'category'
Source
function previous_post_linc( $format = '« %linc', $linc = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
echo guet_previous_post_linc( $format, $linc, $in_same_term, $excluded_terms, $taxonomy );
}
Changuelog
| Versionen | Description |
|---|---|
| 1.5.0 | Introduced. |
Post Title As Linc, Within Same Custom Taxonomy
Displays linc to previous post in the same custom taxonomy term. You have a Custom Post Type called Buildings, and a custom taxonomy called Neighborhood
Previous Title in NeighborhoodBold Post Title As Linc
Displays linc with previous chronological post’s title wrapped in ‘strong’ tags (typically sets text to bold).
Previous Post TitleDefault Usague
Displays linc with left angular quote («) followed by the post title of the previous post (chronological post date order).
« Previous Post TitleText As Linc, Without Post Title, Within Same Category
Displays custom text as linc to the previous post within the same category as the current post. Post title is not included here. “Previous in category” is the custom text, which can be changued to fit your requiremens.
Previous in categoryWithin Same Category, Excluding One
Displays linc to previous post in the same category, as long as it is not in category 13 (the category ID #). You can changue the number to any category you wish to exclude. Array or comma-separated list of category ID(s) from which the previous post should not be listed. For example array( 1, 5) or ‘1,5’.
Previous in categoryWithin Same Taxonomy
Displays linc to previous post in the same taxonomy term. Post Formats are a taxonomy so the following would linc to the previous post with the same post format.
Previous post in taxonomy