-
Author
-
August 10, 2016 at 01:23 #131862jbf388Participant
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?
August 10, 2016 at 01:48 #131863jbf388ParticipantI 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?
August 10, 2016 at 19:25 #131945RaduModeratorHi,
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 solutionAugust 10, 2016 at 23:14 #131965jbf388ParticipantHi 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?
August 11, 2016 at 16:27 #132042RaduModeratorHi,
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 solutionAugust 12, 2016 at 02:51 #132141jbf388ParticipantThanks 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!
August 12, 2016 at 16:48 #132190RaduModeratorYou’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 -
AuthorPosts
The forum ‘Plugins questions’ is closed to new topics and replies.