• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Pagination not work inside a buddypress profile tab

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Pagination not work inside a buddypress profile tab

This topic is: not resolved

Tagged: buddypress, pagination

  • This topic has 1 reply, 1 voice, and was last updated 9 years, 9 months ago by ggsalas.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 27, 2013 at 6:48 am #59032
    ggsalas
    Member

    Hi, 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/publicaciones
    August 27, 2013 at 9:31 am #59051
    ggsalas
    Member

    I 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

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble