-
-
Save bentasm1/6e5786e4ce2fd664cbdc to your computer and use it in GitHub Desktop.
WCV Pro vendor list pagination customisation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WC Vendors Pro vendors list uses the same layout as the default woocommerce pagination | |
// IF your theme is overriding the layout of the pagination links then you can use the following snippets (modified for your theme) | |
// to make the vendor list pagination links wrap with your theme wrappers and styles. | |
// Pagination wrapper opening tag | |
add_filter( 'wcv_pagination_before', 'wcv_pagination_before_wrapper' ); | |
function wcv_pagination_before_wrapper( $html ) { | |
return '<div class="somethign else">'; | |
} | |
// Pagination wrapper closing tag | |
add_filter( 'wcv_pagination_after', 'wcv_pagination_after_wrapper' ); | |
function wcv_pagination_after_wrapper( $html ) { | |
return '</div>'; | |
} | |
// Pagination links arguments that may need to change if your theme overrides these too. | |
add_filter( 'wcv_pagination_args', 'wcv_pagination_link_args', 10, 3 ); | |
function wcv_pagination_link_args( $args, $current_page, $total_pages ) { | |
// Modify this argument array to replicate what your theme uses | |
return array( | |
'base' => get_pagenum_link( ) . '%_%', | |
'format' => 'page/%#%/', | |
'current' => $current_page, | |
'total' => $total_pages, | |
'prev_next' => false, | |
'type' => 'list', | |
); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment