I am displaying a custom post type in a responsive grid loop based on the support ticket https://toolset.com/forums/topic/definitive-method-for-creating-truly-responsive-grid-loop-wequal-height-cells/
You can see my test layout at hidden link
I am trying to find a way to display the grid so that each alphabetic section starts in a new row, so:
A
all posts starting with the letter 'A' (in a responsive grid layout)
B
all posts starting with the letter 'B' (in a responsive grid layout)
etc.
I plan to create 'dummy' posts with the title of each of the alphabet letters. In my test layout I have created:
A dummy post with the post title 'M', so it always appears before all the other 'real' posts starting with the letter 'M'.
A 'dummy' post with the post title 'N', so it always appears before all the other 'real' posts starting with the letter 'N'.
This works okay. I have used conditional output to detect the 'dummy' post (has no image) and format the dummy post to act as an alphabetic section header.
I need help to force each alphabetic section to start in a new row. So as an example from my test layout for the letters 'M' and 'N',
After the post titled 'IGS Audio', the display should start on a new line with:
'M' (dummy post)
M-Audio, Mackie, Magix, Marshall, MOTU
'N' (dummy post)
Natal, Native Instruments, Neat Microphones, Negri Cases, Nektar, Neumann
Here is my view code
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<div class="container wpv-loop js-wpv-loop">
<wpv-loop wrap="12" pad="true">
[wpv-item index=1]
<div class="row spacing">
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=2]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=3]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=4]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=5]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=6]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=7]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=8]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=9]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=10]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=11]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
[wpv-item index=12]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1 card">
[wpv-conditional if="(NOT( empty($(wpcf-company-logo)) ))"]
<div class="card2">
<a href="[wpv-post-url]">
[types field='company-logo' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='400' height='400' resize='crop'][/types]
</a>
</div>
[wpv-post-title]
[/wpv-conditional]
[wpv-conditional if="(empty($(wpcf-company-logo)) )"]
<div class="alphabet">
[wpv-post-title]
</div>
[/wpv-conditional]
</div>
</div>
[wpv-item index=pad]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1"></div>
[wpv-item index=pad-last]
<div class="col-xs-6 col-sm-3 col-md-2 col-lg-1"></div>
</div>
</wpv-loop>
</div>
<!-- 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]
Could you suggest way to achieve what I am trying to do?
Regards
Robert