Algolia - WordPress的 - 自定义帖子类型的Instantsearch菜单

问题描述:

我想获得即时搜索小部件来过滤自定义帖子类型。因此,此菜单过滤器:https://community.algolia.com/instantsearch.js/documentation/#menu仅用于过滤自定义帖子类型。Algolia - WordPress的 - 自定义帖子类型的Instantsearch菜单

我已经尝试过这样:

   search.addWidget(
        instantsearch.widgets.menu({ 
        container: '#post-type', 
        attributeName: 'post_type', 
        limit: 10, 
        templates: { 
         header: 'Post Types' 
        } 
        }) 
       ); 

当然DIV和渲染代码:

<div id="post-type"></div> 

它呈现标题正确,所有的工作,但自定义文章类型将不以任何形式或形式上市。

甚至有可能以这种方式呈现CPT吗?

任何意见赞赏。

所有需要发生这一工作正在改变属性名称:“post_type_label”

+0

这里是文档来记录的模式:https://community.algolia.com/wordpress/指数schema.html#的帖子 – bobylito