Sinag: A Free WordPress Block Theme for Philippine Small Businesses
Many small businesses around Bukidnon finally get a website, only to end up with a heavy page-builder theme that crawls on mobile data, and a phone number typed into a dozen places that all go stale the day the number changes. I built Sinag, a free WordPress block theme that loads no theme JavaScript, comes with sections made for cafés, stores, clinics and cooperatives, and lets the owner type their phone, hours and address once.
Sinag is Filipino for ray of light. It runs on WordPress Full Site Editing with theme.json version 3, ships five colour styles, and uses the WordPress Block Bindings API so the header, footer, hero buttons and contact card all read from one Business Details screen.
Try It: Restyle a Café Site in One Click
This is a sample café homepage built from Sinag's patterns. Pick a style variation, then type a new phone number and watch the top bar, the Call button and its +63 link update together.
Build Footprint & Quality Checks
Most of my clients' visitors are on mobile data, so the theme had to stay small. These are the measured numbers from the v1.0.0 build:
Technology Stack & Architecture Layers
WordPress 6.6+ Full Site Editing
Eight HTML templates, two template parts and ten PHP patterns, all editable in Appearance → Editor.
JSON: theme.json v3
A seven-colour palette, fluid type and spacing scales, plus four style variations in styles/ that reuse the same slugs.
PHP: Settings & Block Bindings
A Business Details screen built on the Settings API, and a sinag-theme/business binding source that fills blocks at render time.
PHP 55% · JSON 21% · HTML 11%
Plus CSS 7% for the few things theme.json can't do, and JavaScript 6% for the Node test script. No build step.
Key Architectural Decisions
Type It Once
Phone, email, address, hours and chat link live in one option. Paragraphs and buttons ask the binding source for them, so a new number updates every section.
Slugs, Never Hex Codes
Patterns only reference base, contrast and accent. A style variation swaps seven values and the whole site follows, with WCAG contrast checked by a test script.
Sanitize In, Escape Out
The Settings API adds the nonce, each field is cleaned by type, javascript: links are rejected, and the binding callback escapes every value it returns.
No Scripts, No Font Files
The FAQ uses the native Details block, the hero's sun is a CSS gradient, and headings use system serif fonts. The theme itself enqueues one small stylesheet.
Binding Source, +63 Call Links & Usage
These are the pieces behind "type it once": the binding callback WordPress calls while rendering, the helper that turns local numbers into international Call links, and the block markup that uses them.
// inc/business-details.php
function sinag_theme_business_binding_value( $source_args, $block_instance, $attribute_name ) {
unset( $block_instance );
$key = isset( $source_args['key'] ) ? sanitize_key( $source_args['key'] ) : '';
$data = sinag_theme_get_business();
switch ( $key ) {
case 'phone_link':
$value = sinag_theme_phone_to_tel( $data['phone'] );
break;
case 'email_link':
$value = $data['email'] ? 'mailto:' . $data['email'] : '';
break;
default:
$value = isset( $data[ $key ] ) ? $data[ $key ] : '';
}
if ( '' === $value ) {
return null;
}
// URL attributes are encoded by the HTML API when written; rich-text content is inserted as HTML.
if ( in_array( $attribute_name, array( 'url', 'href' ), true ) ) {
return 0 === strpos( $value, 'tel:' ) || 0 === strpos( $value, 'mailto:' ) ? $value : esc_url_raw( $value );
}
return esc_html( $value );
}
register_block_bindings_source(
'sinag-theme/business',
array(
'label' => __( 'Business Details', 'sinag-theme' ),
'get_value_callback' => 'sinag_theme_business_binding_value',
)
);
// inc/helpers.php — pure PHP, unit-tested without WordPress
function sinag_theme_phone_to_tel( $phone ) {
$phone = trim( (string) $phone );
$digits = preg_replace( '/\D/', '', $phone );
if ( '' === $digits ) {
return '';
}
if ( 0 === strpos( $phone, '+' ) ) {
return 'tel:+' . $digits;
}
if ( 0 === strpos( $digits, '63' ) && 12 === strlen( $digits ) ) {
return 'tel:+' . $digits;
}
if ( 0 === strpos( $digits, '0' ) && strlen( $digits ) >= 9 && strlen( $digits ) <= 11 ) {
return 'tel:+63' . substr( $digits, 1 );
}
return 'tel:' . $digits;
}
<!-- Any paragraph can print a Business Details field -->
<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"sinag-theme/business","args":{"key":"hours"}}}}} -->
<p>Mon–Sat 7:00 AM – 6:00 PM · Sun closed</p>
<!-- /wp:paragraph -->
<!-- A button's link can be the +63 Call link or your Messenger URL -->
<!-- wp:button {"metadata":{"bindings":{"url":{"source":"sinag-theme/business","args":{"key":"phone_link"}}}}} -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="tel:+639170000000">Call us</a></div>
<!-- /wp:button -->
// styles/dagat.json — a whole new look is seven colours with the same slugs
{ "version": 3, "title": "Dagat",
"settings": { "color": { "palette": [
{ "slug": "base", "color": "#f3f8fb" }, { "slug": "contrast", "color": "#0b2533" },
{ "slug": "accent", "color": "#0d7fa5" }, { "slug": "on-accent", "color": "#ffffff" } ] } } }
Development Roadmap & Milestones
Version 1.0.0 is released. The next milestones come straight from the project's roadmap:
v1.0.0: Core Theme (Released)
Five style variations, eight templates, ten patterns, three block styles, Business Details with Block Bindings and automatic +63 Call links.
Next: Live Values in the Editor
Register the binding source in JavaScript too, so the Site Editor shows the real phone and hours instead of the pattern's sample text.
Planned: Schools, LGUs & Clinics
New variations and patterns for enrollment notices, office directories, clinic schedules and a printable menu.
Planned: WooCommerce Templates
Shop, product and cart templates styled from the same palette, for small stores that want to take orders online.
User Interface & Feature Showcase
Project Links, Code & Documentation
Download & Live Demo
Get sinag-theme.zip and install it under Appearance → Themes → Add New → Upload Theme, or try the interactive preview first.
GitHub Repository
Browse the source, grab the v1.0.0 release, or open an issue. The theme is free and open source under GPL-2.0-or-later.
How It Was Built
A plain-language build log: the languages used, every step in order, the tests that ran and the problems fixed along the way.
A Light Theme That Stays Up to Date
Block themes put the design in data, so a whole new look is seven colours and the owner's details live in one place. Sinag gives small businesses a fast site they can actually keep current. Want it set up for your shop, clinic or cooperative, with your menu and photos?
Kapehan sa Burol, its prices and its phone number are fictional sample content. In version 1.0.0 the editor shows each pattern's sample text; your saved Business Details appear on the live site.

Comments
Post a Comment