vendredi 15 septembre 2017

how to saperate and display multiple checkbox data value from one post custom field?

i am using post custom fields in my theme and in my custom fields i have multiple checkbox selection option.

after selecting multiple checkbox and save here is the custom field saved data format :

english| hindi| chhattisgarhi| tamil| telgu| malayalam| kannada| punjabi| gujarati| marathi| urdu| bengali| odia| other.

now when i am printing this custom field in my single.php with this code :

<?php the_field('languages'); ?>

i am getting this type of value :

Language : english| hindi| chhattisgarhi| tamil| telgu| malayalam| kannada| punjabi| gujarati| marathi| urdu| bengali| odia| other.

but i want this type of output if i select multiple checkbox :

Language : english, hindi, chhattisgarhi, tamil, telgu, malayalam, kannada, punjabi, gujarati, marathi, urdu, bengali, odia, other.

and if i select only 1 checkbox then :

Language : english

can any one help for this?

thanks

Aucun commentaire:

Enregistrer un commentaire