Repeat custom fields on same page
-
hi guys,
i am currently designing a theme for a restaurant, and have decided to use custom fields on their (food)menu page so as they are able to edit each item as they see fit (i’m completely new to this so if anyone thinks there is a better way to achieve this please let me know).
I have 4 field names- category, item, description and price. Their values are than entered accordingly. These have all been styled and work fine, however when i repeat a name for the next item it doesn’t appear-it only shows each one once.
Any help would be very much appreciated!!
ps heres my current code<?php get_header(); the_post(); ?> <div id="main-content"> <div class="menu-cat"> <?php if ( get_post_meta($post->ID, 'menu-cat') ) : ?> <?php echo get_post_meta($post->ID, 'menu-cat', true); ?> <?php endif; ?> </div> <div class="menu-item"> <?php if ( get_post_meta($post->ID, 'menu-item') ) : ?> <?php echo get_post_meta($post->ID, 'menu-item', true); ?> </div> <?php endif; ?> <div class="menu-description"> <?php if ( get_post_meta($post->ID, 'menu-description') ) : ?> <?php echo get_post_meta($post->ID, 'menu-description', true); ?> <?php endif; ?> </div> <div class="menu-price"> <?php echo get_post_meta($post->ID, 'menu-price', true); ?> </div>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Repeat custom fields on same page’ is closed to new replies.