Overview
The VertiSub theme implements a comprehensive template system that extends WordPress’s template hierarchy with custom page templates for specific use cases. All custom templates are organized in thetemplates/ directory.
Template Hierarchy
Default Templates
These templates follow WordPress’s standard template hierarchy:index.php
The fallback template for all content types.single.php
Displays individual posts and custom post types.- ACF gallery field support with Bootstrap carousel
- Conditional layout based on gallery presence
- Featured image fallback
- Content rendering with
the_content()
header.php
Site header with navigation.footer.php
Site footer with scripts and widgets.Custom Page Templates
All custom templates are located intemplates/ directory and use the WordPress Page Template system.
Home Template
File:templates/home-template.phpTemplate Name: Home The homepage template with multiple dynamic sections.
Template Declaration
Key Features
1. Banner CarouselServices Page Template
File:templates/services-page.phpTemplate Name: Servicios Dynamic service listing filtered by country slug from URL.
URL-Based Country Filtering
Service Card Display
WhatsApp Integration
Contact Information Display
Additional Page Templates
The theme includes several other specialized templates:courses-page.php
- Course catalog display
- Instructor relationships
- Enrollment links
- Course modalities
certifications-page.php
- Certification showcase
- Gallery displays
about-us-page.php
- Company information
- Team members
- Company history
location-page.php
- Interactive map with amCharts
- Country office information
- Contact details per location
news-page.php
- News listing
- Post archives
policies-vertisub.php
- Policy content
- Legal information
privacity-page.php
- Privacy policy
- Data protection
works-page.php
- Project portfolio
- Case studies
Template Parts
Reusable template components:components/floating-buttons.php
Floating action buttons for social media and contact.loader.php
Loading animation displayed while page loads.ACF Field Access in Templates
All templates use the utility function for ACF field access:Best Practices
1. Conditional Template Sections
Always check if ACF data exists before rendering:2. Escape Output
Always escape output for security:3. Use get_template_part()
For reusable components:4. Enqueue Template-Specific Assets
Use conditional loading:5. Reset Post Data
Always reset after custom queries:Template Selection
To assign a template to a page:- Edit page in WordPress admin
- Look for “Page Attributes” or “Template” metabox
- Select template from dropdown
- Publish/Update page
Creating New Templates
Step 1: Create Template File
Create file intemplates/ directory:
Step 2: Add ACF Fields
Configure ACF field groups for your template.Step 3: Enqueue Assets (if needed)
Add conditional loading ininc/enqueue.php:
Related Documentation
- Theme Architecture - Overall theme structure
- Custom Post Types - Using CPTs in templates
- ACF Integration - Advanced Custom Fields usage

