Pagination in search results not working

BP Profile Search › Pagination in search results not working

  • Author
    Post
  • #8632 Reply
    Philipp
    Guest

    Hey!

    I use the two shortcodes to display the filter and the results:

    [bps_display form=148 template=members/bps-form-legacy]
    [bps_directory template=members/index]

    Everything works, exept the pagination. The pagination is displayed correctly, but if the result has e.g. two pages and if I click on the 2nd page, the search results are reset and all members are displayed again, but on the 2nd page and not filtered. Only the first page is showing the filtered result. As soon as I click on any other, results are reset and all is displayed.

    Any ideas?

    Thank you for your help!

    #8633 Reply
    andrea
    Plugin Author

    Hi Philipp,

    The problem is with the two shortcodes used together in your directory page. Try this way:

    1. Remove the bps_display shortcode from your directory page.

    2. In your form 148, set:

    Form Action (Results Directory) to your directory page, and

    Add to Directory to Yes.

    Please let me know if this works for you!

    #8634 Reply
    Philipp
    Guest

    Hi Andrea,
    thank you for your reply. This works! But, is there no way to have the filters separated from the results?
    Before I had the filter on the left and the results displayed on the right. Now the space is not perfectly used, when both are on top of each other.

    Before it was quite easy to seperate them in diffrent columns…

    By the way: Very good plugin! I love it!

    #8635 Reply
    andrea
    Plugin Author

    Hi Philipp,

    To separate the search form and the results, I like to put the search form in a sidebar widget. You can try this:

    1. In your form 148, set Add to Directory to No.

    2. In Appearance -> Widgets, drag the Profile Search widget into the sidebar of your choice, enter the widget parameters and save.

    Does that help?

    #8636 Reply
    Philipp
    Guest

    Hi Andrea

    Thank you!
    Just did some further testing. Your solution with the widget works very well, as soon as I use a standard wordpress page.

    In my case, I use a fancy page build up with my theme’s pagebuilder, and this did not work with the widget and the directory placed even in the same container.

    Any idea why this is not working with pages build by pagebuilder?

    #8637 Reply
    andrea
    Plugin Author

    Hi Philipp,

    I don’t have an answer ready, but I can find out if I have a look at your test site. Please let me know if that’s OK with you.

    #8638 Reply
    Philipp
    Guest

    Right now I m scrolling through the sourcecode and i am trying to add 2 div containers to wrap the filter and the results in order to seperate them manually by css.

    If you like, you could give me hint where to do the modifications:
    Div containers

    Or if you like admin access, how could I pass you login?

    I appriciate your help!

    #8639 Reply
    andrea
    Plugin Author

    Philipp,

    If you wish to add two div containers, you have to make a custom directory template, see my page Custom Directories.

    The two divs should go inside the existing <div id="buddypress">, the first div should end after the line:

    do_action( 'bp_before_directory_members_tabs' ); ?>

    and the second should start where the first ends.

    Otherwise, if you wish to find out why your page builder doesn’t seem to work with BP Profile Search, I’d need a WP admin and an FTP access, that you can send to my email andrea@dontdream.it or via my private Contact form.

    #8641 Reply
    Philipp
    Guest

    Ok this is how I did it:

    function vea_bp_before_directory_members_tabs(){
    	echo '<div class="bp-directory-wrapper">';
    }
    function vea_bp_after_directory_members(){
    	echo '</div>';
    }
    add_action( 'bp_before_directory_members_tabs', 'vea_bp_before_directory_members_tabs' );
    add_action( 'bp_after_directory_members', 'vea_bp_after_directory_members' );

    In bps-form-legacy.php I added:

    //row 21:
    <div class="bp-filter-wrapper"><div class="item-list-tabs bps_header">
    
    //row 166:
    else echo "</div>\n";

    Just in case anybody facing similar problems.

    Thank you Andrea for your support.

    #8643 Reply
    andrea
    Plugin Author

    Thank you Philipp for posting the solution!

Reply to: Pagination in search results not working
My Information