Created
March 12, 2018 16:02
-
-
Save albionselimaj/bf4fc6c03feee3e8357cf3260ebb5d98 to your computer and use it in GitHub Desktop.
Comma separated items to list view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
var block_class = 'block-field-therapy-offered'; | |
var item_icon = 'mi wifi_tethering'; | |
var content = $('.' + block_class + ' .pf-body > p').html().split(','); | |
if ( content && content.length ) { | |
$('.' + block_class + ' .pf-body').html('<ul class="details-list social-nav"></ul>'); | |
$('.' + block_class + ' .pf-body ul').html('<li><i class="' + item_icon + '"></i> <span>' + content.join('</span></li><li><i class="' + item_icon + '"></i> <span>') + '</span></li>'); | |
$('.grid').isotope(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment