Site logo

[Resolved] How to enable infinite scroll without a load more button option in archives

Home Forums Support [Resolved] How to enable infinite scroll without a load more button option in archives

Home Forums Support How to enable infinite scroll without a load more button option in archives

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2587189
    Halil

    Hi,
    I enabled infinite scroll with “use buttons to load more posts” option enabled. It works on blog page and archive pages.

    I’m using content template for my post category archive and search results. Is it possible use infinite scroll on these pages without load more button enabled?

    I want to keep “load more..” button on my blog but not on category archive/search results pages.

    #2587204
    Halil

    I found the code below in the forum, it works for search results, what should I add to it to make it work on cetagory archive?

    
    add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' );
    function lh_custom_search_results_page_settings( $options ) {
        if ( is_search() ) {
        $options['infinite_scroll'] = true;
    	$options['infinite_scroll_button'] = false;
        }
      
        return $options;
    }
    #2587222
    Halil

    sorry for keeping you busy! I found it in another forum post : )

    
    add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' );
    function lh_custom_search_results_page_settings( $options ) {
        if ( is_search() || is_category() ) {
        $options['infinite_scroll'] = true;
    	$options['infinite_scroll_button'] = false;
        }
         return $options;
    }
    
    #2587236
    David
    Staff
    Customer Support

    Glad to hear you found the solution!!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.