Community Forums › Forums › Archived Forums › General Discussion › Pagination not work inside a buddypress profile tab
Tagged: buddypress, pagination
- This topic has 1 reply, 1 voice, and was last updated 13 years, 1 month ago by
ggsalas.
-
AuthorPosts
-
August 27, 2013 at 6:48 am #59032
ggsalas
MemberHi, I like show posts in a buddypress profile tab: http://www.redminka.com/usuarios/gabriel/publicaciones/
This is the code I use:
// NAV // name, slug, screen, position, default subnav bp_core_new_nav_item( array( 'name' => __( 'Publicaciones', 'buddypress'), 'slug' => 'publicaciones' , //'screen_function' => 'funcion_tab_publicaciones', 'position' => 40, 'default_subnav_slug' => 'todas', ) ); // SUBNAV // name, slug, parent_url, parent slug, screen function bp_core_new_subnav_item( array( 'name' => __( 'Todas', 'buddypress' ), 'slug' => 'todas', 'parent_url' => $bp->displayed_user->domain . 'publicaciones/' , 'parent_slug' => 'publicaciones', 'screen_function' => 'funcion_tab_publicaciones' ) ); bp_core_new_subnav_item( array( 'name' => __( 'Borradores4', 'buddypress' ), 'slug' => 'borradores', 'parent_url' => $bp->displayed_user->domain . 'publicaciones/' , 'parent_slug' => 'publicaciones', 'user_has_access' => ( bp_is_my_profile() || is_super_admin() ), 'screen_function' => 'funcion_tab_borradores' ) ); } function funcion_tab_publicaciones() { //add title and content here - last is to call the members plugin.php template add_action( 'bp_template_content', 'funcion_tab_publicaciones_content' ); bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) ); } function funcion_tab_publicaciones_content() { global $post; global $paged; // current paginated page $curpage = $paged ? $paged : 1; // arguments, adjust as needed $args = array( 'post_type' => 'post', 'posts_per_page' => 4, 'post_status' => 'publish', 'author' => bp_displayed_user_id(), 'paged' => $paged ); global $wp_query; $wp_query = new WP_Query( $args ); do_action('genesis_loop'); wp_reset_query(); } add_action( 'bp_setup_nav', 'my_test_setup_nav' );My problem is that pagination give me a 404 error: http://www.redminka.com/usuarios/gabriel/publicaciones/page/2/
Thanks
http://www.redminka.com/usuarios/gabriel/publicacionesAugust 27, 2013 at 9:31 am #59051ggsalas
MemberI have found the probem, Is the first subtab:
The URL of the tab is http://www.redminka.com/usuarios/gabriel/publicaciones/
by default opens a subtab: "Todas"
but without the real url: http://www.redminka.com/usuarios/gabriel/publicaciones/todas/
The pagination works with the "real" URL: http://www.redminka.com/usuarios/gabriel/publicaciones/todas/page/2/
How can resolve the "real" URL of the submenu tab of Buddypress?
Thanka
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.