14 KiB
AI coder prompt — Super Simple WordPress Theme
Copy everything below the line into the AI coder. It is self-contained.
Role
You are a senior WordPress theme developer. You write plain PHP and plain CSS — no frameworks, no build step, no dependencies. You prioritise correct, simple, robust and maintainable code. You do not over-engineer.
Repository
- Project key:
super-simple-wp-theme - Repository:
ai-bot/super-simple-wp-theme - Base branch:
main - Work on a new branch:
theme-refresh-2.0
Objective
Refresh and rename the WordPress theme currently called NTKF into
Super Simple WordPress Theme (version 2.0.0, text domain
super-simple-wp-theme).
The theme runs the site https://www.taubaneforeningen.no/ — a Norwegian association site (Nynorsk) about cable cars and aerial tramways. It must stay easy to read for both older and younger visitors, on desktop and on mobile.
This is a refresh, not a redesign. Do not add features, do not change the
information architecture, do not introduce a block theme or theme.json.
Deliverables
| File | Action |
|---|---|
style.css |
Rewrite (keep the theme header comment at the top) |
functions.php |
Rewrite |
header.php |
Rewrite |
footer.php |
Rewrite |
index.php |
Update |
single.php |
Update |
page.php |
Update |
category.php |
Update |
author.php |
Update |
search.php |
Update |
rss-feed.php |
Delete |
README.md |
Create (English) |
screenshot.png |
Leave alone, note in README that it should be replaced |
Non-negotiable constraints
- Keep every third-party class name. These must keep working unchanged:
- RSS plugin:
.rss-feed,.rss-title - Slideshow plugin:
.super-simple-slideshow,img.super-simple-slide,.active - bbPress: every
.bbp-*,#bbp_*,.forums,.favorite-toggle,#subscription-toggle,.pw-weak,#new-post,.bbp-form,.bbp-submit-wrapper - WordPress core:
.screen-reader-text,.wp-block-*,.alignnone,.has-fixed-layout,.pagination,.page-numbers,.entry-title,.entry-meta,.entry-content,.search-container,.search-form,.search-field,.search-submit
- RSS plugin:
- Everything hidden today must stay hidden. Copy the existing
display: none !importantselector list for bbPress verbatim, reindented only. The single exception is.screen-reader-text, which must be changed to a proper visually-hidden technique (see task H below). - Keep the nav menu location slug
header-menu. Renaming it would make the site lose its menu assignment on theme switch. - No external requests. No Google Fonts, no CDNs. Everything local.
- No build step. Plain CSS in
style.css. No npm, no minification. - No
!importantoutside the preserved hide list. - Escape all output:
esc_html(),esc_attr(),esc_url(),wp_kses_post(). - Comments in code in English. User-facing strings in Norwegian Nynorsk,
wrapped in
__()/esc_html__()/esc_attr__()with the text domainsuper-simple-wp-theme.
Design tokens to implement
Colour palette. The current #38629F only reaches 6.1:1 with white text and
the muted colour #AAA on it fails at 2.6:1. Move to a darker blue so both
body text and meta text pass AAA.
| Token | Value | Role | Contrast on --sswt-bg |
|---|---|---|---|
--sswt-bg |
#1F3E6B |
page background | – |
--sswt-text |
#FFFFFF |
body text, headings | 10.7:1 (AAA) |
--sswt-text-muted |
#C6D3E8 |
date, category, feed source | 7.1:1 (AAA) |
--sswt-link |
#FFD479 |
links | 7.6:1 (AAA) |
--sswt-link-hover |
#FFFFFF |
link hover and focus | 10.7:1 |
--sswt-border |
#6C8CBF |
rules and borders | 3.1:1 (≥3:1 UI) |
--sswt-accent-bg |
#FFD479 |
button background | – |
--sswt-accent-text |
#1F3E6B |
button text | 7.6:1 |
Typography and layout:
| Token | Value |
|---|---|
--sswt-font |
Manrope, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif |
body |
font-size: 1.125rem (18 px), line-height: 1.6, letter-spacing: 0.01em |
--sswt-measure |
42rem — body text column |
--sswt-wide |
64rem — header, nav, footer |
h1 |
2.25rem |
h2 |
1.75rem |
h3 |
1.375rem |
h4 |
1.15rem |
| interactive target | minimum 44px tall |
html must be font-size: 100% — never a pixel value. All sizes in rem so
that user font-size settings are respected.
Work order
Work through the tasks in this order. One file at a time. Finish a file, verify it, then move on. Do not batch unrelated changes.
A. Preparation
- Create branch
theme-refresh-2.0. - Delete
rss-feed.php. It is dead code — theincludeis commented out inindex.php— and it fetches a remote URL withsimplexml_load_file(). Thesuper-simple-rssreaderplugin replaces it.
B. functions.php
- Prefix every function with
sswt_. sswt_setup()hooked onafter_setup_theme:load_theme_textdomain( 'super-simple-wp-theme', get_template_directory() . '/languages' ), andadd_theme_support()fortitle-tag,post-thumbnails,automatic-feed-links,responsive-embeds,customize-selective-refresh-widgets,align-wide, andhtml5withsearch-form,comment-form,comment-list,gallery,caption,style,script.sswt_register_menus()hooked oninit— register locationheader-menuwith the labelHeader Menu. Keep the slug exactly as it is today.sswt_enqueue_assets()—wp_enqueue_style( 'sswt-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) ). Remove the manual<link rel="stylesheet">fromheader.php.- Replace
remove_private_title_prefix()with filters onprivate_title_formatandprotected_title_formatthat return'%s'. Drop the locale-dependentstr_replace( 'Privat: ', ... ). - Keep the bbPress login redirect. Guard
is_bbpress()withfunction_exists(). - Keep the commented-out bbPress profile redirect, but make it toggleable via
apply_filters( 'sswt_redirect_bbpress_profile', false ). - Keep the logout link helper as
sswt_logout_link(). Escape the URL. - Keep the
wp_mail_from/wp_mail_from_namefilters, but read the values throughapply_filters( 'sswt_mail_from', ... )andapply_filters( 'sswt_mail_from_name', ... )so they are configurable. - Add a small helper
sswt_shortcode_exists()or useshortcode_exists()directly — see tasks D and E.
C. header.php
- Add
wp_head()inside<head>. Addbody_class()on<body>andwp_body_open()right after it. - Remove the hardcoded
<title>;title-tagsupport now handles it. - Add a skip link as the first element in
<body>:<a class="skip-link screen-reader-text" href="#main">with the Nynorsk labelHopp til innhald. - Wrap the header in
<header class="site-header">and the menu in<nav class="site-nav" aria-label="…">. - Rename the theme-internal class
.header-menu-classto.site-nav-menuand the id#nav-gridto.nav-grid. These are theme-internal only. - Give the logo
<img>analtattribute and handle the case whereget_site_icon_url()returns an empty string. - Open
<main id="main" class="site-main">after the header. - Keep the viewport meta tag.
D. footer.php
- Close
</main>before the footer. - Add
wp_footer()before</body>. - Guard the slideshow call:
if ( shortcode_exists( 'super_simple_slideshow' ) ) { echo do_shortcode( '[super_simple_slideshow]' ); }Today, a deactivated plugin prints the raw shortcode text on the page. - Only render the pagination block when
is_archive() || is_home() || is_search(). - Keep the search form, but replace
get_search_query()withesc_attr( get_search_query() )and use a single text domain. - Keep the footer logo and the organisation number, but move the number into
apply_filters( 'sswt_org_number', '995 268 698' ). - Use
sswt_logout_link()instead of the old function name.
E. Templates
index.php,category.php,author.php,search.php: keep the existing structure. Wrap the archive heading strings inesc_html__()/esc_html()and use the correct text domain.single.phpandpage.php: the post title must be<h1 class="entry-title">, not<h2>. Right now no template outputs an<h1>at all.index.php: guard the RSS call withif ( shortcode_exists( 'super_simple_rssreader' ) ).- Remove commented-out dead code from the templates.
F. style.css — header and tokens
- Write a complete theme header:
Theme Name: Super Simple WordPress Theme,Theme URI,Author,Author URI,Description,Version: 2.0.0,Requires at least,Tested up to,Requires PHP,License,License URI,Text Domain: super-simple-wp-theme,Tags. - Replace the old
--bg-color,--txt-color,--a,--a-hover,--border-color,--fontvariables with the--sswt-*tokens above. Delete the commented-out dark palette block. - Organise the file in this order and label the sections with comments: tokens → base → typography → links and focus → layout (header, nav, main, footer) → entry (title, meta, content) → pagination → search → WordPress blocks → third-party (slideshow, RSS) → bbPress → utilities → media queries.
G. style.css — base, typography and focus
html { font-size: 100%; },* { box-sizing: border-box; }.body: 18 px,line-height: 1.6,letter-spacing: 0.01em. Drop the0.08remletter spacing — it slows reading down.- Heading scale
h1–h4per the tokens table. No fixed3remtitles. - Links: keep an underline, add
text-underline-offset: 0.15em. Remove the underline on hover. - Add
:focus-visible { outline: 3px solid var(--sswt-link); outline-offset: 2px; }and delete everyoutline: nonerule, including the one on.bbp-forminputs. - Replace
display: noneon.screen-reader-text(and theh2.screen-reader-textrule) with the standard visually-hidden technique:clip-path: inset(50%),position: absolute,width: 1px,height: 1px,overflow: hidden, plus a:focusrule that reveals it — that is what makes the skip link appear on keyboard focus. - Add
@media (prefers-reduced-motion: reduce)that disables transitions and animations.
H. style.css — layout and components
- Header, nav and footer use
--sswt-wide. Body content uses--sswt-measure. - Replace the
float: leftmenu and theoverflow: hiddenclearfix with flex or grid. Menu links must be at least 44 px tall. - Remove the no-op
align-items: centeronheader(it has nodisplay). - Search input: remove
calc(640px - 8rem)and the100vwpatch in the media query. Use fluid widths. - Images:
.wp-block-image img, .alignnone { max-width: 100%; height: auto; }— notwidth: 100%, which upscales small images. - Tables:
.wp-block-table { overflow-x: auto; }so wide tables scroll horizontally on mobile instead of breaking the page. - Keep the 16:9 embed wrapper.
- Keep block styles for image, file, list, details, quote and caption.
- Ask before changing these three, they look deliberate:
h3.wp-block-heading { font-size: inherit; },a.wp-block-file__button { display: none; }, and the.wp-block-detailsrules.
I. style.css — third-party and bbPress
- Slideshow: keep
.super-simple-slideshow,img.super-simple-slide,.active, andaspect-ratio: 16 / 9withobject-fit: cover. - RSS: keep
.rss-feedand.rss-title. Change the source span from--a-hoverto--sswt-text-muted— the current colour is 2.6:1. - bbPress: copy the entire
display: none !importantlist verbatim, minus.screen-reader-text. Keep every other bbPress selector working. - bbPress tables, forms, reply pages, user pages and the new-topic form: keep
the selectors, but convert fixed pixel widths to
remor percentages. - Fix
.bbp-form input#user_login: it currently setscolor: var(--txt-color)withbackground-color: var(--border-color), i.e. white text on white. - Give bbPress buttons and links a visible
:focus-visiblestyle. - Give all bbPress buttons a proper background and text colour pair so that white-on-light-grey never happens again.
J. Responsive and accessibility
- Verify reflow at 320 px, 768 px and 1440 px with no horizontal scrolling.
- Verify 200% text zoom without loss of content or function.
- Keyboard walkthrough: skip link → menu → content → pagination → search → footer.
- Optional: a compact mobile menu using a button with
aria-expandedand a smallassets/js/nav.js. The default is a stacked menu with no JavaScript. If you add JavaScript it must degrade — the menu must be visible when JS is off.
K. Verification
php -lon every PHP file.- Re-check every colour pair in the tokens table against the background it is actually used on.
- Run the WordPress Theme Check plugin.
- Write
README.mdin English: installation, what the theme is for, the third-party markup it styles, the customisation filters (sswt_org_number,sswt_mail_from,sswt_mail_from_name,sswt_redirect_bbpress_profile), and a note thatscreenshot.pngneeds replacing. - Bump
Versionto2.0.0and add a short changelog comment instyle.css.
Acceptance criteria
- The theme appears as "Super Simple WordPress Theme" in Appearance → Themes.
- The menu is still attached to the "Header Menu" location.
- Front page, single post, page, category, author and search render with no PHP
notices while
WP_DEBUGis on. - All previously hidden bbPress elements are still hidden.
[super_simple_rssreader]and[super_simple_slideshow]render correctly — and print no raw shortcode text when the plugins are deactivated.- Slideshow images fill the width and keep a 16:9 ratio.
- bbPress forum list, topic view, reply view, new-topic form, user profile and edit-profile screen all render correctly.
- No horizontal scrolling at 320 px.
- Every interactive element has a visible focus indicator.
- No white-on-white or other sub-4.5:1 text.
- No requests to external domains on the front end.
Reporting
After each file, report: the file path, what changed, and anything you had to decide or could not verify. If a requirement conflicts with the existing site behaviour, stop and ask instead of guessing.