• Resolved norover

    (@norover)


    Hi there,

    I want to create two maps:
    Map 1. max results set to 7.
    Map 2. Unlimited or high amount of search results.

    Each map will have its own page.

    I am aware that the max results can be set in the overall configuration settings, but I want to control this per map. Is this possible?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    This is possible with a few lines of custom code. The code has to go in the functions.php inside your active theme folder.

    Replace the ‘page-slug’ with the slug from your own page.

    
    add_filter( 'wpsl_js_settings', 'custom_wpsl_settings' );
    
    function custom_wpsl_settings( $settings ) {
    
        if ( is_page( 'page-slug' ) ) {
            $settings['maxResults'] = 10;
        } else if ( is_page( 'page-slug-2' ) ) {
            $settings['maxResults'] = 100;
        }
    
        return $settings;
    }
    Thread Starter norover

    (@norover)

    Hi Tijmen,

    Thanks so much! We had to increase the max amount in the search settings for this to work, but it is working as expected. Wonderful, thanks so much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Two Maps with different max results’ is closed to new replies.