Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * This file is used for listing the posts on profile
- */
- ?>
- <?php if ( buddyblog_user_has_posted() ): ?>
- <?php
- //let us build the post query
- if ( bp_is_my_profile() || is_super_admin() ) {
- $status = 'any';
- } else {
- $status = 'publish';
- }
- $paged = bp_action_variable( 1 );
- $paged = $paged ? $paged : 1;
- $query_args = array(
- 'author' => bp_displayed_user_id(),
- 'post_type' => buddyblog_get_posttype(),
- 'post_status' => $status,
- 'paged' => intval( $paged )
- );
- //do the query
- $gp_query = new WP_Query( $query_args );
- ?>
- <?php if ( $gp_query->have_posts() ) : ?>
- <?php get_template_part( 'lib/sections/filter' ); ?>
- <div class="gp-inner-loop <?php echo sanitize_html_class( ghostpool_option( 'ajax' ) ); ?>">
- <?php if ( $GLOBALS['ghostpool_format'] == 'gp-blog-masonry' ) { ?><div class="gp-gutter-size"></div><?php } ?>
- <?php while ( $gp_query->have_posts() ) : $gp_query->the_post(); ?>
- <?php get_template_part( 'post', 'loop' ); ?>
- <?php endwhile; ?>
- </div>
- <?php echo ghostpool_pagination( $gp_query->max_num_pages ); ?>
- <?php else : ?>
- <strong class="gp-no-items-found"><?php esc_html_e( 'No items found.', 'socialize' ); ?></strong>
- <?php endif; wp_reset_postdata(); ?>
- <?php
- wp_reset_postdata();
- wp_reset_query();
- ?>
- <?php elseif ( bp_is_my_profile() && buddyblog_user_can_post( get_current_user_id() ) ): ?>
- <p> <?php _e( "You haven't posted anything yet.", 'buddyblog' );?> <a href="<?php echo buddyblog_get_new_url();?>"> <?php _e( 'New Post', 'buddyblog' );?></a></p>
- <?php endif; ?>
Add Comment
Please, Sign In to add comment