Can you please check now: hidden link
Actually - it was not working and it suppose to not work as you added view "suppliers-belonging-to-alphabet-letter" within the loop of the "alphabet-letters" view:
- hidden link
[wpv-view name="suppliers-belonging-to-alphabet-letter" view_display="layout"]
It was not easy but I'm happy that I've a solutin to offer to. I've deleted the "alphabet-letters" view that you display using Divi builder:
- hidden link
I've added the following code to "Custom Code" section offed by Toolset:
=> hidden link
//group by tax char
add_shortcode('heading', 'func_tax_group_heading');
function func_tax_group_heading($atts, $content = '') {
static $char = null;
$condition = $atts['condition'];;
$value = $atts['value'];;
switch ($condition) {
case 'char':
if ($$condition != $value) {
$$condition = $value;
return $content;
}
break;
}
return '';
}
With the view "suppliers-belonging-to-alphabet-letter" - I've added the following code to the "Loop Editor" section and adjusted the code as given under:
=> hidden link
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="4" pad="true">
[wpv-item index=1]
[heading condition="char" value="[wpv-post-taxonomy type='alphabet-letter' format='name']"]
<div class=""><div class="alphabet-title"><a name="[wpv-post-taxonomy type='alphabet-letter' format='name']"></a>[wpv-post-taxonomy type='alphabet-letter' format='name']<div class="pull-right top-link"><a href="#top"><i class="fas fa-caret-up"></i></a></div></div>
<div class="clearfix"></div></div>
[/heading]
<div class="row ">
<div class="col-sm-3">[wpv-post-body view_template="loop-item-in-suppliers-belonging-to-alphabet-letter"]</div>
[wpv-item index=other]
<div class="col-sm-3">[wpv-post-body view_template="loop-item-in-suppliers-belonging-to-alphabet-letter"]</div>
[wpv-item index=4]
<div class="col-sm-3">[wpv-post-body view_template="loop-item-in-suppliers-belonging-to-alphabet-letter"]</div>
</div>
[wpv-item index=pad]
<div class="col-sm-3"></div>
[wpv-item index=pad-last]
<div class="col-sm-3"></div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
As you may notice I've added the following code that will display the grouping taxonomy character:
[heading condition="char" value="[wpv-post-taxonomy type='alphabet-letter' format='name']"]
<div class=""><div class="alphabet-title"><a name="[wpv-post-taxonomy type='alphabet-letter' format='name']"></a>[wpv-post-taxonomy type='alphabet-letter' format='name']<div class="pull-right top-link"><a href="#top"><i class="fas fa-caret-up"></i></a></div></div>
<div class="clearfix"></div></div>
[/heading]
Later, I've updated the Divi template code as given under:
=> hidden link
[wpv-view name="alphabet-letters-anchor-link"]
<div>[wpv-view name="suppliers-belonging-to-alphabet-letter" view_display="layout"]</div>
Now, you can filter the result without using Search button and the output is also exactly the same as before. I hope the soltuion I share will help you to resolve your issue.
More info:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/#adding-custom-php-code-using-toolset
- https://toolset.com/2013/10/how-to-group-views-results-by-year-and-month/