Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_has_members filter type=online is not working

  • i am going to show the online members list by filtering
    if ( bp_has_members( ‘type=online&per_page=30’) ){

    }

    but in my dev server the type=online is working when i moved to live the type=online is not working any more whether all other options :: active, newest, popular, alphabetical, random works only ‘online’ options is not working .
    What may be the cause can you please share idea if you have any.

Viewing 7 replies - 1 through 7 (of 7 total)
  • its all working on localhost and d v server but when it implemented on live its not working at all with type=online
    its strange
    Please help if anyone have any ideas about it.

    Thank you

    `
    <?php
    /*
    Template Name: Who is online
    */
    ?>

    <?php
    get_header();

    if ( bp_has_members(‘type=online&per_page=30’)) : ?>

    • <a href="”>

      <?php
      $image_status=””;
      if(is_user_online(bp_get_member_user_id())){
      //$user_info = get_userdata($postcontent);
      $image_status= ‘

      Online

      ‘;
      }
      else {$image_status= ‘

      Offline

      ‘;}
      echo $image_status;
      ?>
      <a href="”>

      <?php
      /***
      * If you want to show specific profile fields here you can,
      * but it’ll add an extra query for each member in the loop
      * (only one regadless of the number of fields you show):
      *
      * bp_member_profile_data( ‘field=the field name’ );
      */
      ?>

    `

    The same templates works locally and dev server but its does not seems work on live server. strange

    Gosh. Why do you have that load wp-config.php bit at the top of the file? That’s a big red flag immediately. Are you doing something unusual to include this file into your site?

    Ok look now i have edited the templates

    Hello @Paul Gibbs can you give some advice what may be the issues here.

    Thank you


    darrenmeehan
    Participant

    @darrenmeehan

    Try using double quotes. So it would be

    `if ( bp_has_members( “type=online&per_page=30”) ){

    }`

    I’m not sure if it’ll work for you, but I’ve been having some problems with bp_has_members() and using single quotes broke it totally!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘bp_has_members filter type=online is not working’ is closed to new replies.
Skip to toolbar