Forums

Repeat custom fields on same page (3 posts)

  1. jameshunter77
    Member
    Posted 1 year ago #

    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>
  2. fonglh
    Member
    Posted 1 year ago #

    why don't you use the built in categories, use title for the item, and the content box for the description?

    so you'll only need 1 custom field for price. unless you've done lots of customization to the admin interface, this will probably be easier to understand.

  3. jameshunter77
    Member
    Posted 1 year ago #

    @fonglh
    hey thanks for gettin back, i've just been given a link to a plugin and tutorial which suits me perfectly.

    if your interested

    http://wordpress.org/extend/plugins/fresh-page/installation/

    and the tutorial

    http://sara-cannon.com/blog/2010/03/27/using-flutter-for-a-restaurant-menu-in-wordpress/

    thanks again

Topic Closed

This topic has been closed to new replies.

About this Topic