Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)

  • Jonas
    Participant

    @jonaskjodt

    Ah alright, my mistake 🙂


    Jonas
    Participant

    @jonaskjodt

    I had some issues with this earlier too, using the code supplied in this thread should clear up your issue.

    Here’s the code if you’re unable to click the link for some reason. You should put it in your bp-custom.php file.

    function toa_check_page_reqiurement_and_lie_to_buddypress ($is, $component) {
        global $bp;
        if ($is || "activity" !== $component) return $is;
        if ((defined('BP_GROUPS_SLUG') && bp_is_groups_component() && 'activity' == $bp->current_action)){
            return true;
        }
        return $is;
    }
    function toa_setup_activity_filter () {
        add_filter('bp_is_current_component', 'toa_check_page_reqiurement_and_lie_to_buddypress', 10, 2);
    }
    function toa_teardown_activity_filter () {
        remove_filter('bp_is_current_component', 'toa_check_page_reqiurement_and_lie_to_buddypress', 10);
    }
    add_action('bpfb_init', 'toa_setup_activity_filter');
    add_action('bpfb_add_cssjs_hooks', 'toa_teardown_activity_filter');

    Jonas
    Participant

    @jonaskjodt


    Jonas
    Participant

    @jonaskjodt

    There’s different ways of solving it, you can look to this old post for some pointers.

    or you could do something like this

    <?php
    function opengraph_tags() {
        // defaults
        $title = get_bloginfo('title');
        $excerpt = get_bloginfo('description');
    
        if( bp_current_component() ) {
            global $post;
            setup_postdata( $post);
            $title = get_the_title();
            $excerpt = get_the_excerpt();
            if ($excerpt) {
                $excerpt = strip_tags($excerpt);
                $excerpt = str_replace("", "'", $excerpt);
            }
        } ?>
            
        <meta name="description" content="<?php echo $excerpt; ?>"/> <!-- general meta tag -->
        <meta property="og:title" content="<?php echo $title; ?>"/> <!-- facebook meta tag -->
        <meta property="og:description" content="<?php echo $excerpt; ?>"/> <!-- facebook meta tag -->
        <meta name="twitter:title" content="<?php echo $title; ?>"> <!-- twitter meta tag -->
        <meta name="twitter:description" content="<?php echo $excerpt; ?>"> <!-- twitter meta tag -->
    
    <?php }
    add_action('wp_head', 'opengraph_tags', 5);

    You’d then be able to write the description of the buddypress page in the excerpt input while editing whatever Buddypress page. This only solves the main pages though.

    If you’d like to go further for group, member and activity SEO you’d have to follow it up with some more code.


    Jonas
    Participant

    @jonaskjodt

    You could try something like this

    add_filter( 'bp_user_can_create_groups', 'create_groups_hide_for_roles' );
    function create_groups_hide_for_roles($can)
    	{
    	$user = wp_get_current_user();
    	$banned_roles = array(
    		'subscriber',
    		'editor' // fill in the roles who can't make groups
    	);
    	if (array_intersect($banned_roles, $user->roles))
    	{
    		return false;
    
    	} else {
    
    		return $can;
    	}
    }

    Edit the roles in the array as you see fit.


    Jonas
    Participant

    @jonaskjodt

    Digging into it a bit more, it seems gravatars influences it. You can disable the gravatars like so

    add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );

    followed by using your original code

    define ( 'BP_AVATAR_DEFAULT', 'http://example.com/default-avatar.jpg' );
    define ( 'BP_AVATAR_DEFAULT_THUMB', 'http://example.com/default-avatar-thumb.jpg' );

    Jonas
    Participant

    @jonaskjodt

    You could probably do something like the following to achieve it as well

    function hanza3_add_default_avatar( $url ){
    	return get_stylesheet_directory_uri() .'/images/imagename.jpg';
    }
    add_filter( 'bp_core_mysteryman_src', 'hanza3_add_default_avatar' );

    Jonas
    Participant

    @jonaskjodt

    You could give Iframely a shot, it should convert any useful link into a rich snippet embedded post.


    Jonas
    Participant

    @jonaskjodt


    Jonas
    Participant

    @jonaskjodt

    Your time stamps looks correct, I’m guessing you mean the Danish translation isn’t working correctly?

    You can grab the newest Danish Buddypress translation here https://translate.wordpress.org/locale/da/default/wp-plugins/buddypress followed by merging your current buddypress-da_DK.po file in poedit like this http://www.marketpressthemes.com/blog/how-to-merge-two-po-files-using-poedit/, translate the words you needs to translate, save it as both buddypress-da_DK.po and buddypress-da_DK.mo – and reupload it to your server in your language folder.


    Jonas
    Participant

    @jonaskjodt

    Right now you have 62 external Javascript scripts and 35 external stylesheets, thats quite excessive. You can see how it impacts your website by making a test through gtmetrix ( https://gtmetrix.com/reports/isociali.com/LjIWHWX5 click on waterfall )

    There are loads of ways to speed your site up, its all in minimizing the transactions from server->user. To start it out, you could combine your js and stylesheets into one, defer the js files and not loading scripts on pages where its not needed. For instance, on your members page, you probably dont need to load your contact7 plugin etc..

    If you have no clue about optimizing your website, you could always install the autoptimize plugin. It combines all your js and css files into one to start off your optimizing adventure.


    Jonas
    Participant

    @jonaskjodt

    like Henry mentioned, you can use the bp_parse_args. You could do the following to achieve it:

    // Activity stream -> friends only

    function my_friends_only_activity_args( $args ) {
        
        if( ! bp_is_activity_directory() || !  is_user_logged_in() ) {
            return $args;
        }
        
        $user_id = get_current_user_id();
        
        $user_ids = friends_get_friend_user_ids( $user_id );
        
        array_push( $user_ids, $user_id );
        
        $args['user_id'] = $user_ids;
        
        return $args;
     
    }
    add_filter( 'bp_after_has_activities_parse_args', 'my_friends_only_activity_args' );

    Jonas
    Participant

    @jonaskjodt

    Hi,

    you can control whether or not to show the alerts through their css classes.

    I’m guessing you’ve copyied Buddypresses way of notification alerts to your own template’s custom header, something like this svn.buddypress.org/branches/2.0/bp-notifications/bp-notifications-adminbar.php

    0 notifications is governed through the .no-alert class – and whenever more than 1 notification is shown, it’ll have the .alert class.

    So you could do something as as simple as writing .no-alert {display:none} in your css stylesheet.

Viewing 13 replies - 1 through 13 (of 13 total)
Skip to toolbar