Skip to content

gitrvc-hub/WP-cms-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Headless CMS Theme for WordPress

A minimal WordPress headless CMS theme designed for real estate platforms with comprehensive REST API support.

Theme Information

  • Theme Name: Headless CMS Theme
  • Version: 1.1.0
  • Author: E4Dev
  • Description: Headless WordPress theme with REST API support for real estate platforms
  • Requires WordPress: 6.0+
  • Requires PHP: 7.4+
  • License: GPL v2 or later

Features

Custom Post Types

1. Agents

Real estate agent profiles with comprehensive metadata:

  • Agent name, title, and professional bio
  • Contact information (phone, email, office details)
  • Professional metrics (rating, reviews, properties sold)
  • Experience and specialties
  • License information
  • Languages spoken
  • Awards and certifications
  • Social media links (Facebook, Twitter, Instagram, LinkedIn, YouTube, TikTok)
  • Personal website

2. IDX Pages

Dynamic city and service pages with rich content (IDX - Internet Data Exchange):

  • Page type (information, city, service, landing)
  • Page description and area details
  • Primary city and additional cities
  • State information
  • Area descriptions
  • Amenities (JSON array)
  • Local attractions (JSON array)
  • School districts (JSON array)
  • Median home price
  • Market trends
  • Contact information
  • Auto-fetch properties feature
  • Properties limit configuration
  • Featured listings (JSON array)
  • SEO settings (meta title, meta description)
  • Navigation settings (show in nav, nav order, parent page)

REST API Support

All custom post types and their metadata are fully exposed via the WordPress REST API:

  • Posts: /wp-json/wp/v2/posts
  • Agents: /wp-json/wp/v2/agent
  • IDX Pages: /wp-json/wp/v2/idx_page
  • All Routes: /wp-json/

Installation

  1. Upload the theme folder to /wp-content/themes/
  2. Activate the theme in WordPress Admin → Appearance → Themes
  3. Configure permalinks to "Post name" in Settings → Permalinks
  4. Verify REST API access at /wp-json/

Usage

Creating Agents

  1. Navigate to Agents → Add New Agent in WordPress Admin
  2. Fill in the agent details in the meta boxes:
    • Agent Details (name, title, bio, experience, specialties)
    • Contact Information (phone, email, office, languages)
    • Professional Information (rating, reviews, properties sold, license, awards, certifications)
    • Social Media & Website (all social platform links)
  3. Publish the agent

Creating IDX Pages

  1. Navigate to IDX Pages → Add New IDX Page
  2. Fill in the page details in the meta boxes:
    • IDX Page Details (type, description, cities, amenities, attractions, etc.)
    • SEO Settings (meta title, meta description)
    • Navigation Settings (show in nav, order, parent page)
  3. Publish the page

Accessing via REST API

All data is available through the WordPress REST API. Example requests:

# Get all agents
GET /wp-json/wp/v2/agent

# Get single agent
GET /wp-json/wp/v2/agent/{id}

# Get all IDX pages
GET /wp-json/wp/v2/idx_page

# Get single IDX page
GET /wp-json/wp/v2/idx_page/{id}

All custom fields are included in the API response under the meta property.

Frontend Integration

This theme is designed to work with frontend applications (React, Next.js, Vue, etc.) that consume the WordPress REST API. Configure your application to:

  1. Set the WordPress API URL (e.g., https://your-domain.com/wp-json/)
  2. Fetch data from the custom post type endpoints
  3. Parse and display the custom field data

Admin Features

  • Custom admin columns for quick overview of content
  • Organized meta boxes for easy content management
  • Real-time validation for email and phone fields
  • Auto-formatting for phone numbers
  • JSON validation for array fields
  • Helpful descriptions and placeholders

Theme Structure

theme/
├── style.css       # Theme header and basic styles
├── functions.php   # All custom post types, meta boxes, and REST API setup
├── index.php       # Landing page with API endpoints and documentation
└── screenshot.png  # (optional) Theme screenshot

Development Notes

  • All custom fields are registered for REST API exposure
  • Meta boxes include proper nonce verification and sanitization
  • Admin UI includes inline validation and helpful styling
  • The theme uses WordPress best practices for security and performance

License

This theme is licensed under GPL v2 or later.

About

Headless WordPress CMS theme for real estate platforms with REST API support

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors