Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 5 replies - 26 through 30 (of 30 total)
  • @becskr

    Participant

    By the way, the only thing that I changed was the parent slug

    @becskr

    Participant

    Yes that’s all in functions.php – don’t edit core files because when bp updates they will get overwritten.

    New code snippet:
    bp_core_new_subnav_item( array(
    ‘name’ => ‘Latest Club Posts’,
    ‘slug’ => ‘recent-posts’,
    ‘parent_url’ => $bp->root_domain.’/’.$bp->groups->slug.’/’.$bp->groups->current_group->slug.’/’,
    ‘parent_slug’ => bp_get_current_group_slug(),
    ‘screen_function’ => ‘show_blogs_from_club’,
    ‘position’ => 20 ) );

    Hope that helps :)

    @becskr

    Participant

    Thank you so much for helping me! It’s worked :)

    @becskr

    Participant

    Please help moderators! I am desperate for an answer…

    @becskr

    Participant

    I’m having problems with this too – but you shouldn’t be editing the core files as they’ll likely get over written. Please can someone advise me how to do this?

    My now defunct code:
    function new_group_items_setup_nav() {
    global $bp;
    bp_core_new_subnav_item( array(
    ‘name’ => ‘Latest Club Posts’,
    ‘slug’ => ‘recent-posts’,
    ‘parent_url’ => $bp->root_domain.’/’.$bp->groups->slug.’/’.$bp->groups->current_group->slug.’/’,
    ‘parent_slug’ => $bp->groups->slug,
    ‘screen_function’ => ‘show_blogs_from_club’,
    ‘position’ => 20 ) );

    bp_core_new_subnav_item( array(
    ‘name’ => ‘Events’,
    ‘slug’ => ‘events’,
    ‘parent_url’ => $bp->root_domain.’/’.$bp->groups->slug.’/’.$bp->groups->current_group->slug.’/’,
    ‘parent_slug’ => $bp->groups->slug,
    ‘screen_function’ => ‘show_events_from_club’,
    ‘position’ => 20 ) );

    }

    add_action( ‘wp’, ‘new_group_items_setup_nav’, 2 );
    function show_blogs_from_club() {

    //add title and content here – last is to call the members plugin.php template
    add_action( ‘bp_template_title’, ‘show_blogs_from_club_screen_title’ );
    add_action( ‘bp_template_content’, ‘show_blogs_from_club_screen_content’ );
    bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘groups/single/plugins’ ) );
    }

    function show_blogs_from_club_screen_title() {
    echo ‘My Page Title’;
    }
    function show_blogs_from_club_screen_content() {

    // page content goes here
    locate_template( array( ‘groups/single/blog-posts.php’ ), true );
    }

    function show_events_from_club() {

    //add title and content here – last is to call the members plugin.php template
    add_action( ‘bp_template_title’, ‘show_events_from_club_screen_title’ );
    add_action( ‘bp_template_content’, ‘show_events_from_club_screen_content’ );
    bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘groups/single/plugins’ ) );
    }

    function show_events_from_club_screen_title() {
    echo ‘My Page Title’;
    }
    function show_events_from_club_screen_content() {

    // page content goes here
    locate_template( array( ‘groups/single/events.php’ ), true );
    }
    add_action( ‘wp’, ‘new_group_items_setup_nav’, 2 );

Viewing 5 replies - 26 through 30 (of 30 total)
Skip to toolbar