I have the following
echo "<span>".apply_filters(" $value\n", $value)."</span>";
that outputs
<span>Value</span> <span>value 2</span> <span>value 3</span>
I want to append a 1 to each span outputted, so
<span class="span-1">Value</span> <span"span-2">value 2</span> <span"span-3">value 3</span>
How would I go about doing this or when can I find information/correct terminology on the issue?
Thanks
foreach ( (array) $keys as $key ) {
$keyt = trim($key);
if ( '_' == $keyt{0} || 'pricing' == $keyt || 'vehicleType' == $keyt || 'coverageRegion' == $keyt || 'locationType' == $keyt )
continue;
$values = array_map('trim', get_post_custom_values($key));
$value = implode($values,', ');
echo "<span class='srch-val'>".apply_filters(" $value\n", $value)."</span>";
}
If you have access to jQuery, you can use jQuery functions to change the class names of whichever classes you’d like using addClass() and removeClass(). There’s also a .css() method that allows you you to change your css on specific elements of groups of elements.
This is the documentation for addClass: http://api.jquery.com/addClass/
HTH