Created
February 9, 2026 07:38
-
-
Save dwanjuki/22740eb20727377cbdb2b37b49f98aea to your computer and use it in GitHub Desktop.
Add script to clone Member Directory pagination to top of directory.
This file contains hidden or 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 | |
| /** | |
| * Add script to clone Member Directory pagination to top of directory. | |
| * | |
| * You can add this recipe to your site by creating a custom plugin | |
| * or using the Code Snippets plugin available for free in the WordPress repository. | |
| * Read this companion article for step-by-step directions on either method. | |
| * https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
| */ | |
| function my_pmpro_member_directory_before_pagination() { | |
| ?> | |
| <script> | |
| jQuery(document).ready(function () { | |
| jQuery( ".pmpro_pagination" ).clone().appendTo( ".pmpro_member_directory_before" ); | |
| }); | |
| </script> | |
| <?php | |
| } | |
| add_filter( 'pmpro_member_directory_before', 'my_pmpro_member_directory_before_pagination' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment