The Recipe

Function: the_recipe();

This function displays the recipe that has been attached to a post. If the automatic output option is turned on, and the current page being viewed is set as a page for the recipe to be viewed on, the recipe will be displayed.

Shortcode: [the_recipe]

If the automatic output option is turned off, the shortcode is required and can be placed anywhere within a post.

A template tag is not currently supported.

Recipe Parts

Function: recipress_recipe()

This function returns the value of the requested field for the current posts’ recipe. It is used in the_recipe() to output each part of the recipe, and must be used inside The Loop. This function can be used as a template tag to create your own recipe output.

Usage

recipress_recipe($field, $attr = null)

Parameters

$field
(string) (required) The field to be requested.
Available fields:
  • 'title' – The recipe title or generated title from the post title
  • 'photo' – The recipe photo or the post thumbnail depending on the ReciPress Options.
  • 'summary' – The recipe summary or generated summary from the post content
  • 'cuisine' – The recipe cuisine, linked to the cuisine archive page and prefixed with the Cuisine: label. The prefix and the link are wrapped in an <li> tag to be used within a list.
  • 'course' – The recipe course, linked to the course archive page and prefixed with the Course: label. The prefix and the link are wrapped in an <li> tag to be used within a list.
  • 'skill_level' – The recipe skill level, linked to the skill level archive page and prefixed with the Skill Level: label. The prefix and the link are wrapped in an <li> tag to be used within a list.
  • 'prep_time' – The prep time outputted in the set format from the $attr parameter (see below) and prefixed with the Prep Time: label.
    Accepted attributes:

    • 'iso' – outputs in ISO 8601 format for use with hRecipe timestamps
    • 'mins' – outputs in reading format: x hrs x mins
  • 'cook_time' – The cook time outputted in the set format from the $attr parameter (see below) and prefixed with the Cook Time: label.
    Accepted attributes:

    • 'iso' – outputs in ISO 8601 format for use with hRecipe timestamps
    • 'mins' – outputs in reading format: x hrs x mins
  • 'ready_time' – The ready time calculated by adding the prep and cook times and then outputted in the set format from the $attr parameter (see below) and prefixed with the Ready Time: label.
    Accepted attributes:

    • 'iso' – outputs in ISO 8601 format for use with hRecipe timestamps
    • 'mins' – outputs in reading format: x hrs x mins
  • 'yield' – The yield and servings of a recipe and prefixed with the Yield: label. If the yield input is empty, just the servings will output. If both the yield and servings input were filled out, the output will be combined, e.g. 2 loaves (16 Servings).
  • 'cost' – The cost of the recipe prefixed with the Cost: label.
  • 'ingredients' – Returns an unordered list with each ingredient amount, measurement, name, and notes.
  • 'instructions' – Returns an ordered list with each instruction and image.
$attr
(string) (optional) Attributes to be used when outputting the $field. Currently only used with 'prep_time', 'cook_time', and 'ready_time'.