BuddyDev

Search

[Resolved] Order by – parameter for featured member plugin shortcode

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #48602

    Hello Brajesh,

    1. Can you add a new parameter to the shortcode called order by so featured members can be listed and ordered by

    1. recently active featured members
    2. randomly/alphabetically
    3. recently featured member (new featured members should be displayed first newest – oldest)

    2. Can you also add pagination support for the shortcode as I am planning on having lots of featured members in my site

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #48603

    Hi Tosin,
    Thank you for the suggestions.

    1/2/3 is already there. Please use type=”active” enable_type=1 in the shortcode.

    You can change the type to random | newest | popular | online | alphabetical

    4. Sorry, we don’t have any plan for pagination as there is a possibility that a site might have multiple instance of the widget on same page and we won’t be able to detect which one needed pagination.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #48612

    Thanks for the feedback

    Please ill like to confirm is the parameter enable_type=1 or enable_type=”1″. that is with or without “”

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #48613

    Hi Tosin,

    You are welcome.

    Both will be treated equivalent by WordPress

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #48614

    Hi Brajesh

    I have tested the parameter but it is not working in the shortcode I think it only works when being used manually

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #48615

    Hi Tosin,
    any chance you ahev some code filtering on bp_ajax_querystring or bp_after_has_members_parse_args?

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #48629

    I have this code in my bp-custom.php file

     function theme_alter_members_parse_args( $loop ) {
    	if ( bp_is_members_directory() ) {
    		{
    		$loop['per_page'] = 12;
    		}
    	}
    	return $loop;
    }
    add_filter( 'bp_after_has_members_parse_args', 'theme_alter_members_parse_args' ); 

    and this is the shortcode im using

    [bp-featured-members view=”default” type=”newest” enable_type=”1″ max=”30″]

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #48630

    I also have this code

     function open_external_links_in_new_tab_bp_activity( $query_string, $object ) {
      if ( $object != 'activity' ) {
        return $query_string;
      }
      ?>
      <script type="text/javascript">
      var links = document.getElementsByTagName("a");
      for (var i = 0; i < links.length; i++) {
        var link = links[i];
        if (link.hostname != window.location.hostname) {
          link.target = "_blank";
        }
      }
      </script>
      <?php
      return $query_string;
    }
    add_filter( 'bp_ajax_querystring', 'open_external_links_in_new_tab_bp_activity', 10, 2 ); 
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #48640

    Hi Tosin,
    Thank you.

    Both of the above code has no effect on it. Can you try other type(alphabetical) and see if that works or not? Just to be sure.

    If that doe snot work, I will have my team to look into it an assist you.

    Regards
    Brajesh

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #48643

    (alphabetical) works by default with or without it, I have also tried online, newest, random and popular which are all not working.

    I also made sure to clear my cache everytime

You must be logged in to reply to this topic.

This topic is: resolved