Page Layout

Page Layout Install Statistics

0
100%
Today: 0 Yesterday: 0 All-time: 8,193 downloads
Page Layout Icon

Try plugin: Page Layout

We'll create fresh WordPress site with Page Layout installed. You have 20 minutes to test the plugin after that site we'll be deleted.

Takes ~10 seconds to install.

About Page Layout

Page Layout allows to define a page layout using widgets.

0


0


0


0


0

updated: 14 years ago
since: 14 years ago
author: Luca Realdi

Description

WARNING: USE ONLY WITH JAVASCRIPT! The backend of this plugin works only with browser with javascript enabled

This plugin allows to dynamically activate the widgets system on a WordPress page, creating complex layouts.

You can define new layout via the function register_layout() in the function.php file of your theme.
The plugin define two sample defaults layouts that you can see in Screenshots section.

e.g.

<?php
// <your_theme>/function.php
if ( function_exists('register_layout') ){
    register_layout(array(
        'name' => 'Name of Layout',
        'zones' => array( 'name of zone one', 'name of zone two', 'name of zone three' [, ...] ),
        'thumbnail' => 'thumbnail-of-layout.jpg', // with extension (jpg/gif/png)
        'template' => 'name-of-php-template-file' // without extension
    ));
}
?>

The code of the new template plans to use a new property of the global object $post: $post-> layout

e.g.

<?php 
$zones = $post->layout['zones'];
foreach ($zones as $zone){
    dynamic_sidebar($zones[0])
}
?>
  • The php template file should be placed in the folder layouts of your theme folder (/wp-content/themes/<your_theme>/layouts/<name-of-php-template-file>.php) or in the plugin folder (/wp-content/plugins/page-layout/layouts/<name-of-php-template-file>.php) if you want the layout to be independent from the theme.

  • The thumbnail should be placed in the child folder of layouts: layouts/thumb/<thumbnail-of-layout.jpg>.

  • If you want to include also a related css file separate from the theme installed you can create it in /wp-content/plugins/page-layout/css/page-layout-general.css or for each php template /wp-content/plugins/page-layout/css/page-layout-<name-of-php-template-file>.css.

  • The plugin include a simple widget to display the content of current page

Licence

This plugin is released under the GPL, you can use it free of charge on your personal or commercial blog.

Translations

If you want to help to translate the plugin to your language, please have a look at the .pot file which contains all defintions and may be used with a gettext editor like Poedit (Windows).
Please refer to the WordPress Codex for more information.