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

  • Author
  • #9576
     frien337
    Participant

    Hello Seventh Theme,

    Can you let me know where the bit of code is that generates the match number? I would like to add the % symbol next to the number 🙂

    Thanks,
    Ryan

    #9685
     Abe
    Keymaster

    Hi, Function is named kleo_bp_compatibility_match and is found in wp-content\themes\sweetdate\custom_buddypress\bp-functions.php

    you can copy it to sweetdate-child/functions.php and modify it there to change default behaviour

    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.

    #9713
     frien337
    Participant

    Thanks Abe! 🙂

    #9767
     pmit
    Participant

    Thanks for the answer. Where do you Copy and paste this file to the sweetdate child theme? sorry dont understand.

    Thanks

    #9769
     frien337
    Participant

    I could be wrong, but I don’t think you can add the bp-functions.php file to a child theme. Instead, you should add the changes to your functions.php file in your child theme. I wanted to add the percentage sign next to the number in the match and this is what I added to my functions.php file in the child theme:


    /* PROFILE PAGE MATCH FEATURE - ADD PERCENTAGE */
    function kleo_bp_compatibility_match()
    {
    global $bp;
    if ( is_user_logged_in() && !bp_is_my_profile() ):
    echo '<div class="circular-item" title="'.__("Compatibility match", 'kleo_framework').'">';
    echo '<small class="icon strong">Match</small>';
    echo '<span class="greenCircle">' . compatibility_score($bp->loggedin_user->id,bp_displayed_user_id()) . '%</span>';
    echo '<span class="hearts"></span>';
    echo '</div>';
    endif;
    }

    I had to edit the css to re-align the number in the match circle. Add this to your style.css file in your child theme:


    .greenCircle {
    margin-top:27px !important;
    }

    There is probably a better way to do this, however, I had to settle on doing it this way because I am not good with PHP.

    #9827
     Abe
    Keymaster

    Hi, You can put the bp-functions.php in the child theme if you want but if you make small changes it is better to take only that function

    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 6 posts - 1 through 6 (of 6 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?