Det här tillägget har inte testats med någon av de 3 senaste huvudversionerna av WordPress. Det kanske inte längre underhålls och kan ha kompatibilitetsproblem när det används tillsammans med nyare versioner av WordPress.

Easy Nutrition Facts Label

Beskrivning

This plugin creates a ’nutrition-label’ custom post type which can be assigned to any page or post.

Use the shortcode ’nutrition-label’to generate a FDA-style nutrition label.

Developers can add do_shortcode(’[nutrition-label]’) to their templates so their clients can automatically assign labels to posts and pages.

See http://en.wikipedia.org/wiki/Nutrition_facts_label for more information on nutrition labels.

Reference daily intake values come from http://en.wikipedia.org/wiki/Reference_Daily_Intake

This plugin is forked from the wp-nutrition-label plugin found at http://romkey.com/code/wp-nutrition-label

Skärmdumpar

  • New Labels Section

  • List view in the admin, custom columns for shortcode and the page it is assigned to.

  • Add/Edit Label Form

  • Include 'do_shortcode' in your template. It will search for the first label associated to that page.

  • Include labels on a per-page basis.

  • Example output

Installation

  1. Upload /nutrition-facts-label to the /wp-content/plugins directory

  2. Activate the plugin through the Plugins menu in WordPress

  3. Create a label in the new ’Labels’ section of the admin.

  4. Include the shortcode [nutrition-label id=100] where you want a specific label to be displayed.

  5. DEVELOPERS: When creating the label you can also specify the Page or Post you want the label to appear and include echo do_shortcode(”[nutrition-label]”); in the template where you want the label.

Vanliga frågor

What units does the label use?
  • Grams: totalfat, satfat, transfat, carbohydrates, fiber, sugars, protein
  • Milligrams (mg): cholesterol and sodium
  • Unitless: servings and calories (units are implicit for calories)
  • You should include the unit in the serving size attribute (ie: ”4 oz”)
What about **Calories from Fat**?

The Calories from Fat number is computed from the totalfat attribute.

What about vitamins?

Thinking about it.

How do I style the nutrition label?

You can control the width with the ”width” attribute. The width attribute uses ems as its unit. It is styled to scale but it’s likely that the ”Nutrition Label” text won’t scale well as the default font is Helvetica, which isn’t fixed-width.

Each label as an id attribute of wp-nutrition-label-{ID} which allows you to change the label as you see fit.

How about calculating the nutrition values based on a recipe?

This is really hard to do. To do it at all reliably requires human intervention to match ingredients names against their entries in a nutrition database. That’s a level of difficulty I don’t wan to try to tackle with this plugin. You may find the USDA’s free online nutrition database useful for looking up nutrition information:

http://www.nal.usda.gov/fnic/foodcomp/search/

Recensioner

29 november, 2018
Hello tested you'r module, works great but showing count errors above the public view. This error is from the new PHP 7.2 Can you update to make work nice on php 7.2? Regards
3 september, 2016
The plugin works the way it is intended. However, it's hard to manage the nutrition facts since they are created under the "Labels" section and not created with the post. Sometimes I add several nutrition labels to a single post. I would much prefer creating the nutrition label in post vs using a shortcode. Even if the label needs to be stored in the "labels" having a way to create that from the post page would be awesome.
Läs alla 9 betyg

Bidragsgivare och utvecklare

”Easy Nutrition Facts Label” är programvara med öppen källkod. Följande personer har bidragit till detta tillägg.

Bidragande personer

Ändringslogg

1

  • Första utgåvan