Как добавить пагинацию вместо Load More wordpress buddypress function

Подскажите как добавить пагинацию вместо load more

<?php
    function dd_setup_user_blog_nav(){
        global $bp; 
        bp_core_new_nav_item( array(
            'name' => __( 'Blog', 'toucha-shortcodes'),
            'slug' => __('blog', 'toucha-shortcodes'),
            'parent_url' => $bp->profile->slug,
            'parent_slug' => $bp->profile->slug,
            'screen_function' => 'bp_user_blog',
            'position' => get_theme_mod( 'toucha_bp_user_blog_position_hierarchy', 10 ),
            'user_has_access' => 1, 
            'item_css_id' => 'blog'
        ));
   
    }
    add_action( 'bp_setup_nav', 'dd_setup_user_blog_nav' );

    function bp_user_blog() {

        add_action('bp_template_content', 'dd_bp_user_blog_show_screen_content');

        $templates = array('members/single/plugins.php', 'plugin-template.php');
        if (strstr(locate_template($templates), 'members/single/plugins.php')) {
            bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));
        } else {
            bp_core_load_template(apply_filters('bp_core_template_plugin', 'plugin-template'));
        }

    }

    ?>
    <?php
    function dd_bp_user_blog_show_screen_content() {

    echo '<div id="bp-user-blog">';

        $name = bp_core_get_user_displayname( bp_displayed_user_id() );
        echo '<h4 class="bp-screen-title">'.sprintf( __( "%s's Posts", "toucha-shortcodes"), $name).'</h4>';

        $wp_query = '';
        $paged = '';
        $temp = $wp_query;
        $wp_query= null;
        $wp_query = new WP_Query();
        $wp_query->query('author=' . bp_displayed_user_id() . '&posts_per_page=10'.'&paged='.$paged);
        if ($wp_query->have_posts()) {
        echo '<ul class="shortcode-small-recent-posts shortcode-general-list col-1">';
        while ($wp_query->have_posts()) : $wp_query->the_post();

            include get_template_directory() . '/inc/template-parts/recent-post.php';

        endwhile; // end of loop

        echo '</ul>';

        echo '<div class="load-more-container">';
        echo '<span id="bp-user-blog-load-more" class="load-more show" data-tab-page="1" data-user-id="' . bp_displayed_user_id() . '">'.__( "Load More", "toucha-shortcodes").'</span>';
        echo '</div>';

        } else { 
            echo '<p>' . __( 'No posts found.', 'toucha-shortcodes') . '</p>';
        }

        echo '</ul>';

    echo '</div>';

    }

    ?>

Ответы (0 шт):