在wooocmmerece网站上应用无限滚动无法正常工作

编程入门 行业动态 更新时间:2024-10-19 06:26:28
本文介绍了在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调用,但最终却遇到了这样的怪异问题,例如在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网站上应用无限滚动无法正常工作

本文发布于:2023-11-01 12:49:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549380.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法正常   工作   网站   wooocmmerece

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!