-
-
Notifications
You must be signed in to change notification settings - Fork 4
Other Shortcodes
There are other shortcodes available for use anywhere on your site. For example, you can use the "cooked-timer" shortcode within your recipe to add cooking timers to your directions.
This shortcode is used to display a cooking timer. Your visitors can simply click it to start a timer. This would add a 5 minute timer to the page with the text "5 Minutes":
[cooked-timer minutes="5"]5 Minutes[/cooked-timer]
For more control, you can use hours and seconds as well:
[cooked-timer hours="1" minutes="15" seconds="30"]1 Hour, 15 Minutes and 30 Seconds[/cooked-timer]
By default the text between the shortcode will be the description of the timer, but you can override this using the "desc" option. So for example, instead of the timer saying "5 Minutes" after you click on it, it could say "Boil noodles for 5 minutes.", which puts context into the timer itself. This is helpful if you have multiple timers going at once:
[cooked-timer minutes="5" desc="Boil noodles for 5 minutes."]5 Minutes[/cooked-timer]
An important shortcode, as this one will display your recipes in a beautifully formatted list view, complete with a search and sort box at the top:
[cooked-browse]
All of the following are configurable:
category — Provide a default recipe category ID.
order — Set the default order. Choose between "desc" and "asc". Set to "desc" by default.
orderby — Set the default sort order. You can use "date" or "title". Set to "date" by default.
show — Recipes to show per page.
search — Show the search/filter box. Choose between "true" or "false". Set to "true" by default.
pagination — Enable/disable pagination. Choose between "true" or "false". Set to "true" by default.
columns — How many columns to use in the grid layout. Choose 1, 2, 3, 4, 5 or 6.
layout — Which layout to use. Set to "grid" by default. More available with the Cooked Pro upgrade.
author — Choose which author's recipes to display by adding the author's ID here.
compact — Display the search fields in compact mode, great for skinny areas.
hide_browse — Hide the Browse dropdown in the search area.
hide_sorting — Hide the Sorting dropdown in the search area.
hide_excerpt — Hide the recipe excerpt.
EXAMPLE 1
Show only the most recent 4 recipes:
[cooked-browse columns="4" search="false" pagination="false" show="4"]
EXAMPLE 2
Show recipes, sorted oldest to newest.
[cooked-browse order="asc"]
EXAMPLE 3
Show recipes in a single column in the category with an ID of "123":
[cooked-browse columns="1" category="123"]
EXAMPLE 4
Hide the "Browse" and "Sorting" dropdowns in the search area:
[cooked-browse hide_browse="true" hide_sorting="true"]
If you need to display JUST the recipe search fields on your site, you can use the following shortcode.
[cooked-search]
All of the following are configurable:
compact — Display the search fields in compact mode, great for skinny areas.
hide_browse — Hide the Browse dropdown in the search area.
hide_sorting — Hide the Sorting dropdown in the search area.
EXAMPLE Show the search area in compact mode and hide the browse dropdown:
[cooked-search hide_browse="true" compact="true"]
Cooked allows you to also embed a complete recipe on any page or post. Instead of using the default recipe post templates, you can use the default WordPress blog posts and just embed your recipes into them. If you decide to do this all the time, it is wise to "Disable Public Recipes" from the Recipes > Settings panel so that you don't have duplicate content.
Each recipe has a unique ID that you can find by simply editing the recipe. You will find its unique shortcode right on the first tab at the top. Just copy and paste that into a page and the recipe will show up there.
[cooked-recipe id="12345"]
Display a simple list of recipes with a few configuration options:
[cooked-recipe-list]
All of the following are configurable:
show — How many recipes to show (sorted newest to oldest).
recipes — Specify which recipe IDs to display, separated by a comma.
width — Set the width of the list. Defaults to 100%. Use "%" or "px" after the number.
hide_image — Hide the recipe image.
hide_author — Hide the recipe author.
EXAMPLE 1
Show a "400px" wide recipe list, specifying which recipes to display:
[cooked-recipe-list width="400px" recipes="123,321,456,654"]
EXAMPLE 2
Show a recipe list with 10 recipes, sorted newest to oldest and with the image hidden:
[cooked-recipe-list show="10" hide_image="true"]
Display a fancy recipe card with a few configuration options:
[cooked-recipe-card]
All of the following are configurable:
id — Specify a recipe ID to display (required).
width — Set the width of the card. Defaults to 100%. Use "%" or "px" after the number.
style — Choose between
hide_author — Hide the recipe author.
hide_image — Hide the recipe image.
hide_excerpt — Hide the recipe excerpt.
hide_title — Hide the recipe title.
EXAMPLE 1
Show a "300px" wide recipe card in the "modern" style:
[cooked-recipe-card width="300px" style="modern"]
EXAMPLE 2
Show a recipe card in the default style with the excerpt and author hidden:
[cooked-recipe-card hide_excerpt="true" hide_author="true"]
- Installation
- Create Recipes
- Shortcodes & Widgets
- Settings
- Plugin Support
- Translations
- Imports
- FAQs
- REST API
- Filters