2015-11-28, 08:55:55
I have created the I18N OnePage plugin to simplify the creation of single page themes.
With version 0.9 the API has changed to simplify usage:
For more options consult the header of the plugin file.
If you use the I18N plugin, you can mix normal pages and pages combining multiple pages:
The plugin support I18N, I18N Custom Fields and I18N Special Pages (exception: the code to add custom header content for the special page will not be processed).
With version 0.9 the API has changed to simplify usage:
- At the beginning of the template (before get_header() or similar) specify which pages to display on this page: pass the parent slug of the pages to add (only available if you use the I18N plugin) or nothing (for all pages in the menu) to the set_onepage_content function - this will take care that plugins can access the full content already in the header, as e.g. the I18N Gallery plugin does:
PHP Code:
<?php set_onepage_content('my-parent-slug'); ?>
- add the navigation:
PHP Code:
<?php get_onepage_navigation(); ?>
- wrap get_page_title()/get_page_content() in a loop like that:
PHP Code:
<?php while (next_onepage_content()) { ?>
<h2><?php get_onepage_anchor(); ?><?php get_page_title(); ?></h2>
<?php get_page_content(); ?>
<?php } ?>
For more options consult the header of the plugin file.
If you use the I18N plugin, you can mix normal pages and pages combining multiple pages:
- create a template like described above and use set_onepage_content(return_page_slug())
- create an empty page "my-multipage" and assign it this template
- create other pages as children of this page and add them to the menu.
The plugin support I18N, I18N Custom Fields and I18N Special Pages (exception: the code to add custom header content for the special page will not be processed).