explode custom field not working
-
hi
i am trying to use this code to explode data from custom field by name (schools) which includes data like : one,two,three
but it keeps returning this errorWarning: trim() expects parameter 1 to be string, array given in C:\xampp\htdocs\***\wp-content\themes\***\schools.php on line 20
anyhelp ?
<div class="schools_names"> <?php $school = get_post_meta($post->ID, 'schools', false); $school = explode(',' , $school); ?> <h3>colleges:</h3> <p> <?php foreach($school as $src) { echo '<a href="#" target="_blank">'.trim($src).'</a> - '; } ?> </p> </div>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘explode custom field not working’ is closed to new replies.