WordPress post and custom post type layout generator

Installs: 395

Dependents: 5

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 2


dev-master 2022-06-06 23:26 UTC

This package is auto-updated.

Last update: 2022-06-06 23:26:49 UTC


WordPress post and custom post type layouts


To use Jankx post layout you must have a Template engine before create post layout instance.

Create template Engine

Please choose your favorite template Engine. in this example I was use Plates engine

use Jankx\TemplateEngine\Engine\Plates;

$engine = Plates::create('your_engine_id');

// Set up directory include templates

// Setup template engine Environment

Create post layout instance.

Please create post layout instance before call init hook to ensure all features is working correctly.

use Jankx\PostLayout\PostLayoutManager;

$postLayoutManager = PostLayoutManager::createInstance($engine);

Create a post layout

Note $wp_query is a instance of WP_Query of WordPress core. If $wp_query is not set, Post Layout will be use global $wp_query variable.

$cardLayout = $postLayoutManager->createLayout('card', $wp_query);

// Show post layout content to end user.

Layout supports

  • Card
  • Grid
  • List
  • Carousel
  • Tabs