This topic has 3 replies, 2 voices, and was last updated 10 years by Abe.

  • Author
  • #17061
     Adam
    Participant

    I have a custom version of this function in my functions.php and it’s wrapped with an !function_exists. So is the initial declaration in custom_buddypress/

    But there is a conflict:
    PHP Fatal error: Cannot redeclare kleo_bp_search_form_horizontal() (previously declared in […]/wp-content/themes/sweetdate-child/functions.php:528) in […]/wp-content/themes/sweetdate/custom_buddypress/kleo-bp-search.php on line 235

    Looks like my functions.php is actually being loaded first.

    How can I override the /sweetdate/custom-buddypress/ theme version of this function with my own in /sweetdate-child/functions.php and avoid this conflict?

    #17065
     Abe
    Keymaster

    Hi, add just the function without if function exist condition

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

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #22326
     Adam
    Participant

    Hey @abe, I get the redeclaration error with and without the ‘if exists’ wrapper.

    I was already re-declaring kleo_members_filter in order to add a search form expand/hide button, and it was executing kleo_bp_search_form_horizontal($mode), so the only way I was able to get this to work was to define my own mm_bp_search_form_horizontal() and call that instead..

    #22412
     Abe
    Keymaster

    @adam if you add your custom kleo_bp_search_form_horizontal function in the child theme you should not get this error since I see that where the function is defined it is wrapped in ! function_exists

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

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?