jeudi 23 juillet 2015

Wordpress - Display Content on page and its children

I am trying to implement a submenu into my page.php. It shall be dynamic so the different pages of my site have different submenus displayed on a certain place.

This is what I got so far:

<?php if (is_page(unternehmen || $post->post_parent==unternehmen)): ?> <!-- Unternehmen /postID 553 -->

            <?php wp_nav_menu( array('menu' => 'Unternehmen Submenu' )); ?>

<?php endif; ?>

But with this solution the submenu here called "Unternehmen Submenu" will be displayed on every page that uses the page.php. I need a solution that displays the menu only on the respective page defined in the if-statement and its children. The best solution would be if the code fetches the main menu into this. It's an easy menu with one sublevel.

I searched for this specific problem here but didn't found a solution.

Aucun commentaire:

Enregistrer un commentaire