WordPress Theme from Lovable HTML in One Day

dev

I took an HTML export from Lovable, opened Claude Code, and had a complete WordPress theme with 11 custom blocks, 4 custom post types, and a deployment pipeline in one day. 83 files, 7,300+ lines of code. Without an AI agent? Unthinkable.

The Brief

I needed a new website for the Czech ecological organization Stromy v krajine (Trees in the Landscape). Their old site was outdated and the client wanted to manage content themselves -- projects, events, team members, partners, and news. WordPress was the obvious choice.

I had Lovable generate the design -- an AI tool that creates a complete React SPA from a text description. The result looked great: responsive design, a beautiful color palette (forest green + gold), Tailwind CSS, interactive components. But the client needed WordPress, not a React app.

Step 1: Analyzing the Lovable Export

Lovable generated a React/Vite SPA with dozens of components: HeroSection.tsx, AboutSection.tsx, AchievementsSection.tsx, pages for news, contact, photo gallery. The entire design system was in Tailwind with HSL variables -- primary: 142 70% 25% (forest green), accent: 47 96% 53% (gold).

The first step was having Claude Code thoroughly explore the entire React codebase -- every component, every design token, every breakpoint. The AI agent built a complete map of what needed to be converted.

Step 2: WordPress Theme in an Hour

From the React code analysis, Claude Code generated the entire WordPress theme structure:

  • 11 custom blocks -- Hero, Quote + About, Achievements, Contact Info, Contact Form, Photo Gallery, listings for Projects, Events, Team, and Partners
  • 4 custom post types with Czech labels -- Projects (with status, location, tree count), Events (with date and time), Team (with social media), Partners (with logo)
  • Tailwind pipeline via Vite -- identical design tokens as in Lovable
  • Custom Nav Walker classes for desktop and mobile navigation
  • Vanilla JS lightbox with arrow navigation

55 files, 5,000+ lines -- all in a single commit.

Step 3: The Pivot -- ACF to Carbon Fields

The original plan was to use ACF (Advanced Custom Fields) for blocks and metadata. But ACF Free lacks:

  • Repeater fields (needed for item lists)
  • Gallery fields (needed for photo gallery)
  • Options pages (needed for footer settings)

ACF Pro costs $199+/year. Instead, I switched to Carbon Fields -- an open-source alternative with full functionality via Composer.

The migration happened the same day. Claude Code rewrote all 11 blocks from the ACF API to the Carbon Fields API, changed get_field() to carbon_get_the_post_meta(), and added Docker Compose for local development. Zero licensing costs, 100% open-source.

Step 4: Pixel-Perfect Polish

The remaining work was fine-tuning details to match the Lovable design:

  • Styling the Aktuality (blog) page to match the Lovable template
  • Contact form with validation replacing the placeholder
  • Editable footer via WordPress widget areas
  • CTA button moved from hardcoded header to WordPress menu system
  • Gallery with lightbox and arrow navigation
  • Editor styling -- blocks in Gutenberg have labels and borders

Step 5: Deployment

Finally, I added a Deployer pipeline:

  • Local build via Vite (Tailwind + JS)
  • rsync to production server with release management
  • Zero-downtime deploy via symlinks
  • Content sync scripts (WP-CLI export/import + search-replace)
  • Media sync via rsync to a shared uploads directory

Timeline

Time What happened
0h Lovable HTML export imported
1h Complete WordPress theme + ACF blocks
2h Pivot to Carbon Fields + Docker setup
3-6h Styling, admin flexibility, interactions
7-8h Deployment pipeline, documentation

24 commits over 2 days. 83 files. 7,300+ lines of code.

Why This Is Impossible Without Claude Code

This was a project where an AI agent excelled:

  • Codebase analysis -- explored the entire React export and understood the design system
  • Structure generation -- 55 WordPress theme files in a single step
  • Rapid pivot -- ACF to Carbon Fields migration in an hour instead of a day
  • Repetitive patterns -- controllers, template parts, CPT registration, block definitions
  • Tailwind conversion -- 1:1 transfer of design tokens from React to WordPress

Key decisions (architecture, Carbon Fields vs ACF, deployment strategy) required human judgment. But execution? The AI agent accelerated it 5-10x.

One person + Claude Code = a complete WordPress theme in a day. That's the future of development.

Previous Post

Related Posts