A custom, minimalist WordPress theme by Mike Lindner for mikelindner.com.au.
| Meta | Value |
|---|---|
| Theme Name | litchpress |
| Version | 0.03 |
| Author | Mike Lindner |
| Author URI | http://mikelindner.com.au |
| License | "Screw You Hippy" |
| Text Domain | litchpress |
- 1.1 π Directory Structure
- 1.2 π Core Template Files
- 1.3 π¨ Stylesheet β style.css
- 1.4 π§± Frameworks & Libraries
- 1.5 π€ Fonts
- 1.6 πΌοΈ Images & Assets
- 1.7 βοΈ Custom PHP Functions
- 1.8 π Sidebar Widgets
- 1.9 οΏ½ WooCommerce Integration
- 1.10 π Deployment
- 1.11 π οΈ Development Setup
litchpress/
βββ header.php # Site header, <head>, navigation
βββ footer.php # Footer & wp_footer() hook
βββ index.php # Main blog/archive template
βββ index.php.noblock # Backup/alternative index without excerpt truncation
βββ single.php # Single-post template
βββ page.php # Generic page template (title commented out)
βββ page-nodate.php # Page template without date display
βββ page-cooking.php # Custom page template for "cooking" category (4-col grid)
βββ sidebar.php # Sidebar with categories, archives, WooCommerce product widget
βββ woocommerce.php # Full-width WooCommerce template (shop, product, cart, checkout)
βββ template-page-full-width.php # Full-width page template (no sidebar)
β
βββ style.css # Main theme stylesheet + WP theme header
βββ screenshot.png # Theme preview (2516Γ1348 RGBA PNG)
β
βββ css/ # Bootstrap 4.0.0 CSS (full + grid + reboot)
β βββ bootstrap.css / .min.css
β βββ bootstrap-grid.css / .min.css
β βββ bootstrap-reboot.css / .min.css
β
βββ js/ # Bootstrap 4.0.0 JS bundle
β βββ bootstrap.bundle.js / .min.js
β βββ bootstrap.js / .min.js
β
βββ fonts/ # Self-hosted "Play" font (Google Fonts alternative)
β βββ Play-Bold.ttf, Play-Regular.ttf
β βββ play-v9-latin-* (EOT, SVG, TTF, WOFF, WOFF2)
β
βββ fontawesome/ # Font Awesome 5.3.1 (Free)
β βββ css/all.css
β βββ webfonts/
β βββ (less, scss, sprites, svgs, metadata)
β
βββ vendor/ # Composer dependencies (dev: wordpress-stubs)
βββ composer.json / .lock
β
βββ deploy # rsync deployment script to production server
βββ files # Quick-reference list of theme files
βββ litchpress.code-workspace # VS Code workspace config
βββ .vscode/settings.json # Editor settings (Intelephense, PHP path)
| File | Purpose |
|---|---|
| header.php | Outputs <!DOCTYPE html>, <head> with meta tags (Open Graph, favicon), loads Bootstrap CSS, theme stylesheet, renders jumbotron header with external navigation links. |
| footer.php | Copyright notice, credits, calls wp_footer() for plugin scripts. |
| index.php | Main archive/blog listing. Defines POST_SIZE constant (700 chars). Extracts first image from post content via regex. Truncates excerpts, appends "Read moreβ¦" links. Renders posts in a 2-column Bootstrap grid (col-lg-6). |
| index.php.noblock | Simpler backup version of index.php without custom truncation logic β uses native the_content(). |
| single.php | Displays a single post with full content, date, in a 2-column grid (though typically one post shown). |
| page.php | Generic page template. Title output is commented out; shows full-width content (col-lg-12). Date display commented out. |
| page-nodate.php | Variant of page.php with title commented out and no date β clean content-only layout. |
| page-cooking.php | 4-column grid layout (col-lg-4) intended for recipe/category pages. Contains debug text "yeah yeah yeah" (to be removed). |
| sidebar.php | Lists categories and archives. Displays random WooCommerce product with "Buy Now" button. Features camo gradient extending to browser edge. |
| woocommerce.php | Full-width template for all WooCommerce pages (shop, product, cart, checkout). No sidebar for cleaner product display. |
| template-page-full-width.php | Registered page template ("Full width page"). Calls get_template_part('loop', 'page') β note: loop-page.php does not exist (bug). |
The stylesheet serves two roles:
- WordPress theme header (required metadata block).
- Custom styles layered on top of Bootstrap.
| Selector / Rule | Description |
|---|---|
@import url(β¦Playβ¦) |
Loads Play font from Google Fonts (400 & 700 weights). |
@font-face { font-family: "Play" } |
Declares local Play font; src is commented out (currently unused). |
body |
Dark background (#444), greenyellow text, Play font stack. |
a |
Inherits Play font, greenyellow color. |
#ttr_header |
Full-width header with red top border, right-aligned text, cover background image from remote URL. |
#ttr_footer |
Full-width footer, red top border, centered text. |
#ttr_sidebar |
Red left border (1 px). |
pre |
Courier New monospace, greenyellow with !important. |
.page-template-template-page-full-width |
Full-width override for content/sidebar (100 % width, no float). Truncated clear: b β CSS syntax error. |
img |
Responsive images (max-width: 100%; height: auto). |
- Location:
css/andjs/ - Files included:
bootstrap.css/.min.cssβ full frameworkbootstrap-grid.cssβ grid-only (unused in current templates)bootstrap-reboot.cssβ CSS reset (unused directly)bootstrap.bundle.jsβ includes Popper.js for dropdowns/tooltipsbootstrap.jsβ standalone (without Popper)
- Loading:
header.phplinksbootstrap.cssviaget_stylesheet_directory_uri(). - JS loading: Currently commented out in
header.phpβ Bootstrap JS is not loaded, so no dropdowns, modals, or collapse.
Templates use Bootstrap 4's 12-column grid system:
| Template | Desktop (col-lg-*) |
Tablet (col-md-*) |
Phone (col-sm-* / col-xs-*) |
|---|---|---|---|
| index.php | 6 (2-col) | 6 | 6 / 12 |
| single.php | 6 | 6 | 6 / 12 |
| page.php | 12 (full) | 12 | 12 / 12 |
| page-cooking.php | 4 (3-col) | 4 | 6 / 12 |
| sidebar.php | 2 | 2 | 4 / 12 |
β οΈ Note:col-xs-*is Bootstrap 3 syntax; Bootstrap 4 usescol-*(extra-small is the default). Classes likecol-xs-12are ignored in Bootstrap 4.
- Location:
fontawesome/ - Contents: CSS (
all.css,brands.css, etc.), webfonts, SCSS/LESS source, SVG sprites. - Usage:
β οΈ Not loaded anywhere in templates β available but inactive.
| Font | Source | Formats Available |
|---|---|---|
| Play | Google Fonts (remote @import) |
WOFF2, WOFF, TTF, EOT, SVG (self-hosted too) |
- The theme imports Play from Google Fonts and ships local copies in
fonts/. - The local
@font-facedeclaration is commented out, so only the Google Fonts import is active. - Fallback stack:
'Play', Fallback, sans-serifββ οΈ Fallbackis not a valid font name (typo/placeholder).
| Asset | Location / URL | Purpose |
|---|---|---|
| screenshot.png | Theme root | WordPress theme preview (2516Γ1348) |
| Header background | https://mikelindner.com.au/wp-content/uploads/2025/04/1354689436.jpg |
Jumbotron background (remote) |
| OG image | http://mikelindner.com.au/wp-content/uploads/2025/04/me_pop-art-25.jpeg |
Open Graph preview |
| Favicon | http://mikelindner.com.au/wp-content/uploads/2025/04/me_pop-art-25.png |
Browser tab icon |
| Apple touch icon | Same as favicon | iOS home-screen icon |
Extracts the first <img src="β¦"> URL from post HTML using regex:
$pattern = '/<img.*?src=["\'](.*?)["\']/i';Returns the URL string or false if no image found.
- Strips all HTML except
<a>and<video>. - Truncates to
$limitcharacters. - Trims trailing punctuation.
- Appends "β¦ Read moreβ¦" link if truncated.
- Passes result through
the_contentfilter.
sidebar.php is not widget-ready (no dynamic_sidebar() call). It outputs:
- Categories via
wp_list_categories(). - Archives via
wp_get_archives(). - WooCommerce Random Product Widget β displays a random product from the store with:
- Product thumbnail image
- Product title as clickable link
- "Buy Now" button linking to product page
- Camo gradient background extending to browser edge
The theme includes full WooCommerce support:
add_theme_support('woocommerce');
add_theme_support('wc-product-gallery-zoom');
add_theme_support('wc-product-gallery-lightbox');
add_theme_support('wc-product-gallery-slider');A custom woocommerce.php template provides full-width layout for all WooCommerce pages:
- Shop/archive pages
- Single product pages
- Cart and checkout
- No sidebar for cleaner product display
Comprehensive CSS for WooCommerce product pages:
| Element | Styling |
|---|---|
| Product Image | Max-width 300px, floated left β optimized for book covers |
| Short Description | Proper spacing below title |
| Price | Large greenyellow text (1.8em) |
| Add to Cart | Greenyellow background with dark text |
| Afterpay | Proper spacing to prevent overlap |
| Tabs | Dark theme with greenyellow accents |
| Stock Status | Color-coded (green in stock, red out of stock) |
| Related Products | Dark card styling with hover effects |
The deploy script uses rsync to sync the theme to a remote server:
rsync -ruv --delete ~/source/litchpress/* kzs9j6@dominus:/var/www/html/wp-content/themes/litchpress| Flag | Purpose |
|---|---|
-r |
Recursive |
-u |
Update (skip files newer on dest) |
-v |
Verbose output |
--delete |
Remove files on dest not in source |
- Composer:
composer.jsonrequiresphp-stubs/wordpress-stubs(dev) for IDE autocompletion of WP functions. - VS Code:
.vscode/settings.jsonconfigures Intelephense to include stubs and setsphp.executablePath.
| # | File | Issue | Severity | Status |
|---|---|---|---|---|
| 1 | style.css |
.page-template-template-page-full-width rule has truncated clear: b β should be clear: both;. |
π΄ High | β Fixed |
| 2 | template-page-full-width.php |
Calls get_template_part('loop', 'page') but loop-page.php does not exist β outputs nothing. |
π΄ High | β Open |
| 3 | sidebar.php |
Uses deprecated wp_list_cats() β replaced by wp_list_categories() since WP 2.1. |
π‘ Medium | β Fixed |
| 4 | page-cooking.php |
Contains debug string "yeah yeah yeah" in output. |
π’ Low | β Open |
| 5 | header.php |
Bootstrap JS <script> tag is commented out β interactive components (dropdowns, collapse) won't work. |
π‘ Medium | β Fixed (using wp_head) |
| 6 | style.css |
Font fallback 'Play', Fallback, sans-serif β Fallback is not a real font; should be a generic family. |
π’ Low | β Fixed |
| 7 | All templates | Uses Bootstrap 3 class col-xs-* which is ignored in Bootstrap 4 (use col-* instead). |
π‘ Medium | β Open |
| 8 | header.php |
Missing wp_head() call β theme/plugin styles and scripts won't load properly. |
π΄ High | β Fixed |
| 9 | header.php |
Hardcoded absolute URLs for CSS, images, favicon β breaks local/dev environments. | π‘ Medium | β Fixed |
| 10 | style.css |
Local @font-face for Play has empty src (commented out) β no fallback if Google Fonts blocked. |
π’ Low | β Fixed |
/* style.css */
.page-template-template-page-full-width .content,
.page-template-template-page-full-width .sidebar {
width: 100%;
float: none;
clear: both; /* was: clear: b */
}<!-- template-page-full-width.php: Replace missing template part -->
<!-- Option A: Create loop-page.php with standard page loop -->
<!-- Option B: Inline the loop: -->
<?php get_header(); ?>
<div id="ttr_main" class="row">
<div id="ttr_content" class="col-12">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
<?php get_footer(); ?><!-- sidebar.php -->
<!-- Before: -->
<?php wp_list_cats('sort_column=namonthly'); ?>
<!-- After: -->
<?php wp_list_categories(['orderby' => 'name']); ?><!-- page-cooking.php: Remove "yeah yeah yeah" -->
<p><?php the_content(__('(more...)')); ?></p><!-- header.php or footer.php (before </body>): -->
<script src="<?php echo get_stylesheet_directory_uri() . '/js/bootstrap.bundle.min.js'; ?>"></script><!-- header.php: Add before </head> -->
<?php wp_head(); ?>
</head><!-- header.php -->
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>">
<link rel="icon" href="<?php echo get_stylesheet_directory_uri(); ?>/images/favicon.png">| Category | Recommendation |
|---|---|
| ποΈ Theme Functions | Create functions.php to: enqueue scripts/styles properly, register sidebars, add theme support (menus, thumbnails, title-tag). |
| π§ Navigation | Replace hardcoded header links with wp_nav_menu() for admin-editable menus. |
| π Sidebar | Register a widget area with register_sidebar() so widgets can be managed in WP admin. |
| πΌοΈ Featured Images | Use the_post_thumbnail() instead of regex extraction β more reliable and admin-friendly. |
| βοΈ Excerpts | Use the_excerpt() or wp_trim_words() instead of custom truncation for cleaner code. |
| π Security | Escape all output: esc_html(), esc_url(), esc_attr() β especially dynamic URLs. |
| βΏ Accessibility | Add alt attributes to all images, ARIA labels to navigation, skip-to-content link. |
| β‘ Performance | Load Bootstrap and Font Awesome from CDN or enqueue minified versions; consider removing unused grid/reboot CSS. |
| π Font Awesome | Either load fontawesome/css/all.min.css in header or remove the directory to reduce theme size. |
| π€ Local Fonts | Enable local Play font as fallback: uncomment @font-face src and point to fonts/Play-Regular.ttf. |
| π± Responsive | Test and fix Bootstrap 4 grid classes (col-* instead of col-xs-*). |
| π§Ή Code Cleanup | Remove index.php.noblock, commented code, and debug strings before production. |
| πΆ Child Theme | If extending, create a child theme to preserve customizations across updates. |
- π΄ Fix
clear: both;instyle.css - π΄ Create
loop-page.phpor fixtemplate-page-full-width.php - π΄ Add
<?php wp_head(); ?>before</head> - π‘ Replace
wp_list_cats()withwp_list_categories() - π‘ Uncomment/add Bootstrap JS before
</body> - π‘ Replace hardcoded URLs with
get_stylesheet_directory_uri() - π‘ Replace
col-xs-*withcol-* - π’ Remove debug text from
page-cooking.php - π’ Fix font fallback stack
- π‘ Create
functions.phpfor proper asset enqueuing
Custom license: "Screw You Hippy" β consult author for usage terms.
Mike Lindner
π mikelindner.com.au Β· π GitHub