Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

  • webfacemedia
    Participant

    @webfacemedia

    SOLVED:

    <div class="dashboard-wrapper">
        <h1>My Friends' Videos</h1>
        <a href="?part=default" class="button">Dashboard</a><br><br><hr>
        <?php
        $user_id = bp_is_user() ? bp_displayed_user_id() : bp_loggedin_user_id();
        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
        $args = apply_filters('bp_show_friends_args', array(
            'user_id' => $user_id,
            'type' => 'active',
            'per_page' => 20,
            'paged' => $paged,
            // 'max' => $limit,
            'populate_extra' => 0
                )
        );
    
        if (bp_has_members($args)) {
            ?>
            <div id="pagination">
                <ul class="pagination">
                    <li id="previous-stories" class="arrow">
                        <?php bp_members_pagination_links(); ?>
                    </li>
                 </ul>
            </div><!-- /#pagination --><hr>
            <ul class="bpsf-members">
                <?php while (bp_members()) : bp_the_member(); ?>
    
                    <li class="bpsf-member">
                        <?php bp_member_name(); ?>
                        <div class="item-avatar">
                            <a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name(); ?>">
                                <?php bp_member_avatar($avatar_args) ?><?php display_friend_colors(bp_get_member_user_id()); ?>
                            </a>
    
                        </div>
                        <?php do_action('bp_show_friends_after_friend_avatar', bp_get_member_user_id()); ?><div class="cleared"></div>
                        <div class="videos">
                            <ul>
                                <?php
                                $args = array(
                                    'author' => bp_get_member_user_id(),
                                    'orderby' => 'post_date',
                                    'order' => 'DESC',
                                    'post_type' => 'member_video',
                                    'posts_per_page' => -1 // no limit
                                );
                                $current_user_posts = get_posts($args);
                                foreach ($current_user_posts as $post) : setup_postdata($post);
                                    $thumbnail = get_post_meta(get_the_ID(), 'thumbnail');
                                    //d($thumbnail);
                                    ?>
                                    <li>
                                        <a href="<?php the_permalink(); ?>"><img src="<?= $thumbnail[0] ?>" /></a>
                                        <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
                                    </li>
                                    <?php
                                endforeach;
                                wp_reset_postdata();
                                ?>
                            </ul>
                        </div>
                        <div class="cleared"></div>
                    </li>
    
                <?php endwhile; ?>
            </ul>
        <?php }
        ?>
    
    </div>
    

    webfacemedia
    Participant

    @webfacemedia

    @vapvarun : I’ve modified the code but none of the standard pagination links seem to work

        $user_id = bp_is_user() ? bp_displayed_user_id() : bp_loggedin_user_id();
        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
        $args = apply_filters('bp_show_friends_args', array(
            'user_id' => $user_id,
            'type' => 'active',
            'per_page' => 2,
            'paged' => $paged,
           // 'max' => $limit,
            'populate_extra' => 0
                )
        );

    webfacemedia
    Participant

    @webfacemedia

    Thanks for this. And where/how do I add the pagination links?

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar