Title: unique ids
Last modified: June 30, 2018

---

# unique ids

 *  [lucein](https://wordpress.org/support/users/lucein/)
 * (@lucein)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/unique-ids/)
 * I am looking for a way to add unique ids to the menu items that are rendered 
   in the single column template.
    I can edit the template, but it seems the menu
   items are not being looped so anything that I have tried to increment, never 
   increments. can I retrieve the menu items post id from within the template, so
   that the id can be rendered in the html?
 * I found $food_id, $group_id and others in the template, but none of them retrieve
   a number that is unique to the menu item.
    or maybe a way to retrieve the menu
   items sort order number?
 * I need to style different parts of the menu and having unique ids is the only
   way that I can style the menu items and not affect everything in the menu.
    -  This topic was modified 7 years, 9 months ago by [lucein](https://wordpress.org/support/users/lucein/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Sanjeev Aryal](https://wordpress.org/support/users/sanzeeb3/)
 * (@sanzeeb3)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/unique-ids/#post-10460716)
 * Hello [@lucein](https://wordpress.org/support/users/lucein/),
 * `$food_id` is unique to the menu item. You can assign id to make each menu item:
   `
   <div class="rp-column-1 rp-column-block rp-column-margin" id="rp-coloun-<?php
   echo $food_id;?>">`
 * Ref: [https://github.com/wpeverest/restaurantpress/blob/master/templates/layouts/one-column.php#L51](https://github.com/wpeverest/restaurantpress/blob/master/templates/layouts/one-column.php#L51)
 * Regards,
    WPEverest Support
 *  Thread Starter [lucein](https://wordpress.org/support/users/lucein/)
 * (@lucein)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/unique-ids/#post-10467344)
 * hello,
    I tried using $food_id but all the items listed in the group end up all
   having the same id assigned to them inside the group and category.
 * the id only changes when the menu items are part of another group and category.
   but they all have the same id for them.
 * the only way I could get around it for now was to add price to the menu item.
   appending the price to the $food_id so that it would be unique. But then I would
   have to replace the price via css instead of using the price in associated with
   the the menu item. as I did below
 * <p class=”price” id=”price_<?php echo $food_id . “_” . $food->get_price();
    ?
   >”><?php echo $food->get_price_html(); ?> </p>
 * if I can get a unique id for every menu item listed, this would be extremely 
   helpful.
    please advise.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘unique ids’ is closed to new replies.

 * ![](https://ps.w.org/restaurantpress/assets/icon-256x256.jpg?rev=1279232)
 * [RestaurantPress](https://wordpress.org/plugins/restaurantpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restaurantpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restaurantpress/)
 * [Active Topics](https://wordpress.org/support/plugin/restaurantpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restaurantpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restaurantpress/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [lucein](https://wordpress.org/support/users/lucein/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/unique-ids/#post-10467344)
 * Status: not resolved