Child themes
A child theme keeps your changes when LanternWP updates. Companion's demo import works on it too: it needs LanternWP or a child theme of it.
Create one
Make a folder beside lanternwp in wp-content/themes, with a style.css:
/*
Theme Name: My Store
Template: lanternwp
*/
and, if you change any settings or styles, a theme.json with only what differs. WordPress merges it over LanternWP's, so a child theme that sets one color keeps everything else:
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"settings": {
"color": {
"palette": [
{ "slug": "primary", "color": "#1f4d3a", "name": "Primary" }
]
}
}
}
A palette, font size or spacing list replaces LanternWP's list as a whole, so copy every entry of a list you change. A store that started from a demo has the demo's look in Styles, the user's styles, as Browse styles puts a style variation there: over LanternWP's theme.json and the child theme's, so where both set a value, the demo's wins, and the owner's changes in Styles are part of the same styles. Those styles belong to the active theme, so a child theme activated after the import starts without them until the look is chosen again (Browse styles, wp lanternwp demo look, or Use the look only in Appearance → LanternWP → Demos). The slugs are in the presets reference and are part of the public API: patterns and styles refer to them.
Templates and parts
A file in the child theme's templates/ or parts/ replaces LanternWP's file of the same name, such as parts/header.html. Keep the part slugs header, footer, checkout-header and checkout-footer; the demo import and the patterns use them.
Changes made in the Site Editor are saved in the database and win over files, the child theme's too. A demo import also writes some there: the header and footer it uses and the designs of the catalog, search and product templates. To see a file's version again, open the template or part in the Site Editor and reset it.
Patterns
Pattern slugs are public, so a pattern you insert keeps working across updates; their markup is not, so copy a pattern into your child theme's patterns/ with a slug of your own before changing it. The patterns reference lists them.
The store's details in your blocks
The theme's patterns take the store's details from the lanternwp/store Block Bindings source, so they follow the store's settings each time a page renders. Your own patterns can bind to it the same way, by args.key:
<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"lanternwp/store","args":{"key":"email"}}}}} -->
<p>hello@example.com</p>
<!-- /wp:paragraph -->
- Text, on a paragraph's or heading's
content:free-shipping,free-shipping-title,free-delivery,shipping-title,email,phone,address,payment-methods.phoneis what thelanternwp_store_phonefilter returns: LanternWP Companion's Store phone under Store Address in WooCommerce → Settings → General, empty without it. - Links to the store pages the
lanternwp_store_pagefilter names (LanternWP Companion's Settings → Reading → Store pages):contact-page,returns-page, on a Button's or Navigation link'surl, or on a paragraph's or heading'scontent, where the block keeps its own link text and takes the page's address. - Pictures, on an Image's
url,altandid:second-imagein a product's context,category-thumbnailin a product category's,brand-thumbnailin a brand's (its logo; bindurlandidand keepaltempty where the brand's name stands beside it).
A block bound to a field the store does not have is left out, and so is a Group it opens that holds only paragraphs, headings and images.
The theme's looks are block styles (label, arrow-link, badge, sale-badge): in your markup, give the block the style's class, is-style-label and so on, as the editor saves it. A Group or Cover that is one link takes "lanternwpLinkTile":true in its attributes (Link the whole card), and the theme adds lanternwp-link-tile to it when it renders.