Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'custom activity page'

Viewing 25 results - 326 through 350 (of 831 total)
  • Author
    Search Results
  • #240869
    danbp
    Participant
    #240512

    In reply to: Sponsored Ads

    danbp
    Participant

    @mecceo,

    you can also read the doc and try to modify the activity template to your need.

    https://codex.buddypress.org/template-updates-2-1/#activity-filter
    and search for similar topics:
    https://buddypress.org/support/search/custom+activity+page/

    Dono12
    Participant

    Yes it is related to “Messages > Starred”. There is nothing wrong with the new feature. It’s this function that I found online that’s causing a conflict.

    /* ——————————Start BP Post in profile code for function——————– */
    function importSomething(){
    return include_once ‘bp-custom.php’;
    }
    add_action( ‘bp_setup_nav’, ‘buddyboss_child_bp_nav_adder’ );
    add_action( ‘bp_template_content’, ‘profile_buddyboss_child_loop’ );
    bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );

    function buddyboss_child_bp_nav_adder() {
    global $bp;
    $post_count = count_user_posts_by_type( $bp->displayed_user->id );
    bp_core_new_nav_item(
    array(
    ‘name’ => sprintf( __( ‘Posts <span>%d</span>’, ‘my-poems’ ), $post_count ),
    ‘slug’ => ‘Articles’,
    ‘position’ => 250,
    ‘show_for_displayed_user’ => true,
    ‘screen_function’ => ‘buddyboss_child_list’,
    ‘item_css_id’ => ‘articles’,
    ‘default_subnav_slug’ => ‘public’
    ));
    }
    function buddyboss_child_list() {
    add_action( ‘bp_template_content’, ‘profile_buddyboss_child_loop’ );
    bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
    }
    /*——- This is end of the code for above function ———*/
    function profile_buddyboss_child_loop() {
    $myposts = get_posts( array(
    ‘posts_per_page’ => -1,
    ‘author’ => bp_displayed_user_id(),
    ‘post_type’ => ‘post’
    ));
    if( ! empty($myposts) ) {
    foreach($myposts as $post) {
    setup_postdata( $post );
    if (has_post_thumbnail( $post->ID ) ):
    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘sidebar-smallthumbnew’ );
    else :
    $image[0] = “…/wp-content/themes/Starkers-Child-2/images/vidimage.jpg”;
    endif;
    echo ‘<li class=”sidebar mostpop post-‘ . $post->ID . ‘”><div id=”postimage”>ID) . ‘”></div><div id=”postinfo”>ID) . ‘”>’ . get_the_title($post->ID) . ‘</div>‘;
    }
    echo ‘‘;
    wp_reset_postdata();
    } else { ?>
    <div class=”info” id=”message”>
    <p><?php bp_displayed_user_fullname(); ?> has No posts.</p>
    </div>
    <?php }
    }
    /* This is end of the code for above function */
    remove_filter(‘bp_setup_nav’,”);
    function count_user_posts_by_type( $userid, $post_type = ‘post’ ) {
    global $wpdb;
    $where = get_posts_by_author_sql( $post_type, true, $userid, true);
    $count = $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->posts $where” );
    return apply_filters( ‘get_usernumposts’, $count, $userid );
    }
    /* ——————————This is end of the code for post in profile above function——————– */

    It adds a new button on the user activity page and when the Message-Starred button is clicked it takes the user the lists of post page that the above function creates. How can I stop that fro happening. I really want to keep the starred message function and I don’t want to lose the lists of WordPress post in the user Activity page.

    #239695
    majecdad
    Participant

    First, @henrywright, I think you were right, that code was not creating the entry, it was created because I had add_post_type_support( 'alert', 'buddypress-activity' ); in bp-custom too. Thanks for making me think twice.

    It’s amazing what you can learn in 12 hours. Not enough, but it’s a start. So I tossed the baby out with the bathwater, and read this about 15 times to get to a partial understanding of it. I am now using this:

    // Don't forget to add the 'buddypress-activity' support!
    add_post_type_support( 'alert', 'buddypress-activity' );
     
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'alert', array(
            /*'component_id'             => buddypress()->blogs->id,*/
            'action_id'                => 'new_alert',
            'bp_activity_admin_filter' => __( 'Published a new alert', 'buddypress' ),
            'bp_activity_front_filter' => __( 'Alerts', 'buddypress' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted an important new <a href="%2$s">** Alert **</a>', 'buddypress' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">alert</a>, on the site %3$s', 'buddypress' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_page_tracking_args' );

    After about 20 different mods, adding and deleting and changing, I got a CPT to take to the activity stream, with the (mostly) modified text I was looking for.

    I actually don’t even know what some of the items in the array are, I just changed things until they worked. 🙂 In fact, I had to comment out component id, because I still haven’t figured out what goes there to keep from getting a WSOD.

    The only main thing I’d really still like to accomplish is getting the Post Title in the link that is created here: '%1$s posted an important new <a href="%2$s">** Alert **</a>' — where it would be like “soandso posted an important new Alert:The Title of the CPT”

    Any ideas out there?

    If this is still not the right/best way to accomplish this, I’m open to suggestion. But I think I am at least stepping in the right direction.

    Thanks.

    #239409

    In reply to: Change "activity" slug

    danbp
    Participant

    3 mounth later….
    just tested the defines and they’re working ! You have a cote error in above code. 😉

    Try this:
    define( 'BP_ACTIVITY_SLUG', 'activitissima' );

    Remind also that BP’s activity page, defined in BP settings, must be empty, without shortcodes, template or page model. Just a title. These pages are dynamic, not static like normal WP pages.
    If you need to modifiy it, use a template override.

    If you still want to understand, please read here:
    https://buddypress.org/support/topic/changing-slugs-with-bp-custom-php-no-change/

    #239405

    In reply to: Change "activity" slug

    milenushka
    Participant

    this one is still uresolved.


    @danbp
    (https://buddypress.org/support/topic/custom-activity-slug/)
    custom slug change for ACTIVITY does not work for me.

    To change slugs on the sub nav on a member page add these defines to a file bp-custom.php and place this file in /plugins/bp-custom.php

    ?
    1
    2
    define( ‘BP_SETTINGS_SLUG’, ‘settings’ );
    define( ‘BP_XPROFILE_SLUG’, ‘profile’ );

    #239126
    producist
    Participant

    I just tried adding the snippets and again and that problem isn’t happening anymore. However, the filter functionality isn’t working…

    See Screenshot —

    http://postimg.org/image/5ulodg0wz/

    Here’s the code I used….

    <?php
    // hacks and mods will go here ok
    
    // Don't forget to add the 'buddypress-activity' support!
    add_post_type_support( 'page', 'buddypress-activity' );
     
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'page', array(
            'component_id'             => buddypress()->blogs->id,
            'action_id'                => 'new_blog_page',
            'bp_activity_admin_filter' => __( 'Published a new page', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Pages', 'custom-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">page</a>', 'custom-textdomain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">page</a>, on the site %3$s', 'custom-textdomain' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_page_tracking_args' );
    
    ?>

    Is there anything I need to add or change in the above code in order to make PAGES show in the filter area?

    #239042
    shanebp
    Moderator

    You can place this in your theme/functions.php or in bp-custom.php.

    It will stop recording entries for 3 types after you include the function.
    You can add other types as desired to the $exclude array.

    function steve_dont_save_activity( $activity_object ) {
     
        $exclude = array( 'new_avatar', 'updated_profile', 'friendship_created' );
     
        if( in_array( $activity_object->type, $exclude ) )
            $activity_object->type = false;
     
    }
    add_action('bp_activity_before_save', 'steve_dont_save_activity', 1, 1 );

    To delete existing entries, use the interface here
    [yoursite]/wp-admin/admin.php?page=bp-activity

    #238987
    producist
    Participant

    I also saw this about multisite installs in the thread you posted:

    “On multisite configurations, the post types that are registered on any sub-site will need to be registered on the root site in order to be listed in the Activity dropdown filters. That’s the case for the post and page post types”

    The site I’m trying to create a custom post type for is a subsite. I assume the Page Post Type is registered for the root install, so this shouldn’t be causing the problem right?

    #238324
    danbp
    Participant

    Previous snippet changed all avatars (user, blogs and groups) which is not what you want. Here’s a snippet which works almost correctly, but not to 100%. Give it a try anyway.

    It changes the user avatar depending of an xprofile value.

    (add to bp-custom.php)

    function bpfr_my_new_avatar_url() {
    global $bp;
    
    	if( bp_is_user() && ! bp_get_member_user_id() ) {
            $user_id = bp_displayed_user_id();
        } else {
            $user_id = bp_get_member_user_id();
        }
    
    	if ( is_page( 'activity' ) ) {
    		$user_id = bp_get_activity_user_id();	
    	}
    
    $ranking = xprofile_get_field_data ('ranking', $user_id );
    
    	if ($ranking == "Top 25") {		
    		$url = get_stylesheet_directory_uri() .'/custom_img/25.png';
    	}
    	
    	if ($ranking == "Top 24") {		
    		$url = get_stylesheet_directory_uri() .'/custom_img/24.png';
    	}
    return $url;
    
    }
    add_filter( 'bp_core_default_avatar_user', 'bpfr_my_new_avatar_url' );
    

    Create a profile field called “ranking” with 2 options (top 24 & top 25).
    Create a folder in your child-theme called “custom_img” and add 2 pictures: 24.png & 25.png (250×250)
    If everybody must those avatars, disallow avatar upload in BP settings.
    Site default avatar stays as Mystery Man (wp default setting).

    You have also to get rid of Gravatar, so you must add this to bp-custom.php
    add_filter('bp_core_fetch_avatar_no_grav', '__return_true');

    The thing who doesn’t work is related to X & Y are now friends. Both willhave the same avatar.

    Can probably by better improved.

    #237964

    In reply to: activity

    danbp
    Participant

    Hi,

    to show only notices (aka updates) on the SWA, try this snippet (place in bp-custom.php)

    function make_swa_show_notice_only( $retval ) {	
    	
    	if ( bp_is_page( 'activity' ) ) {
    	$retval['action'] = 'activity_update';					
    	}
    	
    	return $retval;
    	
    	}
    add_filter( 'bp_after_has_activities_parse_args', 'make_swa_show_notice_only' );

    Reference: https://codex.buddypress.org/developer/using-bp_parse_args-to-filter-buddypress-template-loops/

    #237873
    shanebp
    Moderator

    You want to add a ‘Personal’ option to the ‘Show’ selector on Site Wide Activity?

    Try this in your theme/functions.php or in bp-custom.php

    function leanne_activity_filter_options() {
        if ( is_user_logged_in() )
             echo '<option value="personal">Personal</option>';
    }
    add_action( 'bp_activity_filter_options', 'leanne_activity_filter_options' );
    
    function leanne_ajax_querystring( $query_string, $object ) {
    
    	if ( 'activity' != $object ) 
    		return $query_string;
    
    	if ( ! bp_is_activity_directory() ) 
    		return $query_string;
    
    	$query_args = wp_parse_args( $query_string, array() );
    
     	$page = $query_args['page'];
    
    	if( isset( $query_args['action'] ) && $query_args['action'] == 'personal' ) {
    	
    		$query_args = array();
    		$query_args['page'] = $page;
    		$query_args['user_id'] = bp_loggedin_user_id();
    		$query_string = http_build_query( $query_args );
    
    	}
    	
    	return $query_string;
    
    }
    add_filter( 'bp_ajax_querystring', 'leanne_ajax_querystring', 20, 2 );
    Garydock
    Participant

    I’m not sure if this is valuable information. I’ve used firebug to try and locate a file where I can remove this or something and this is all I can see but I don’t know if its related. I just want to remove this warning whatever way possible, everything else seems to all be working ok. activity bp-user my-activity my-account just-me buddypress page page-id-0 page-parent page-template-default logged-in custom-background js woocommerce.

    #237701
    aaronkine
    Participant

    Yes… the post type is registered by another plugin “Wp Job Manager”. I am new at coding so if i find a script and it actually works “i use it” even though there may be a more correct way.

    I also have another plugin “The Events Calendar” that has post type of ‘tribe_events’ and i am trying to do the same thing as the Job post type.

    I also don’t understand the difference between using “text-domain” and “custom-domain” for the bp_activity_admin_filter ?

    I used info from this Topic/Discussion here: https://buddypress.org/support/topic/cant-seem-to-get-bp-2-2s-post-types-activities-working/

    Here is my full code in bp-custom for Jobs and Events post types…

    //The 'WP Job Manager' post type
    add_post_type_support( 'job_listing', 'buddypress-activity' );
    
    function customize_page_tracking_args_job() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'job_listing', array(
    			'component_id' => 'activity',
            'action_id'                => 'new_job_listing',
            'bp_activity_admin_filter' => __( 'Published a new Job', 'text-domain' ),
            'bp_activity_front_filter' => __( 'Job', 'text-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new Job: <a href="%2$s">Job</a>', 'text-domain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new Job: <a href="%2$s">Job</a>, on the site %3$s', 'text-domain' ),
            'position'                 => 100,
        ) );
    }
    //'The Calednar Events' post type 
    add_action( 'init', 'customize_page_tracking_args_job', 999 );
    
    add_post_type_support( 'tribe_events', 'buddypress-activity' );
    
    function customize_page_tracking_args_event() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'tribe_events', array(
    			'component_id' => 'activity',
            'action_id'                => 'new_tribe_events',
            'bp_activity_admin_filter' => __( 'Published a new Event', 'text-domain' ),
            'bp_activity_front_filter' => __( 'Event', 'custom-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted an Event: <a href="%2$s">Event</a>', 'custom-domain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted an Event: <a href="%2$s">Event</a>, on the site %3$s', 'custom-domain' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args_event', 999 );
    
    #237624
    aaronkine
    Participant

    @imath thanks for the above code which “adds the post type title into the link in replacement”

    But i need to change one small thing in that code but i dont know how.

    Here is my code in bp-custom.php —

    add_post_type_support( 'job_listing', 'buddypress-activity' );
    function customize_page_tracking_args_job() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'job_listing', array(
    			'component_id' => 'activity',
            'action_id'                => 'new_job_listing',
            'bp_activity_admin_filter' => __( 'Published a new Job', 'text-domain' ),
            'bp_activity_front_filter' => __( 'Job', 'text-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new Job: <a href="%2$s">Job</a>', 'text-domain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new Job: <a href="%2$s">Job</a>, on the site %3$s', 'text-domain' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args_job', 999 );
    

    Here is the result…
    PathPoint-SSB posted a new Job: Job 5 hours, 53 minutes ago

    Here is what it looks like after I use your code to insert the Title of the Job
    pathpoint posted a new Receptionist/Administrative Assistant 5 hours, 49 minutes ago

    As you can see, it changes the Users name and also I cant change this part “posted a new”. I would like it to read “posted a new Job: ”

    Any ideas?

    Thanks for any insight on this,
    Aaron

    #237459
    danbp
    Participant

    Hi @andrew55,
    add this snippet to bp-custom.php. Now you can use shortcode [profilo] in any blog post, blog comment, page and BP notice. Note that activity walls are stripped, the shortcode will not work/appear there.

    For bbPress topics and replies, use this plugin. Read the doc, as you’ll have to check user capacity to get it to work for participant.

    function bpfr_link_to_profile() {	
    
    	return ' <a href="'. bp_get_loggedin_user_link() .'">View my profile</a>';			
    }
    add_shortcode( 'profilo', 'bpfr_link_to_profile' );
    add_filter( 'comment_text', 'do_shortcode' );
    #237370
    Roger Coathup
    Participant

    Changing these titles isn’t the easiest thing, but BuddyPress does provide 2 ways you can do it. However, hacking core files like bp-activity-loader.php is definitely not one of them. [Never hack core files — have a Google if it’s not obvious to you why you shouldn’t]

    Ok the 2 solutions are:

    1. Use a language / translation file
    2. Use the template hierarchy

    The string “Site-Wide Activity” is translatable — all the strings are. You can implement a language file that translates ‘Site-Wide Activity’ into whatever string you’d like. Have a search for translating BuddyPress strings / POT files / poedit. There’s also a documentation (they call it the Codex) page on it: https://codex.buddypress.org/getting-started/customizing/customizing-labels-messages-and-urls/

    The second solution is to use the template hierarchy. If you don’t provide a specific template for your activity directory, BuddyPress will use the page.php file from your theme and ‘inject’ the title “Site-Wide Activity” where page.php makes a call to the_title().

    You can override this by implementing your own template — create a file called index-directory.php inside /buddypress/activity in your site’s theme. Copy the basics of page.php into that file, and replace the_title() with your hardcoded title for the page.

    You can read more about the template hierarchy here: https://codex.buddypress.org/themes/theme-compatibility-1-7/template-hierarchy/

    Neither solution is simple, you’ll either have to get your head around using poedit, or need some basic PHP coding skills and an understanding of the principles of templates and themes in WordPress. In the future, it would be nice to see a settings panel in wp-admin to configure these basic strings.

    [p.s. if you don’t want to use poedit, you could take a look at plugin solutions for string translation, e.g. codestyling localisation]

    #237066
    IHaveToDoThis
    Participant

    Hey,

    I’m a newcomer to all of this and I can’t answer your overall question, but I can tell you how to change the name “Site-Wide Activity” on the activity page. You go to: wp-content>plugins>buddypress>bp-activity/bp-activity-loader.php and the title is towards the top the in $GLOBAL array. And you can change it from “Site-Wide Activity” to whatever you want.

    I’ll be following this tho. I’ve been looking for way to customize my BP wall and make it look not so bland. I hope someone else can help you further!

    #236465
    danbp
    Participant

    hi @mjc82in,

    BuddyPress is continuously evolving. 2 years back it was a mess trying to use CPT on SWA. That’s no more the case with BP 2.2

    Maybe this example will help you. It creates a CPT called Music which will show up on the SWA where you can comment it.

    Add the code to bp-custom.php

    // allow tracking of our CPT
    add_post_type_support( 'music', 'buddypress-activity' );
    
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'music', array(
            'component_id'             => 'activity',
            'action_id'                => 'new_music',
            'bp_activity_admin_filter' => __( 'Published a new music', 'text-domain' ),
            'bp_activity_front_filter' => __( 'Music', 'text-domain' ),
    			'contexts'                 => array( 'activity', 'member' ),
    			'activity_comment'         => true,
    			'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">Music</a>', 'text-domain' ),
    			'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">Music</a>, on the site %3$s', 'text-domain' ),
    			'position'                 => 800,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args', 999 );
    
    function bpfr_create_post_type() {
      register_post_type( 'music',
        array(
          'labels' => array(
            'name' => __( 'Music', 'text-domain' ),
            'singular_name' => __( 'Music', 'text-domain' )
          ),
          'public' => true,
          'has_archive' => true,
        )
      );
    }
    add_action( 'init', 'bpfr_create_post_type' );

    Ref: https://codex.buddypress.org/plugindev/post-types-activities/

    #236437
    Manoj Chacko
    Participant

    Did do that,

    I also enabled below for pages, but pages dont show up.

    // Add custom post type to activity record
    add_filter ( ‘bp_blogs_record_post_post_types’, ‘activity_publish_custom_post_types’,1,1 );
    // Add custom post type comments to activity record
    add_filter ( ‘bp_blogs_record_comment_post_types’, ‘activity_publish_custom_post_types’,1,1 );

    function activity_publish_custom_post_types( $post_types ) {
    // add any custom post-type here
    $post_types[] = ‘page’;
    return $post_types;
    }

    #236414
    IHaveToDoThis
    Participant

    Hey Everyone,

    I still haven’t found out how to save edits in chrome inspector or how to customize my wall more…BUT I did find out how to do what was most important to me, which is change the text ‘Site-Wide Activity’ on the activity stream page. I found the solution here on a forum through a google search. Unfortunately I was on a work computer and left before copying the link and now of course I can’t find that forum anymore. Thank god I wrote it down!

    Anywho, you find it in: wp-content>plugins>buddypress>bp-activity/bp-activity-loader.php and its toward the top the in $GLOBAL array.

    Thanks to the stranger who found this!

    And any help on how to design or what files to mess with to play the design of the activity stream is greatly appreciated!

    rosyteddy
    Participant

    works the same way for me – you only get about 4 lines of the comment in the AS. I think only for Activity Updates there is a ‘More’ link.

    True – I missed that. Long comments are truncated with […] at the end and that does not link to the original comment. W.r.t usability that is a critical bug for me. Thanks

    activity entry for that comment does link directly to the post comment using the page anchor

    It does not – default install of WP,BP latest versions, default theme – it does not for me. Any demo link with latest WP and BP that does this? Thanks

    WAIT : […] does not link to, there is no ‘more’ link that does this BUT the time stamp does this. So I think UI and Userfriendiless tea should link […] to the same link as the time-stamp. Most users are accustomed with ‘more’ or ‘…’ – they won’t know they have to click time-stamp. Please submit an enhancement request. Thanks

    #236020
    danbp
    Participant

    Recently introduced function bp_parse_args allows since 2.0 to modify easely your templates. Faster and lighter than a plugin.

    Using bp_parse_args() to filter BuddyPress template loops

    As example, show only updates on the SWA (add snippet to bp-custom.php or child-theme functions.php)

    function make_swa_show_notice_only( $retval ) {	
    	
    	if ( bp_is_page( 'activity' ) ) {
    	$retval['action'] = 'activity_update';					
    	}
    	
    	return $retval;
    	
    	}
    add_filter( 'bp_after_has_activities_parse_args', 'make_swa_show_notice_only' );
    #236006
    MonkimoE
    Participant

    Hi.. thank you to keep guiding me.
    I don’t know why those code for single groups page doesn’t working in my site.

    Then I tried to modify nav tab in single members page those can working good.
    This what I have in bp-custom.php:

    <?php
    function edit_tabs_options() {
        global $bp;
    // MODIFY GROUP TABS
    $bp->bp_options_nav['groups']['home']['name'] = 'Group Activity'; //NOT WORK
    $bp->bp_nav['groups']['home']['name'] = 'Member Activity 2'; //NOT WORK
    
    //MODIFY MEMBERS TABS
    $bp->bp_nav['home']['name'] = 'Member Activity'; //IT'S WORK
    bp_core_remove_nav_item( 'forums' ); //IT'S WORK
    bp_core_remove_subnav_item( 'profile', 'change-avatar' ); //IT'S WORK
    
    }
    add_action( 'bp_setup_nav', 'edit_tabs_options' );
    ?>

    Last try on fresh install wp + bp with default theme. I will let you know if those code works or not.

    danbp
    Participant

    Both snippets are working. If really not for you, double-check that bp-custom.php is correctly using open/close php tags and if your theme doesn’t use some custom rss functions.

    To remove the All members button :
    remove line 19 in buddypress/activity/index.php from within your child theme.

    
    <li class="selected" id="activity-all"><a href="<?php bp_activity_directory_permalink(); ?>" title="<?php esc_attr_e( 'The public activity for everyone on this site.', 'buddypress' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li>

    and add class='selected' to the li containing friends item

    If you remove the feeds display using the snippet, people won’t see anything even if they know the page url. And if this is not satisfying for you, you can write a rewrite rule to add to htaccess.

Viewing 25 results - 326 through 350 (of 831 total)
Skip to toolbar