PHP code example of themehybrid / hybrid-pagination
1. Go to this page and download the library: Download themehybrid/hybrid-pagination library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use function Hybrid\Pagination\display;
use function Hybrid\Pagination\render;
use function Hybrid\Pagination\pagination;
// Echoes the pagination markup.
display( 'posts' );
// Returns the pagination markup as a string.
$html = render( 'posts' );
// Returns the underlying Pagination object, letting you inspect it before output.
pagination( 'posts' )->make()->display();
// Main loop pagination.
display( 'posts' );
// Singular, multi-page post pagination (`<!--nextpage-->`).
display( 'post' ); // `singular` is also accepted as an alias for `post`.
// Comment pagination.
display( 'comments' );
// Filter default args for a given context, before user args are merged in.
add_filter( 'hybrid/pagination/posts/defaults', function ( $defaults ) {
return $defaults;
} );
// Filter the final, merged args for a given context.
add_filter( 'hybrid/pagination/posts/args', function ( $args ) {
return $args;
} );
// Filter the final rendered markup for a given context.
add_filter( 'hybrid/pagination/posts', function ( $html, $args ) {
return $html;
}, 10, 2 );
// Filter each built page link URL (also runs through core's `paginate_links` filter).
add_filter( 'paginate_links', function ( $link ) {
return $link;
} );
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.