Location Templates
Location templates allow you to create custom layouts for different parts of your WordPress site and assign them to specific locations, pages, or conditions.
Understanding Locations
Section titled “Understanding Locations”Locations are the different areas of your WordPress site where you can apply custom templates:
- Header: Site-wide or conditional headers
- Footer: Site-wide or conditional footers
- Single: Individual post/page layouts
- Archive: Category, tag, and taxonomy archive pages
- 404 Page: Error page layout
- Search Results: Search results page layout
Creating Location Templates
Section titled “Creating Location Templates”Basic Workflow
Section titled “Basic Workflow”- Create Template: Design your template in Elementor
- Choose Location: Select where the template should appear
- Set Conditions: Define when and where it displays
- Publish: Make the template live
Step-by-Step Process
Section titled “Step-by-Step Process”- Go to WPBits AFE → Theme Builder
- Click Add New Template
- Select a Location Type:
- Header
- Footer
- Single Post
- Single Page
- Archive
- 404
- Search Results
- Name your template descriptively
- Click Create Template
- Design with Elementor
- Set display conditions
- Publish
Display Conditions
Section titled “Display Conditions”Display conditions control when and where your templates appear.
Global Templates
Section titled “Global Templates”Apply to all pages of a type:
- All Pages: Every page on the site
- All Posts: Every blog post
- All Archives: All archive pages
Specific Templates
Section titled “Specific Templates”Target specific content:
- Specific Page: Single page by ID
- Specific Post: Single post by ID
- Specific Category: Posts in a category
- Specific Tag: Posts with a tag
- Specific Custom Post Type: All posts of a CPT
Advanced Conditions
Section titled “Advanced Conditions”Combine multiple conditions:
- Include: Pages where template shows
- Exclude: Pages where template doesn’t show
Example:
- Include: All Posts
- Exclude: Category “News”
- Result: Shows on all posts except those in News category
Template Priority
Section titled “Template Priority”When multiple templates match a location, WPBits uses a priority system:
Priority Order (Highest to Lowest)
Section titled “Priority Order (Highest to Lowest)”- Specific ID: Template assigned to post ID #123
- Specific Term: Template for “Design” category
- Post Type: Template for all “Posts”
- Global: Template for all content
Example Scenario:
You have:
- Template A: All Posts (Global)
- Template B: Category “News”
- Template C: Post ID #456 (in News category)
When viewing post #456:
- Template C displays (highest priority - specific ID)
When viewing other posts in News:
- Template B displays (category-specific)
When viewing posts not in News:
- Template A displays (global fallback)
Common Location Types
Section titled “Common Location Types”Single Post Templates
Section titled “Single Post Templates”Custom layout for blog posts:
Available Widgets:
- [WPBits] Post Title
- [WPBits] Post Content
- [WPBits] Breadcrumb
- Featured Image (standard Elementor widget)
- Author Box (custom or widget)
- Related Posts (using Grid Master)
- Comments (standard or custom)
Common Elements:
Section: Hero/Header├── Breadcrumb├── Post Title├── Post Meta (Date, Author, Categories)└── Featured Image
Section: Content└── Post Content
Section: Author Bio└── Author information
Section: Related Posts└── Grid Master (related posts query)
Section: Comments└── Comments widgetSingle Page Templates
Section titled “Single Page Templates”Custom layout for pages:
Use Cases:
- Landing pages
- About page
- Contact page
- Service pages
Typical Structure:
- No breadcrumbs (often)
- Page title (if needed)
- Page content
- Custom sections
- Call-to-action
Archive Templates
Section titled “Archive Templates”See detailed Archive Templates documentation.
404 Error Templates
Section titled “404 Error Templates”Custom error page:
Elements to Include:
- Friendly error message
- Search box
- Popular posts
- Navigation menu
- Link to homepage
- Suggested content
Example Layout:
Section: 404 Message├── Heading: "404 - Page Not Found"├── Text: Friendly message└── Search Widget
Section: Helpful Links└── Grid Master (popular posts)
Section: CTA└── Button: "Back to Homepage"Search Results Templates
Section titled “Search Results Templates”Custom search results page:
Elements:
- Search query display
- Results count
- Grid Master (Global Query)
- Search form (to refine)
- Breadcrumbs
Conditional Headers & Footers
Section titled “Conditional Headers & Footers”Create different headers/footers for different pages:
Example Use Cases
Section titled “Example Use Cases”Transparent Header for Homepage:
- Create “Homepage Header” template
- Design with transparent background
- Set condition: Display on Homepage only
Minimal Header for Landing Pages:
- Create “Landing Page Header” template
- No navigation menu, just logo
- Set condition: Display on specific pages (landing pages)
Shop Header with Cart:
- Create “Shop Header” template
- Include WooCommerce cart icon
- Set condition: Display on Shop pages only
Managing Multiple Templates
Section titled “Managing Multiple Templates”Organization Tips
Section titled “Organization Tips”-
Naming Convention: Use descriptive names
- “Header - Main Site”
- “Header - Homepage”
- “Header - Landing Pages”
- “Single Post - Default”
- “Single Post - News Category”
-
Documentation: Keep notes on what each template is for
-
Regular Cleanup: Delete unused templates
Viewing All Templates
Section titled “Viewing All Templates”In WPBits AFE → Theme Builder:
- See all created templates
- View assigned locations
- Check status (published/draft)
- Edit or delete templates
Best Practices
Section titled “Best Practices”Design
Section titled “Design”- Consistency: Maintain design consistency across similar templates
- Responsive: Test all templates on mobile/tablet
- Accessibility: Use proper heading hierarchy
- Performance: Optimize images and scripts
Content
Section titled “Content”- Dynamic Content: Use dynamic widgets when possible
- Fallbacks: Provide defaults when data is missing
- Testing: Preview templates on different content types
Maintenance
Section titled “Maintenance”- Regular Audits: Review templates periodically
- Update Compatibility: Test after plugin/theme updates
- Backup: Export templates before major changes
Importing/Exporting Templates
Section titled “Importing/Exporting Templates”Export Templates
Section titled “Export Templates”- Open template in Elementor
- Click the down arrow next to Update
- Select Export Template
- Save the JSON file
Import Templates
Section titled “Import Templates”- In WPBits AFE → Theme Builder
- Click Import Template
- Upload the JSON file
- Template is added to your library
Use Cases:
- Migrate between sites
- Share templates with team
- Backup before changes
- Use across client projects
Troubleshooting
Section titled “Troubleshooting”Template Not Displaying
Section titled “Template Not Displaying”Check:
- Template is published (not draft)
- Display conditions are correct
- No higher-priority template is overriding
- Cache is cleared
Content Not Showing
Section titled “Content Not Showing”Check:
- Using correct dynamic widgets
- Post/page has content
- Widget settings are configured properly
- Preview mode vs actual page view
Conflicts with Theme
Section titled “Conflicts with Theme”Solutions:
- Use a minimal/blank theme
- Disable theme’s header/footer via theme settings
- Use CSS to hide theme elements
- Contact theme support about Theme Builder compatibility
Multiple Templates Conflicting
Section titled “Multiple Templates Conflicting”Solution:
- Review template priority
- Check display conditions for overlaps
- Use more specific conditions
- Temporarily disable templates to identify conflict
Advanced Techniques
Section titled “Advanced Techniques”Conditional Content Within Templates
Section titled “Conditional Content Within Templates”Use Elementor’s display conditions to show/hide sections:
Example:
- Show banner on homepage only (within global header)
- Hide sidebar on specific pages (within single post template)
- Show promo bar for non-logged-in users
Dynamic Template Selection
Section titled “Dynamic Template Selection”Use custom code to programmatically assign templates:
// Example: Different templates based on custom fieldadd_filter('wpbits_template_id', function($template_id, $location) { if ($location === 'single' && get_field('custom_layout')) { return get_field('custom_layout'); } return $template_id;}, 10, 2);Next Steps
Section titled “Next Steps”Now that you understand location templates:
Support
Section titled “Support”Need help with location templates?