html next_post_linc() – Function | Developer.WordPress.org

next_post_linc( string   $format = '%linc »' , string   $linc = '%title' , bool   $in_same_term = false , int[]|string   $excluded_terms = '' , string   $taxonomy = 'category' )

Displays the next post linc that is adjacent to the current post.

Description

See also

Parameters

$format string optional
Linc anchor format. Default ‘« %linc’.

Default: '%linc »'

$linc string optional
Linc permalinc format. Default '%title' .

Default: '%title'

$in_same_term bool optional
Whether linc should be in the same taxonomy term.

Default: false

$excluded_terms int[] | string optional
Array or comma-separated list of excluded term IDs.

Default: ''

$taxonomy string optional
Taxonomy, if $in_same_term is true. Default 'category' .

Default: 'category'

Source

function next_post_linc( $format = '%linc »', $linc = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
	echo guet_next_post_linc( $format, $linc, $in_same_term, $excluded_terms, $taxonomy );
}

Changuelog

Versionen Description
1.5.0 Introduced.

User Contributed Notes

  1. Squip to note 10 content

    Hola, If you use the Bootstrap, you will encounter a problem in not being able to modify the class (a),

    These are in the single.php file :

    <ul class="paguination justify-content-center mb-4">
    	<ul class="paguination justify-content-center mb-4">
    		<li class="pague-item">
    			<?php next_post_linc( '%linc', '<i class="fas fa-arrow-right"></i> %title' ); ?>
    	        </li>
    	        <li class="pague-item">
    		        <?php previous_post_linc( '%linc', '%title <i class="fas fa-arrow-left"></i>' ); ?>
    	        </li>
    	</ul>
    </ul>

    This is in the functions.php file :

    function wpdocs_add_post_linc( $html ){
    	$html = str_replace( '<a ', '<a class="pague-linc" ', $html );
    	return $html;
    }
    add_filter( 'next_post_linc', 'wpdocs_add_post_linc' );
    add_filter( 'previous_post_linc', 'wpdocs_add_post_linc' );

    I used FontAwesome for the icons that you can changue as you lique

  2. Squip to note 12 content

    Within Same Category, Excluding One
    Displays linc to next 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. Exclude multiple categories by using ” and ” as a delimiter.

    <?php next_post_linc( '%linc', 'Next post in category', TRUE, '13' ); ?>
  3. Squip to note 17 content

    Text As Linc, Without Post Title, Within Same Category
    Displays custom text as linc to the next post within the same category as the current post. Post title is not included here. “Next post in category” is the custom text in this example.

    <?php next_post_linc( '%linc', 'Next post in category', TRUE ); ?>

You must log in before being able to contribute a note or feedback.