Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • in reply to: Weird plus menu appearing? #63890
     BDecker19
    Participant

    Hmm… interesting. Here are two logins:

    goergia-rooney / oh3aoi2hoa (regular user)
    devuser / ahsdg78312ig23d (admin — manually created)

    it looks like maybe the issue may have to do with that custom function you’d (graciously 🙂 created for us previously to sync up Kleo avatar setting with our Loginradius social registration.

    ie

    COPY CODE
    // Avatar retrieval correction for LoginRadius fetch
    function kleo_menu_user_avatar( $item_output, $item, $depth, $args ) {
    
        $output = '';
    
        if ( is_user_logged_in() ) {
    
            $url = bp_loggedin_user_domain();
    
            $attr_title = strip_tags( $item->attr_title );
    
    			$output .= '<a title="' . bp_get_loggedin_user_fullname() . '" class="kleo-bp-user-avatar kleo-rounded-noborder kleo-avatar-menu' . ( $args->has_children && in_array($depth, array(0,1)) ? ' js-activated' : '' ) . '" href="' . $url . '" title="' . $attr_title .'">' . bp_get_loggedin_user_avatar(array('width' => 25, 'height' => 25)) . '</a>';
    		
            $output .= ( $args->has_children && in_array($depth, array(0,1))) ? ' <span class="caret"></span></a>' : '</a>';
    
            return $output;
        } elseif ( $args->has_children && in_array( $depth, array( 0, 1 ) ) ) {
            return $item_output;
        } else {
            return '';
        }
    }

    I can potentially play around with this a bit! (or if you have any ideas offhand 😉

    in reply to: Issue with search result types #49382
     BDecker19
    Participant

    Update, i’ve added the code below, and it seems to have mostly solved the problem:

    COPY CODE
    // Avoid page results in ajax search
    
    function filter_search($query) {
        if ($query->is_search) {
        	$query->set('post_type', array('post', 'event', 'product', 'topic'));
        };
        return $query;
    };
    add_filter('pre_get_posts', 'filter_search');
    

    Only issue now is with one of the post types (“Event”), it doesn’t seem to be displaying a header category — see screenshot. Is there any way I can adjust this? Or if there’s an alternative solution to the original problem, that works as well!

    Attachments:
    You must be logged in to view attached files.
    in reply to: Issue displaying image #48570
     BDecker19
    Participant

    Hmm… ok. So it looks like you’re overwriting kleo BP config file, changing the “output” within kleo_menu_user_avatar from:

    COPY CODE
      $output .= '<a title="' . bp_get_loggedin_user_fullname() . '" class="kleo-bp-user-avatar' . 
                ( $args->has_children && in_array($depth, array(0,1)) ? ' js-activated' : '' ) . '" href="' . $url . '" title="' . $attr_title .'">'
                    .  '<img src="' . bp_get_loggedin_user_avatar(array('width' => 25, 'height' => 25, 'html' => false)) . '" class="kleo-rounded" alt="">' . ($item->attr_title != '' ? ' ' . $item->attr_title : '');

    to:

    COPY CODE
    $output .= '<a title="' . bp_get_loggedin_user_fullname() . '" class="kleo-bp-user-avatar kleo-rounded-noborder kleo-avatar-menu' . 
                    ( $args->has_children && in_array($depth, array(0,1)) ? ' js-activated' : '' ) . '" href="' . $url . '" title="' . $attr_title .'">' . bp_get_loggedin_user_avatar(array('width' => 25, 'height' => 25)) . '</a>';

    Where the difference is you’re adding the extra classes (I guess just to ensure proper styling?) and then calling the bp_get_loggedin_user_avatar function, which it wasn’t previously.

    Is this all right?

    Thanks so much for your help here!

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

Log in with your credentials

Forgot your details?