How can i make an array of veriables generated using the values passed through a while loop
I am using osclass for a uni project and i find no way whatsoever to make a list os usable variables from the custom catagory fields i added.
I have made Identifiers for the custom catagories also ( SLUGs )
and have tried many different approaches to grab and echo the custom catagory values elsewhere on the page
I cannot isolate the custom catagory values by any means.
Below is the code used to display the custom catagory values on my osclass page
<?php if( osc_count_item_meta() >= 1 ) { ?>
<?php while ( osc_has_item_meta() ) { ?>
<?php if(osc_item_meta_value()!='') { ?>
// I WOULD LIKE TO MAKE MAKE AN ARRAY OF VERIABLES SO I CAN USE THE CUSTOM CATAGORY DATA
// TRIED SO FAR if(osc_item_meta_name()!='') { $caughtcountry = osc_item_meta_value('country'); }
// BUT THIS APPROACH DOES NOT WORK
<?php } ?>
<?php } ?>
<?php } ?>`
I have tried using the identifiers that i added to the catagory in Admin panel
I have also tried using the Current PHP but cannot grab the values of specific custom catagories
Below is an example of one of my attempts to grab a custom catagory value but it only shows the 1st value within the values instead of cataching the ‘age’ value using the ‘age’ identifier i used.
<?php if( osc_count_item_meta() >0 ) { // The If osc_count_item_meta() >=1
if(osc_item_meta_value('age')!='') { $caughtage = osc_item_meta_value('age'); } else { $caughtage=''; }
} else { $caughtage=''; }
?>
Also tried the following
<?php if( osc_count_item_meta() >0 ) {
if(osc_item_meta_name('age')!='') { $caughtage = osc_item_meta_value('age'); } else { $caughtage=''; }
} else { $caughtage=''; }
?>
Have also tried common sense but that doesnt work either
<?php if( osc_item_age()!='' ) { $Age = osc_item_age(); } else {$Age='';} ?>
I am completely stumped.
The code below loops through the custom catagories but isolating them into variables im struggling with, yet i imagine it would be as easy as an array loop
<?php if( osc_count_item_meta() >= 1 ) { ?>
<div id="custom_fields">
<div class="meta_list">
<?php while ( osc_has_item_meta() ) { ?>
<?php if(osc_item_meta_value()!='') { ?>
<div class="meta">
<strong><?php echo osc_item_meta_name(); ?>:</strong>
<span><?php echo osc_item_meta_value(); ?></span>
</div>
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
Any help would be greatly appreciated.