Create your own template

Creating a Custom Template in your (child) theme

WP Recipe Maker will look for templates in the  /wprm-templates/recipe/ folder of your (child) theme, so you can create that directory structure and add templates there. It's best to use a child theme, to prevent theme updates from overwriting your template.

So to start a custom template from scratch you'd follow these steps:

  1. Create the /wprm-templates/recipe/ directory structure in your child theme
  2. Create a "my-custom-template" folder inside
  3. Inside the /wprm-templates/recipe/my-custom-template/ folder, add the following files:
    1. my-custom-template.html
    2. my-custom-template.css

Take note that the folder, HTML and CSS files need to have the exact same name.

You can find our default templates in the /wp-recipe-maker/templates/recipe/modern/ folder if you want to use them as a starting point.

Make a custom template editable in the Template Editor

You can create a custom template that's also editable in the Template Editor.

For the HTML: any  recipe shortcode you add here will automatically be an editable block.

For the CSS: we use comments to define template properties. Take a look at the CSS files in the  /wp-recipe-maker/templates/recipe/modern/ folder for examples of the properties you can use!

I need to be able to use PHP in my custom template!

Instead of an HTML file you could also have a PHP file for the recipe template. In that case, your template will only be available in Legacy Mode, and will not be editable in the Template Editor.

We recommend using PHP to create a custom shortcode and adding that to a modern template instead.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.