> ## Documentation Index
> Fetch the complete documentation index at: https://help.kenekt.app/llms.txt
> Use this file to discover all available pages before exploring further.

# WordPress Integration

Embed Kenekt property listings directly into your WordPress website while keeping visitors on your domain.

## Overview

The WordPress integration uses iframes to display Kenekt listings within your WordPress site. Key benefits:

* **White-label experience**: Visitors never see the Kenekt domain
* **Full search & filters**: Built-in search, location autocomplete, and filtering
* **Automatic height adjustment**: Iframes resize to fit content
* **SEO-friendly**: WordPress controls meta tags and URLs

## Quick Setup (30 Minutes)

### Step 1: Update functions.php

Using WP File Manager, add this code to your child theme's `functions.php`:

```php theme={null}
// Kenekt Settings Page
function kenekt_settings_page() {
    add_options_page('Kenekt Settings', 'Kenekt', 'manage_options', 'kenekt-settings', 'kenekt_settings_page_html');
}
add_action('admin_menu', 'kenekt_settings_page');

function kenekt_settings_page_html() {
    if (!current_user_can('manage_options')) return;
    if (isset($_POST['kenekt_subdomain'])) {
        update_option('kenekt_subdomain', sanitize_text_field($_POST['kenekt_subdomain']));
        echo '<div class="notice notice-success"><p>Settings saved!</p></div>';
    }
    $subdomain = get_option('kenekt_subdomain', '');
    ?>
    <div class="wrap">
        <h1>Kenekt Integration Settings</h1>
        <form method="post">
            <table class="form-table">
                <tr>
                    <th><label for="kenekt_subdomain">Kenekt Subdomain</label></th>
                    <td>
                        <input type="text" id="kenekt_subdomain" name="kenekt_subdomain"
                               value="<?php echo esc_attr($subdomain); ?>" class="regular-text">
                        <p class="description">Enter subdomain (e.g., "mycompany" for mycompany.kenekt.app)</p>
                    </td>
                </tr>
            </table>
            <?php submit_button(); ?>
        </form>
    </div>
    <?php
}

// Handle property click navigation
function kenekt_iframe_script() {
    ?>
    <script>
    (function() {
      window.addEventListener('message', function(event) {
        if (!event.origin.endsWith('.kenekt.app')) return;
        const data = event.data;

        if (data.type === 'kenekt_property_click') {
          window.location.href = '/listings/' + data.publicUid;
        }

        if (data.type === 'kenekt_iframe_height') {
          const iframe = document.getElementById('kenekt-listings-iframe') ||
                         document.getElementById('kenekt-property-iframe');
          if (iframe && data.height > 0) {
            iframe.style.height = data.height + 'px';
          }
        }
      });
    })();
    </script>
    <?php
}
add_action('wp_footer', 'kenekt_iframe_script');

// URL rewrite for property detail pages
function kenekt_listing_rewrite_rules() {
    add_rewrite_rule(
        '^listings/([^/]+)/?$',
        'index.php?pagename=listings-detail&listing_id=$matches[1]',
        'top'
    );
}
add_action('init', 'kenekt_listing_rewrite_rules');

function kenekt_query_vars($vars) {
    $vars[] = 'listing_id';
    return $vars;
}
add_filter('query_vars', 'kenekt_query_vars');
```

After saving, go to **Settings → Permalinks** and click **Save Changes** to flush rewrite rules.

### Step 2: Create Listings Page Template

Create file: `/wp-content/themes/[your-theme-child]/page-listings.php`

```php theme={null}
<?php
/**
 * Template Name: Listings Page
 */
get_header();

$subdomain = get_option('kenekt_subdomain', 'YOUR-SUBDOMAIN');
$query_params = $_SERVER['QUERY_STRING'];
$iframe_url = "https://{$subdomain}.kenekt.app/listings?layout=minimal";
if (!empty($query_params)) {
  $iframe_url .= '&' . $query_params;
}
?>

<iframe
  id="kenekt-listings-iframe"
  src="<?php echo esc_url($iframe_url); ?>"
  style="width: 100%; border: none; min-height: 100vh;"
  frameborder="0"
  scrolling="no"
></iframe>

<?php get_footer(); ?>
```

Then create a WordPress page with slug `listings` using the **Listings Page** template.

### Step 3: Create Property Detail Template

Create file: `/wp-content/themes/[your-theme-child]/page-listing.php`

```php theme={null}
<?php
/**
 * Template Name: Listing Detail
 */
get_header();

$listing_id = sanitize_text_field(get_query_var('listing_id'));
$subdomain = get_option('kenekt_subdomain', 'YOUR-SUBDOMAIN');
?>

<iframe
  id="kenekt-property-iframe"
  src="https://<?php echo esc_attr($subdomain); ?>.kenekt.app/listings/<?php echo esc_attr($listing_id); ?>?layout=minimal"
  style="width: 100%; border: none; min-height: 100vh;"
  frameborder="0"
  scrolling="no"
></iframe>

<?php get_footer(); ?>
```

Create a WordPress page with slug `listings-detail` using the **Listing Detail** template.

### Step 4: Configure Subdomain

Go to **Settings → Kenekt** in WordPress and enter your Kenekt subdomain.

## Layout Modes

Control what appears in the iframe with the `layout` parameter:

| Mode | Best For | Shows |
| - | - | - |
| `minimal` | WordPress pages | Search, filters, listings (no footer/nav) |
| `full` | Standalone use | Everything including footer |
| `bare` | Campaign pages | Properties only (no search/filters) |
| `search` | Homepage hero | Search form only |

## URL Filter Parameters

Pre-filter listings by adding parameters:

| Parameter | Example | Description |
| - | - | - |
| `states` | `states=NSW,VIC` | Filter by state |
| `suburb` | `suburb=Bondi` | Filter by suburb |
| `bedrooms` | `bedrooms=3,4` | Bedroom count |
| `from_price` | `from_price=500000` | Minimum price |
| `to_price` | `to_price=1000000` | Maximum price |
| `property_types` | `property_types=House` | Property type |
| `tags` | `tags=Featured` | Category tags |

Example: `yoursite.com/listings?states=NSW&bedrooms=3&from_price=600000`

## Live Example

See the integration in action at [brickfieldpropertyservices.com.au/listings](https://www.brickfieldpropertyservices.com.au/listings/)

## Troubleshooting

| Issue | Solution |
| - | - |
| 404 on property pages | Flush permalinks (Settings → Permalinks → Save) |
| Blank iframe | Check subdomain in Settings → Kenekt |
| Height not adjusting | Verify JavaScript in functions.php |
| Properties not loading | Enable public portal in Kenekt settings |

## What Users See

* **Your domain**: yoursite.com throughout
* **Your branding**: WordPress header, footer, styling
* **Kenekt features**: Full search, filters, and property details
* **Seamless experience**: Looks like one integrated site


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.