Custom field, multiple values
-
Hi
Im pretty new to this with <?php, but working to learn, and i cant figure this out and would apprichiate som help.
Here goes the original code with one value i get working:
<?php $description = get_post_meta($post->ID, "description", false); if ($description[0]=="") { ?> <!-- If there are no custom fields, show nothing --> <?php } else { ?> <div class="wrap"> <h3>Products</h3> <?php foreach($description as $description) { echo '<p>'.$description.'</p>'; } ?> </div> <?php } ?>
I have difficulties to modify this code to retrive values from more then one custom field input and putting it out together and inbetween the same <html>.
Here is code with one more value added, but im uncearten how to combine thoose 2 values:
<?php $description = get_post_meta($post->ID, "Description", false); $seccond_value = get_post_meta($post->ID, "price", false); if ($description[0]=="") { ?> <strong>// how do i combine 2 values here?</strong> <!-- If there are no custom fields, show nothing --> <?php } else { ?> <div class="wrap"> <h3>products</h3> <?php foreach($description as $description) { echo '<p>'.$description.'</p>'; } ?> <strong>// how does this part work and how to i combine 2 values here?</strong> </div> <?php } ?>
Maybe someone here has a good tip for a good sajt that covers my questions above?
// Azezer
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Custom field, multiple values’ is closed to new replies.