There are several shortcodes that are used when creating your recipe templates. You can use a different template for each recipe, or create one you like and then save it as the default by clicking the Save as Default button above the editor window.
[cooked-info] #
This shortcode is used to display meta information about your recipe. This information is displayed in small blocks that float to the left or right. To add meta blocks using this shortcode you can use the “include”, “exclude”, “left”, or “right” options and then provide a list of info you want to display:
include — This will include the info blocks you give it, all aligned to the left.
exclude — This will include all of the available info blocks, excluding the ones you give it, all aligned to the left.
left — This will include the info blocks you give it, all aligned to the left.
right — This will include the info blocks you give it, all aligned to the right.
So what can you include?
author — Display the recipe author’s profile image and their name.
prep_time — Display the prep time.
cook_time — Display the cook time.
total_time — Display the total time.
difficulty — Display the difficulty level.
servings — Display the servings switcher tool.
taxonomies — Display the taxonomies (categories) .
print — Display the icon button to launch the print view.
fullscreen — Display the icon button to launch full-screen mode.
Put it all together now!
Each info block needs to be separated by a comma. So for example, the following shortcode will display the author, categories, and difficulty on the left, and then the print and fullscreen icons on the right:
[cooked-info left="author,taxonomies,difficulty" right="print,fullscreen"]
Or if you want to display the servings switcher on the left, cook times on the right:
[cooked-info left="servings" right="prep_time,cook_time,total_time"]
Or to just display everything:
[cooked-info]
[cooked-ingredients] #
This shortcode is used to display the ingredients. There is just one option, and that is to hide the checkboxes that are shown by default. You can hide those by adding checkboxes=”false” to the shortcode:
[cooked-ingredients]
[cooked-ingredients checkboxes="false"]
[cooked-directions] #
This shortcode is used to display the ingredients. There is just one option, and that is to hide the checkboxes that are shown by default. You can hide those by adding checkboxes=”false” to the shortcode:
[cooked-directions]
[cooked-directions numbers="false"]
[cooked-image] #
This shortcode is used to display the featured image, if one is set.
[cooked-image]
[cooked-nutrition] #
This shortcode is used to display the nutrition facts label, if any nutrition information has been entered.
[cooked-nutrition]
[cooked-gallery] #
This shortcode is used to display the gallery, if one has been set or created on the Gallery tab.
[cooked-gallery]
Available options include “width”, “ratio”, “nav”, and “allowfullscreen”. Width can be something like “300px” or “80%”. Ratio is the ratio of the images being displayed. Something like “16/9” or “5/4” works, or something more precise like “500/425”. Nav defaults to “true” and controls whether or not you want to display the navigation (arrows and bullets) on the gallery, and Allowfullscreen defaults to “true” and enables or disables the full screen mode for the gallery.
[cooked-gallery width="300px" ratio="300/250" nav="false" allowfullscreen="false"]
[cooked-excerpt] #
This shortcode is used to display the excerpt, if one has been set.
[cooked-excerpt]
[cooked-notes] #
This shortcode is used to display the notes. There is just one option, and that is to show the header or title. You can show the header by adding show_header=”true” to the shortcode:
[cooked-notes]
[cooked-notes show_header="true"]
[cooked-next-previous] #
This shortcode is used to display the Next and Previous Recipe navigation.
[cooked-next-previous]
[cooked-related-recipes] #
Displays related recipes based on categories, cuisines, cooking methods, tags, diets, ingredients, author, and difficulty. Results are scored and sorted by relevance, with caching for performance.
Basic Usage #
[cooked-related-recipes]
When used on a recipe page, it automatically detects the current recipe. To specify a different recipe:
[cooked-related-recipes id="123"]
Display Options #
- id — Recipe ID to find related recipes for. If not specified, uses the current recipe page.
- title — Title displayed above the related recipes grid. Default: “Related Recipes”.
- limit — Maximum number of recipes to display. Default: 6.
- columns — Number of columns in the grid. Default: 3.
- hide_image — Hide recipe images. Set to “true” to hide. Default: false.
- hide_excerpt — Hide recipe excerpts. Set to “true” to hide. Default: false.
- hide_author — Hide author information. Set to “true” to hide. Default: false.
Matching Criteria #
Control which factors are used to find related recipes. Set to “true” to include, “false” to exclude:
- match_categories — Match by recipe categories. Default: true.
- match_cuisines — Match by cuisines. Default: true.
- match_cooking_methods — Match by cooking methods. Default: true.
- match_tags — Match by tags. Default: true.
- match_diets — Match by diets. Default: true.
- match_ingredients — Match by shared ingredients. Default: true.
- match_author — Match by the same author. Default: false.
- match_difficulty — Match by difficulty level. Default: false.
Weight Options #
Adjust the importance of each matching factor (higher = more important):
- category_weight — Weight for categories. Default: 10.
- cuisine_weight — Weight for cuisines. Default: 8.
- cooking_method_weight — Weight for cooking methods. Default: 6.
- tag_weight — Weight for tags. Default: 5.
- diet_weight — Weight for diets. Default: 4.
- ingredient_weight — Weight for ingredients. Default: 7.
- author_weight — Weight for author. Default: 3.
- difficulty_weight — Weight for difficulty. Default: 2.
Examples #
Display 6 related recipes in a 3-column grid:
[cooked-related-recipes]
Show 12 related recipes in 4 columns, matching only by categories and ingredients:
[cooked-related-recipes limit="12" columns="4" match_cuisines="false" match_tags="false" match_diets="false" match_cooking_methods="false"]
Display related recipes for a specific recipe, hide images and excerpts:
[cooked-related-recipes id="456" hide_image="true" hide_excerpt="true"]
Customize matching to prioritize ingredients and categories:
[cooked-related-recipes ingredient_weight="15" category_weight="12" match_tags="false"]
Performance Notes #
- Results are cached using transients for better performance.
- For large sites, pre-calculate related recipes via Settings > Tools > Calculate Related Recipes to improve load times.
- Cache is automatically invalidated when recipes are saved or deleted.
