Recipe shortcode – line spacing within recipe-ingredients shortcode

  • Unknown's avatar

    Hi there, I’ve been using the recipe shortcode (https://wordpress.com/support/recipes/) on my site. I now have a recipe to share which consists of a few components (eg. crust, cheesecake, topping). When I try to break down the ingredient list between the three components like below, the ‘title’ for the component does not have a line spacing between it and the last ingredient. Is there a code to put to allow a line spacing in the shortcode within the recipe-ingredients shortcode?
    [recipe-ingredients]
    Crust:
    – cookie
    – butter

    Cheesecake:
    – cream cheese
    – egg

    Ganache:
    – dark chocolate
    – cream
    [/recipe-ingredients]

  • Hi there,

    Is this on https://earlgreythursday.wordpress.com/?

    This is because the ingredients shortcode has no way of knowing those are headings, rather than ingredients. It just treats everything inside the shortcode as a list of ingredients, and the spacing that does appear is just the default spacing that always get added at the start of a bulleted list. Bulleted lists don’t by default have similar spacing below them, which is why the next line appears without any break.

    You can use multiple recipe-ingredients shortcodes for the different sections, and then use the title attribute to set the headings. In other words:

    [recipe-ingredients title="Crust:"]
    – cookie
    – butter
    [/recipe-ingredients]
    
    [recipe-ingredients title="Cheesecake:"]
    – cream cheese
    – egg
    
    [/recipe-ingredients]
    
    [recipe-ingredients title="Ganache:"]
    – dark chocolate
    – cream
    [/recipe-ingredients]
  • Unknown's avatar

    Awesome – thanks, I’ll give that a go!

  • The topic ‘Recipe shortcode – line spacing within recipe-ingredients shortcode’ is closed to new replies.