---
title: "Add a photo book editor to WordPress | Prodigi Studio"
description: "Enqueue the Prodigi Studio embed script in WordPress, place the photo book editor on a page and add finished books to the WooCommerce cart."
url: "https://studio.prodigi.com/help/wordpress"
---

# Add the photo book editor to WordPress

Enqueue the Studio embed script from your theme, then place the editor container on the page where customers create their book.

The example adds the finished book to the WooCommerce cart through the Store API. After payment, your server confirms the Studio order reference so Studio can print the book.

## WordPress example

```
<?php
// functions.php — enqueue the Studio embed script
function studio_enqueue() {
    wp_enqueue_script(
        'studio-embed',
        'https://studio.prodigi.com/embed.js',
        [],
        null,
        true
    );
}
add_action('wp_enqueue_scripts', 'studio_enqueue');
?>

<!-- In your page template or shortcode output: -->
<div id="photobook-designer"></div>
<script>
  document.addEventListener('DOMContentLoaded', function() {
    PhotobookGenerator.create(
      document.getElementById('photobook-designer'),
      {
        merchantId: 'YOUR_MERCHANT_ID',
        onComplete: function(payload) {
          // Add payload.lineItem to WooCommerce cart via AJAX. Keep
          // payload.order.reference with the order: after payment your
          // server confirms it with POST /v1/orders/{reference}/submit.
          fetch('/wp-json/wc/store/cart/add-item', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({ id: payload.lineItem.sku, quantity: 1 }),
          });
        },
      }
    );
  });
</script>
```

## Other guides

-   [Add the photo book editor to any website](https://studio.prodigi.com/help/html-embed)
-   [Add the photo book editor to Shopify](https://studio.prodigi.com/help/shopify)
-   [Add the photo book editor to Wix](https://studio.prodigi.com/help/wix)
-   [Add the photo book editor to Squarespace](https://studio.prodigi.com/help/squarespace)
-   [Create photo books with the Studio API](https://studio.prodigi.com/help/studio-api)
-   [Frequently asked questions](https://studio.prodigi.com/help/faq)
