Voxel Toolkit 1.6.1 is Available!

Compare Posts

The Compare Posts function lets visitors select multiple listings and view them side-by-side in a comparison table. Perfect for helping users make decisions between similar options like hotels, products, or services.


Overview

Visitors can add up to 4 posts to their comparison list, then view them in a detailed side-by-side table. The comparison persists across page visits using browser storage, and syncs across multiple browser tabs automatically.

Key Features

  • Compare 2-4 posts of the same type
  • Compare Button widget for adding posts
  • Comparison Table widget for the comparison page
  • Floating comparison bar
  • Configure which fields to compare per post type
  • Custom field labels and drag-to-reorder
  • Supports all Voxel field types
  • Print comparison table
  • Cross-tab synchronization

Setup Instructions

Step 1: Enable the Function

  1. Navigate to Voxel Toolkit > Functions in your WordPress admin
  2. Find Compare Posts in the list
  3. Toggle the switch to enable the function
  4. Click Save Changes

Step 2: Configure Comparison Fields

  1. Click the settings icon next to Compare Posts
  2. Create and select a page for each post type.
  3. Feel free to change the styling of the floating bar.
  4. Click Save Changes

Step 3: Add Compare Button Action

  1. Open your single post template in Elementor
  2. Using the native “Actions (VX) widget, add a “Compare” action to your preview card or single post template.
  3. Save the template

Step 4: Create Comparison Page

  1. Create a new page for comparisons (e.g., “Compare”)
  2. Edit with Elementor
  3. Add the Comparison Table (VT) widget
  4. Configure table styling
  5. Publish the page

Comparison Table Widget

Displays the side-by-side comparison of selected posts.

Widget Settings

SettingDescription
Show Print ButtonAdd button to print the comparison table
Show Remove ButtonsAllow removing posts from comparison
Empty MessageText shown when no posts are selected
Header StyleStyling for the post title row

Supported Field Types

The comparison table renders all Voxel field types appropriately:

  • Text fields – Displayed as-is
  • Number fields – Formatted with proper decimals
  • Taxonomy fields – Shows term labels
  • Work hours – Formatted schedule display
  • Location – Address display
  • Images – Thumbnail display
  • Yes/No fields – Checkmark or X icons

Print Feature

The comparison table can be printed for offline reference:

  • Portrait format optimized layout
  • Clean styling without navigation elements
  • Properly sized columns for paper
  • Works with browser print dialog

Cross-Tab Sync

The comparison list automatically syncs across browser tabs:

  • Add a post in one tab, it appears in all tabs
  • Remove a post in one tab, it updates everywhere
  • Comparison bar updates in real-time
  • Uses localStorage for persistence

Use Cases

Hotel Comparison

Let guests compare rooms, amenities, prices, and ratings across properties.

Product Comparison

Help shoppers compare features, specifications, and prices of similar products.

Service Providers

Allow users to compare contractors, agencies, or professionals side-by-side.

Real Estate

Compare properties by bedrooms, square footage, price, and amenities.


Troubleshooting

Compare Button Not Working

  • Check that the function is enabled
  • Verify JavaScript is enabled in browser
  • Clear browser cache and localStorage
  • Check browser console for errors
AI Assistant