Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I18N OnePage
#1
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:
  • 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.
If you display "my-multipage", the content of all its children will be displayed on the page.

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).
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
I18N OnePage - by mvlcek - 2015-11-28, 08:55:55
RE: I18N OnePage - by aldebaran - 2015-11-30, 21:30:00
RE: I18N OnePage - by mvlcek - 2015-12-02, 06:35:43
RE: I18N OnePage - by shawn_a - 2015-12-02, 09:13:25
RE: I18N OnePage - by mvlcek - 2015-12-02, 16:57:09
RE: I18N OnePage - by aldebaran - 2015-12-03, 21:38:20
RE: I18N OnePage - by shawn_a - 2015-12-05, 08:04:55
RE: I18N OnePage - by aldebaran - 2015-12-17, 00:54:18
RE: I18N OnePage - by aldebaran - 2015-12-30, 22:33:47
RE: I18N OnePage - by cvrglj - 2016-02-26, 17:44:03
RE: I18N OnePage - by retrofan - 2017-01-03, 19:37:42
RE: I18N OnePage - by pikku - 2017-04-14, 23:52:44
RE: I18N OnePage - by jjancel - 2021-02-17, 05:48:37
RE: I18N OnePage - by datiswous - 2021-02-22, 08:25:12
RE: I18N OnePage - by Oleg06 - 2021-02-22, 08:30:08
RE: I18N OnePage - by jjancel - 2021-03-15, 09:27:16
RE: I18N OnePage - by Oleg06 - 2021-03-15, 18:39:17
RE: I18N OnePage - by Felix - 2021-03-18, 21:11:36
RE: I18N OnePage - by Oleg06 - 2021-03-18, 23:11:47
RE: I18N OnePage - by jjancel - 2021-03-26, 04:40:14
RE: I18N OnePage - by Oleg06 - 2021-03-26, 05:46:28
RE: I18N OnePage - by jjancel - 2021-03-30, 03:38:36
RE: I18N OnePage - by Felix - 2021-03-30, 03:51:37
RE: I18N OnePage - by jjancel - 2021-03-30, 04:20:02
RE: I18N OnePage - by jjancel - 2021-03-30, 04:38:17
RE: I18N OnePage - by Felix - 2021-03-30, 05:26:26
RE: I18N OnePage - by jjancel - 2021-04-02, 00:48:28
RE: I18N OnePage - by Oleg06 - 2021-04-02, 01:45:48
RE: I18N OnePage - by Felix - 2021-04-02, 00:57:40
RE: I18N OnePage - by jjancel - 2021-04-02, 03:18:04
RE: I18N OnePage - by Oleg06 - 2021-04-24, 19:19:12
RE: I18N OnePage - by Felix - 2021-04-02, 03:32:00



Users browsing this thread: 1 Guest(s)