Skip to content

ampry/one

Repository files navigation

One Theme - WordPress Theme for Government Benefits Sites

A modern, ACF-powered WordPress theme designed for government benefits information websites.

Version: 2.0

Features

  • ACF-Driven Content β€” All content managed through Advanced Custom Fields
  • Modular ACF Architecture β€” 18 field group files, each handling a specific feature
  • LESS CSS Pipeline β€” Organized LESS partials compiled to a single minified style.css
  • Section Toggles β€” Show/hide blog CTA and newsletter via Theme Settings
  • Responsive Design β€” Mobile-first approach
  • Custom Post Types β€” Glossary & Directory types included
  • SEO Ready β€” Schema markup for FAQs, breadcrumbs
  • Cloud Optimized β€” Works on Railway, AWS, or any cloud platform
  • Reusable Partials β€” Newsletter, breadcrumbs, byline, etc. shared across templates

Installation

Via GitHub (Recommended for Railway)

  1. Clone into themes directory:

    cd wp-content/themes/
    git clone https://github.com/YOUR_USERNAME/one-theme.git one
  2. Activate in WordPress:

    • Go to Appearance β†’ Themes
    • Activate "Ampry One"

Manual Upload

  1. Download ZIP from GitHub
  2. WordPress Admin β†’ Appearance β†’ Themes β†’ Add New β†’ Upload
  3. Activate theme

Required Plugins

Must Install:

  • Advanced Custom Fields PRO (for all theme options)

Recommended:

  • Yoast SEO (for better SEO)
  • WP Mail SMTP (for form emails)

Configuration

All theme settings are in WordPress Admin β†’ Theme Settings:

1. Colors & Typography

  • Primary colors (outputs CSS :root variables)
  • Font families
  • Button styles

2. Identity

  • Site logo, favicon (via WordPress Customizer β†’ Site Identity)
  • Google Analytics & Facebook Pixel tracking codes
  • Custom CSS injection

3. Header / Navigation

  • Logo upload
  • Top bar text
  • CTA button
  • Menu items

4. Footer Settings

  • Footer logo
  • Footer columns (3 columns with links)
  • Copyright text
  • Social media links (Facebook, X, Instagram, YouTube, LinkedIn)

5. Homepage Sections

Toggle each section on/off:

  • Hero Banner
  • Perks (3 feature boxes)
  • Get Started
  • Featured Programs
  • Mission Statement
  • As Seen In
  • Recent Articles
  • Testimonials
  • FAQ
  • Newsletter

6. Blog Settings

  • Header β€” Eyebrow text, hero background image
  • Visibility β€” Toggle CTA and Newsletter sections on/off
  • Categories β€” Blog menu pill-link categories
  • CTA β€” Title, description, button text/URL, background type (image or color), section background color

7. Custom Post Types

  • Glossary Terms β€” For benefits glossary
  • Directory β€” State-by-state directories

File Structure

one/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”œβ”€β”€ style.less              # LESS entry point (imports all partials)
β”‚   β”‚   β”œβ”€β”€ style.css               # Compiled & minified CSS
β”‚   β”‚   β”œβ”€β”€ _reset.less             # CSS reset
β”‚   β”‚   β”œβ”€β”€ _mixins.less            # LESS mixins (.rounded, .clearfix, etc.)
β”‚   β”‚   β”œβ”€β”€ _grid.less              # Grid system
β”‚   β”‚   β”œβ”€β”€ _colors.less            # Color variables (@grey-100, @grey-200, etc.)
β”‚   β”‚   β”œβ”€β”€ _typography.less        # Font styles
β”‚   β”‚   β”œβ”€β”€ _base.less              # Base element styles
β”‚   β”‚   β”œβ”€β”€ _responsive.less        # Media queries
β”‚   β”‚   β”œβ”€β”€ sections/               # Section-specific styles
β”‚   β”‚   β”‚   β”œβ”€β”€ _header.less
β”‚   β”‚   β”‚   β”œβ”€β”€ _footer.less
β”‚   β”‚   β”‚   β”œβ”€β”€ _breadcrumbs.less
β”‚   β”‚   β”‚   β”œβ”€β”€ _article-header.less
β”‚   β”‚   β”‚   β”œβ”€β”€ _article.less
β”‚   β”‚   β”‚   └── _category-header.less
β”‚   β”‚   └── pages/                  # Page-specific styles
β”‚   β”‚       β”œβ”€β”€ _front-page.less
β”‚   β”‚       β”œβ”€β”€ _about.less
β”‚   β”‚       β”œβ”€β”€ _how-it-works.less
β”‚   β”‚       β”œβ”€β”€ _blog.less
β”‚   β”‚       └── _category.less
β”‚   β”œβ”€β”€ js/
β”‚   β”‚   └── app.js                  # Theme JS
β”‚   └── images/                     # Default images
β”œβ”€β”€ inc/
β”‚   β”œβ”€β”€ auto-update.php             # Theme updates
β”‚   β”œβ”€β”€ setup-pages.php             # Page creation & CPT registration
β”‚   β”œβ”€β”€ ajax-handlers.php           # AJAX functions
β”‚   └── settings/                   # ACF settings (modular architecture)
β”‚       β”œβ”€β”€ options-pages.php       # Options page registration
β”‚       β”œβ”€β”€ defaults.php            # Default ACF values on activation
β”‚       β”œβ”€β”€ css-output.php          # :root CSS variable generation
β”‚       β”œβ”€β”€ head-output.php         # Analytics, pixels, custom CSS
β”‚       β”œβ”€β”€ helpers.php             # Utility functions
β”‚       └── field-groups/           # One file per feature
β”‚           β”œβ”€β”€ about.php
β”‚           β”œβ”€β”€ banner.php
β”‚           β”œβ”€β”€ blog.php
β”‚           β”œβ”€β”€ category.php
β”‚           β”œβ”€β”€ colors.php
β”‚           β”œβ”€β”€ directory.php
β”‚           β”œβ”€β”€ faqs.php
β”‚           β”œβ”€β”€ featured-post.php
β”‚           β”œβ”€β”€ footer.php
β”‚           β”œβ”€β”€ front-page.php
β”‚           β”œβ”€β”€ how-it-works.php
β”‚           β”œβ”€β”€ identity.php
β”‚           β”œβ”€β”€ navigation.php
β”‚           β”œβ”€β”€ page.php
β”‚           β”œβ”€β”€ reviewer.php
β”‚           β”œβ”€β”€ survey.php
β”‚           β”œβ”€β”€ typography.php
β”‚           └── user.php
β”œβ”€β”€ templates/                      # Custom page templates
β”‚   β”œβ”€β”€ about.php
β”‚   β”œβ”€β”€ blog.php
β”‚   β”œβ”€β”€ how-it-works.php
β”‚   β”œβ”€β”€ survey.php
β”‚   └── glossary.php
β”œβ”€β”€ template-parts/
β”‚   β”œβ”€β”€ components/                 # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ article.php
β”‚   β”‚   β”œβ”€β”€ article-header.php
β”‚   β”‚   β”œβ”€β”€ breadcrumbs.php
β”‚   β”‚   β”œβ”€β”€ byline.php
β”‚   β”‚   β”œβ”€β”€ category-header.php
β”‚   β”‚   └── featured-image.php
β”‚   └── sections/                   # Page sections & layouts
β”‚       β”œβ”€β”€ nav.php
β”‚       β”œβ”€β”€ page-header.php
β”‚       β”œβ”€β”€ page-menu.php
β”‚       β”œβ”€β”€ sidebar-widgets.php
β”‚       β”œβ”€β”€ blog-header.php
β”‚       β”œβ”€β”€ blog-menu.php
β”‚       β”œβ”€β”€ newsletter.php
β”‚       β”œβ”€β”€ author-header.php
β”‚       β”œβ”€β”€ single-post.php
β”‚       └── map.php
β”œβ”€β”€ acf-json/                       # ACF JSON (Directory post type fields)
β”œβ”€β”€ front-page.php                  # Homepage template
β”œβ”€β”€ single.php                      # Single post
β”œβ”€β”€ page.php                        # Generic page
β”œβ”€β”€ 404.php                         # 404 page
β”œβ”€β”€ index.php                       # Fallback archive
β”œβ”€β”€ category.php                    # Category archive
β”œβ”€β”€ author.php                      # Author archive
β”œβ”€β”€ archive-directory.php           # Directory archive
β”œβ”€β”€ archive-glossary.php            # Glossary archive
β”œβ”€β”€ single-directory.php            # Single directory entry
β”œβ”€β”€ single-glossary.php             # Single glossary term
β”œβ”€β”€ functions.php                   # Theme functions
β”œβ”€β”€ header.php                      # Site header
β”œβ”€β”€ footer.php                      # Site footer
β”œβ”€β”€ style.css                       # Theme info (WP metadata)
└── package.json                    # LESS build scripts

Developer Guide

Compiling LESS to CSS

The theme uses LESS as a CSS preprocessor. The compiled style.css is committed to the repo (there is no CI/CD build step), so you must compile locally after any .less changes.

Setup (one-time)

cd one-theme-repo
npm install

This installs less and nodemon as dev dependencies.

Compile

# One-time build (minified)
npm run build:css

# Watch mode (auto-recompiles on any .less file change)
npm run watch:css

Both commands run:

lessc --compress assets/css/style.less assets/css/style.css

LESS File Conventions

  • Entry point: assets/css/style.less β€” imports all partials in order
  • Partials are prefixed with _ (e.g., _header.less) and are never compiled on their own
  • Import order matters: reset β†’ mixins β†’ grid β†’ colors β†’ typography β†’ base β†’ sections β†’ pages β†’ responsive
  • Variables & mixins go in _colors.less and _mixins.less

Adding a New LESS Partial

  1. Create the file in the appropriate folder:
    • assets/css/sections/_my-section.less for section styles
    • assets/css/pages/_my-page.less for page-specific styles
  2. Add the import to assets/css/style.less:
    @import "sections/_my-section";
  3. Run npm run build:css to compile
  4. Commit both the .less file and the updated style.css

ACF Settings Architecture

v2.0 uses a modular architecture β€” field groups are split into individual files under inc/settings/field-groups/. The loader in functions.php auto-includes all PHP files in that directory.

Key Files

File Purpose
inc/settings/options-pages.php Registers all ACF options pages and sub-pages
inc/settings/defaults.php Populates default ACF values on theme activation
inc/settings/css-output.php Generates :root CSS variables from color/typography settings
inc/settings/head-output.php Outputs analytics, pixels, custom CSS to <head>
inc/settings/helpers.php Utility functions used across settings
inc/settings/field-groups/*.php One file per feature (blog, footer, colors, etc.)

Field Group Files

Each file in field-groups/ follows this pattern:

<?php
add_action('acf/init', 'one_register_FEATURE_fields');
function one_register_FEATURE_fields() {
    if (!function_exists('acf_add_local_field_group')) return;

    acf_add_local_field_group(array(
        'key' => 'group_FEATURE',
        'title' => 'Feature Name',
        'fields' => array( /* ... */ ),
        'location' => array(
            array(
                array(
                    'param' => 'options_page',
                    'operator' => '==',
                    'value' => 'theme-settings',
                ),
            ),
        ),
    ));
}

Adding a New Field Group

  1. Create inc/settings/field-groups/my-feature.php
  2. Follow the pattern above β€” use a unique group_ key and field_ prefixed field keys
  3. The file is auto-loaded by functions.php β€” no manual include needed
  4. Target the appropriate options page slug in the location array

Options Page Slugs

Page Slug
Theme Settings (main) theme-settings
Colors acf-options-colors
Typography acf-options-typography
Home Banner acf-options-home-banner
Front Page Content acf-options-front-page-content
Footer acf-options-footer
About Page acf-options-about-page
How It Works acf-options-how-it-works
Navigation acf-options-navigation

Hybrid ACF Approach

The theme uses a hybrid ACF strategy:

  • PHP-registered fields (field-groups/*.php) β€” for all theme settings. These are version-controlled and portable.
  • ACF JSON (acf-json/) β€” only for the Directory custom post type fields. These sync via ACF's built-in JSON sync.

Using Fields in Templates

// Options page fields β€” always pass 'option'
$value = get_field('field_name', 'option') ?: 'Fallback';

// Per-post fields β€” no second argument needed
$value = get_field('field_name');

Always provide a fallback with ?: in case the field hasn't been saved yet.


Customization

Change Brand Name

Default: "Ampry One". Update in:

  1. style.css β€” Theme Name header
  2. front-page.php β€” Mission text & FAQ answers
  3. ACF Options (if values were already saved)

Modify Default Images

Replace images in assets/images/:

  • shield.png β€” Hero stat icon
  • edit_square.png β€” Get Started icon
  • star.png, forum.png, thumb_up.png β€” Perk icons
  • veteran.png, ssdi.png, grants.png β€” Program icons
  • blog-header-bg.webp β€” Blog header hero
  • blog-cta-bg.webp β€” Blog CTA default background

Favicon

Use the built-in WordPress Site Icon: Appearance β†’ Customize β†’ Site Identity β†’ Site Icon

Deployment

Railway

This theme is optimized for Railway deployment:

  1. Push theme to GitHub
  2. Update WordPress Dockerfile to clone theme:
    RUN cd wp-content/themes && \
        git clone https://github.com/YOUR_USERNAME/one-theme.git one
  3. Deploy to Railway
  4. Configure ACF Options in WordPress admin

See railway-wordpress/ in the project root for Docker and Railway config files.

Troubleshooting

Issue: ACF fields not showing

  • Install ACF PRO plugin
  • Fields are auto-registered via PHP β€” no import needed

Issue: Default images not loading

  • Check assets/images/ folder exists
  • Verify file paths in templates

Issue: Custom Post Types not appearing

  • Go to Settings β†’ Permalinks
  • Click "Save Changes" to flush rewrite rules

Issue: CSS changes not reflecting

  • Run npm run build:css after editing any .less file
  • Hard refresh browser (Ctrl+Shift+R)

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

Credits

  • Icons: Material Design Icons
  • Fonts: Google Fonts (Inter, Roboto Serif)
  • Maps: Custom SVG US map

License

This is proprietary software. All rights reserved. Unauthorized copying, distribution, or modification of this code is strictly prohibited.

Changelog

Version 2.0

  • Modular ACF Architecture β€” Split monolithic theme-settings.php into 18 individual field group files under inc/settings/field-groups/
  • LESS CSS Pipeline β€” Consolidated all CSS into organized LESS partials with --compress minification
  • Blog Page Overhaul β€” Customizable eyebrow text, hero image, CTA (background type/color/image), newsletter toggle, menu categories via ACF
  • Reusable Newsletter Partial β€” Shared across front page, blog, and category pages
  • Full Hardcoded Audit β€” Replaced ~75 hardcoded values with ACF fields or sensible defaults
  • Orphan Cleanup β€” Removed 7 unused files, fixed duplicate field name collisions
  • Social Links in Footer β€” Facebook, X, Instagram, YouTube, LinkedIn from ACF
  • Head Output β€” Google Analytics, Facebook Pixel, custom CSS injection
  • Favicon β€” Uses WordPress built-in Site Icon (removed custom ACF field)
  • CSS Variables β€” Dynamic :root color/typography variables from ACF settings
  • Nav Styling Fix β€” Active menu item highlight
  • 404 Console Error Fix β€” Removed broken JS reference

Version 1.1

  • Added section visibility toggles
  • Improved Railway compatibility
  • Enhanced ACF defaults
  • Fixed image fallbacks

Version 1.0

  • Initial release

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •