JPKCom Theme is LiveCanvas friendly — Guide & Tips
Mark any WordPress theme as LiveCanvas-compatible — installation, Bootstrap version and the required empty page template.
JPKCom Theme is LiveCanvas friendly tells LiveCanvas (opens in a new tab) that your active theme is LiveCanvas-compatible. The plugin provides the helper functions lc_theme_is_livecanvas_friendly() and lc_theme_bootstrap_version(), so you don't have to add these functions to your theme yourself.
Guide
Requirements
- WordPress 6.9 or newer (tested up to WordPress 7.1)
- PHP 8.3 or newer
- The LiveCanvas plugin (declared in the header as
Requires Plugins: livecanvas) must be active
Installation
- In your admin panel, go to Plugins → Add New and click Upload Plugin.
- Choose the plugin's ZIP file and click Install Now.
- Make sure the LiveCanvas plugin is activated.
- Click Activate.
- Create a subdirectory called
page-templatesin your theme folder. - In it, create a file
empty.phpwith the following content:
<?php
/* Template Name: Empty */
defined( 'ABSPATH' ) || exit;
get_header();
while ( have_posts() ) :
the_post();
the_content();
endwhile;
get_footer();Bootstrap version
lc_theme_bootstrap_version() tells LiveCanvas which Bootstrap version your theme uses. Per the README example, the function returns 5.3 for the latest Bootstrap; alternatively 5 (Bootstrap 5.0–5.2) or 4 (Bootstrap 4) are possible.
Tips & Tricks
- The empty template is required: Without
page-templates/empty.phpin your theme, LiveCanvas lacks the blank template it builds its content on. Create it exactly as shown in the README. - Helpers are guarded: Since version 1.0.4 the LiveCanvas helper functions are protected with
function_exists()— so they won't collide if your theme already defines the same functions. - Adjust the Bootstrap version: Set the return value of
lc_theme_bootstrap_version()to the Bootstrap version your theme actually uses. - Reproducible updates: Since version 1.0.4 the plugin uses secure self-hosted updates via GitHub with SHA256 checksums and runs with
declare(strict_types=1). Since 1.0.10 it also carries theUpdate URIheader: the wordpress.org update API then no longer returns updates for this plugin, so a plugin published there under the same slug cannot pose as an update. Since 1.0.11 Dashboard → Updates shows the JPKCom logo as the plugin icon. - Updates even while deactivated: Since 1.0.12 the plugin ships updater 1.5.0. One loaded updater 1.5.0 answers the update check for all installed JPKCom plugins, active or not, with the update row, icon and “View details” — so this plugin is offered updates while deactivated only if another JPKCom plugin with updater 1.5.0 or newer is active, on multisite network-wide or on the main site. The SHA256 check applies exactly as for an active plugin. The stored update list no longer contains JPKCom download URLs; they are added back only while a JPKCom updater is loaded, so no unverified package can be installed without one. The check also verifies packages supplied by another plugin and recognises every GitHub address of a release file. If the plugin is a Git or other version-control checkout or, while it is active, sits in a renamed folder (such as
jpkcom-is-lc-friendly-mainfrom a GitHub source download), you are told about new versions, but WordPress never updates it — the update would delete the checkout or the folder. If it sits deactivated in a renamed folder, the updater does not find it at all, and you are not told about new versions. The updater fetches update information only for accounts that can update plugins, in the update cron and in WP-CLI, never for anonymous visitors.