我正在尝试实现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调用,但最终却遇到了这样的怪异问题,例如在wordpress中进行简单的Ajax调用不会得到expecetd输出
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网站上应用无限滚动无法正常工作
发布评论