BuddyDev

Search

Error in breadcrumb script bp-custom.php

  • Participant
    Level: Master
    Posts: 152
    Hugo Callens on #19616

    I added breadcrumbs to my Buddypress pages using a script you provided, but this gives an error when trying to create new groups:
    Fatal error: Call to a member function get_secondary() on null in /home/mydomain/wp-content/plugins/bp-custom.php on line 245.

    This is my bp-custom.php: https://www.dropbox.com/s/u5kzu3fj3dbkyz0/bp-custom.php?dl=0

    Please help me fix this. Thank you!

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #19629

    Hi Hugo,
    I am sorry, I haven’t seen this error before. You may put change this line

    $nav_items = buddypress()->groups->nav->get_secondary( array( 'parent_slug' => $group_slug ) );
    

    to

    
    $nav_items = isset( buddypress()->groups->nav ) ? buddypress()->groups->nav->get_secondary( array( 'parent_slug' => $group_slug ) ) : array();
    

    Please let me know if it works or not?

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved