SAR Intelligenceby SAR-SOFT

Change a classic theme's PHP templates in a draft child theme

Make a change that needs PHP, such as a note under the Add to cart button, in a draft child theme that is checked and previewed before it goes live.

Difficulty
Advanced
Time
about 40 min
The prompt

My site uses a classic theme. On [where, e.g. every product page, under the Add to cart button] I want [change, e.g. a short line: 'Orders before 14:00 ship the same day']. Do it in a draft child theme, never in the live theme. Read the parent theme's files first so you override as little as possible. Check the draft before you show me anything, send me the preview link, and tell me how publishing works on my site. Publish only when I say so.

Already connected?

If SAR is already in your AI app, this is enough:

Already connected?

Add [change] to [where] in a draft child theme, check it, and send me the preview.

What happens

  1. The AI app starts a draft child theme next to the live one; the live theme is never edited.
  2. It reads the parent theme's files to find the right place and overrides only what is needed.
  3. It writes the PHP file; each one is checked, and code execution, file or option writes and remote calls are refused.
  4. It checks every PHP file it wrote and tries the draft on the site's main kinds of page, then gives you a preview link that works for an hour.
  5. Publishing is approved in SAR with your password; SAR tries the main pages first and switches back by itself if a fatal error appears in the next ten minutes. On a site installed from WordPress.org a person publishes it in wp-admin.

Approvals involved

Worked out from the tools this recipe uses.

  • wordpress_create_draft_themeStart a draft themeNone
  • wordpress_read_theme_fileRead a theme fileNone
  • wordpress_write_theme_fileWrite a theme fileNone
  • wordpress_check_draft_themeCheck the draft theme before publishingNone
  • wordpress_get_theme_previewPreview the draft themeNone
  • wordpress_publish_draft_themePublish the draft themeApproval and password

What you get

The change you wanted, made without touching the live theme's code, and easy to undo.

Try it on your own site

Install the plugin, add SAR to your AI app and paste the prompt. Free to start.

Connect your WordPress site

Type your site's address and we open its own plugin page, ready to install SAR Intelligence.

Prefer to install by hand? Download the plugin · how to connect it

Not on WordPress, or want to set things up first? Create your free account

Free to start · No credit card