I have a list that is created by the code below:
$facilities_bid = get_the_term_list(
$post->ID,
'room_facilities',
'<ul class="fac-styles">
<li>
<i class="fa fa-circle-o" aria-hidden="true">', '</i>
</li>
<li>
<i class="fa fa-circle-o" aria-hidden="true">', '</i>
</li>
</ul>' );
echo strip_tags($facilities_bid, '<ul><li><i>');
The HTML output is:
<ul class="fac-styles">
<li><i class="fa fa-circle-o" aria-hidden="true">Air Conditioning</i></li>
<li><i class="fa fa-circle-o" aria-hidden="true">Coffee machine</i></li>
<li><i class="fa fa-circle-o" aria-hidden="true">Flat-screen TV</i></li>
<li><i class="fa fa-circle-o" aria-hidden="true">Free WiFi</i></li>
<li><i class="fa fa-circle-o" aria-hidden="true">Hairdryer</i></li
<li><i class="fa fa-circle-o" aria-hidden="true">Telephone</i></li>
</ul>
I want the list to be such that, the php automatically created nested divs after after every three items to be:
<div class="one">
<ul class="fac-styles">
<li><i class="fa fa-circle-o" aria-hidden="true">Air Conditioning</i></li>
<li><i class="fa fa-circle-o" aria-hidden="true">Coffee machine</i></li>
<li><i class="fa fa-circle-o" aria-hidden="true">Flat-screen TV</i></li>
</ul>
</div>
<div class="one">
<ul class="fac-styles">
<li><i class="fa fa-circle-o" aria-hidden="true">Free WiFi</i></li>
<li><i class="fa fa-circle-o" aria-hidden="true">Hairdryer</i></li
<li><i class="fa fa-circle-o" aria-hidden="true">Telephone</i></li>
</ul>
</div>