在wooocmmerece网站上应用无限滚动无法正常工作 [英] Applying infinite scroll upon wooocmmerece site isn't working as expected

查看:108
本文介绍了在wooocmmerece网站上应用无限滚动无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试实现jetpack的无限滚动.我的网站具有?currency_switch = EUR和?orderby = width-desc这些自定义URL参数,这些参数成功实现而没有任何ajax,对于搜索,我正在使用relevanssi. 我在我的functions.php中使用此代码

I'm trying to implement jetpack's infinite scroll. my website has ?currency_switch=EUR and ?orderby=width-desc these kinds of custom URL parameters, which are successfully implemented without any ajax and for search I am using relevanssi. I am using this code in my functions.php

function mytheme_infinite_scroll_init() {
    add_theme_support( 'infinite-scroll', array(
        'container' => 'multiple-products',
        'type'           => 'scroll',
        'posts_per_page' => get_option( 'posts_per_page' )

    ) );
}
add_action( 'init', 'mytheme_infinite_scroll_init' );

它可以工作(仅在商店页面上),但不能与上述自定义url参数一起使用,并且会中断搜索.我没有调整任何分页代码(没有更改任何$ paged stc). 如何处理自定义查询参数?如何处理relevanssi,因为它说明它不支持jet pack插件的无限滚动功能,因此有一种方法可以使相关的结果通过jet pack无限滚动.

It works (only at the shop page) but doesn't work with the custom url parameters as mentioned above and breaks for search.I didn't tweak any code for pagination(didn't alter any $paged stc). How to handle it for custom query params? How to deal with relevanssi as it states that it doesn't support the jet pack plugin's infinite scroll feature, is there a way to make relevanssi results infinite scrollable via jet pack.

我尝试了自定义实现,开始时尝试进行简单的ajax调用,但最终却遇到了这样的怪异问题,例如

I tried my custom implementation , as a start tried making a simple ajax call but i am ending up with weird issues like this A simple Ajax call in wordpress doesn't give the expecetd output

谢谢

推荐答案

很抱歉为您带来无聊的答案,但是无法使Relevanssi与Jetpack Infinite Scroll功能一起使用.您只需按照 Relevanssi知识库.

Sorry for the boring answer, but there's no way to make Relevanssi work with the Jetpack Infinite Scroll feature. You just need to disable it on search pages, as described in Relevanssi knowledge base.

这篇关于在wooocmmerece网站上应用无限滚动无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆