vinta9e Wrote:I've got a little problem though. I would like to display a submenu in the sidebar component if the current page has subpages, or display a differerent menu otherwise. I just can't code it.
Here's my try, all within the sidebar component:
Code:<?php if (get_i18n_menu_data(return_page_slug(), 1, 2, haschildren) == true) ?>
<ul><?php get_i18n_navigation(return_page_slug(), 1, 2); ?></ul>
<?php else echo 'XYZ'; ?>
Try
Code:
<?php
$pages = return_i18n_pages();
if (@count(@$pages[return_page_slug()]['children'])) {
?>
<ul><?php get_i18n_navigation(return_page_slug(), 1, 2); ?></ul>
<?php
} else {
?>
<p>Here is something else.</p>
<?php
}
?>
Documentation of the available functions is in the top of the plugin file.