This topic has 6 replies, 2 voices, and was last updated 8 years by Radu.

  • Author
  • #131862
     jbf388
    Participant

    When trying to create a group getting:

    Fatal error: Call to a member function get_primary() on boolean in /home/…/public_html/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-bp-nav-backcompat.php on line 220

    Any ideas whats the issue?

    #131863
     jbf388
    Participant

    I figured out the issue was this code I added to functions.php to help with my groups social sharing:

    /**
    * Fix wpseo title
    */

    add_filter(‘wpseo_title’, ‘buddypress_wpseo_title’);

    function buddypress_wpseo_title($title) {
    $wpseo = WPSEO_Frontend::get_instance();
    $separator = $wpseo->options[‘separator’];

    $separator_options = array(
    ‘sc-dash’ => ‘-‘,
    ‘sc-ndash’ => ‘–’,
    ‘sc-mdash’ => ‘—’,
    ‘sc-middot’ => ‘·’,
    ‘sc-bull’ => ‘•’,
    ‘sc-star’ => ‘*’,
    ‘sc-smstar’ => ‘⋆’,
    ‘sc-pipe’ => ‘|’,
    ‘sc-tilde’ => ‘~’,
    ‘sc-laquo’ => ‘«’,
    ‘sc-raquo’ => ‘»’,
    ‘sc-lt’ => ‘< ‘,
    ‘sc-gt’ => ‘>’,
    );

    if (array_key_exists($separator, $separator_options)) {
    $separator = $separator_options[$separator];
    }
    $bp = buddypress();
    if (bp_is_user()) {
    $title = bp_get_displayed_user_fullname() . ‘ | ‘ . ucfirst($bp->current_component);
    } elseif (bp_is_group()) {
    $title = bp_get_current_group_name() . ‘ | ‘ . $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()][‘name’];
    }

    return $title;
    }

    Is there a way to fix this so that when groups are shared on social media they can see the group name, url and possible group image?

    #131945
     Radu
    Moderator

    Hi,

    There should be made an plugins integrations between buddypress and seo by yoast.

    I found this maybe it will helps you with other stuff : https://buddydev.com/buddypress/making-wordpress-seo-plugin-compatible-with-buddypress-part-2/

    Anyway i will add this idea to our improovment list we don’t have a quick solution to this.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #131965
     jbf388
    Participant

    Hi Radu

    The code that I added above which caused the error to happen after trying to create new groups, I found on this forum from a year ago: https://archived.seventhqueen.com/forums/topic/title-tags-for-groups-members-are-missing

    I am confused why I am having this problem because it seems ok on the demo:
    http://seventhqueen.com/themes/kleo/groups/the-social-network/

    Is there something different that the demo does that I am not?

    #132042
     Radu
    Moderator

    Hi,

    We are using this snippet

    COPY CODE
    
    / WP SEO /
    /**
     * Fix wpseo title
     */
    if ( function_exists( 'bp_is_active' ) ) {
    	add_filter('wpseo_title', 'kleo_bp_wpseo_title');
    }
     
    function kleo_bp_wpseo_title($title) {
    
    	global $bp;
    
        if (bp_is_user()) {
            $title = bp_get_displayed_user_fullname() . ' | ' . ucfirst($bp->current_component);
        } elseif (bp_is_group()) {
            $title = bp_get_current_group_name() . ' | ' . get_bloginfo('name');
        }	
     
        return $title; //. ' ' . $separator . ' ' . get_bloginfo()
    }
    

    Let me know if will fix the issue.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #132141
     jbf388
    Participant

    Thanks Radu this worked for both showing the group’s name in the tabs of my web browser and showing the group’s name when shared on social media (I am using the sassy social share plugin for sharing my BP groups).

    When shared it uses the og:image set on Yoast SEO > Social > Facebook

    It would be great if I could use the groups profile photo for the OG meta data instead of the one set on Yoast!

    Just an idea if you guys decide to implement better BP social sharing on the next Kleo update.

    Thanks again for the help!

    #132190
     Radu
    Moderator

    You’re welcome

    Thank you for your suggestions we will see in future.

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 7 posts - 1 through 7 (of 7 total)

The forum ‘Plugins questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?