Forum Replies Created
-
AuthorPosts
-
michaelrigartParticipant
Hi,
I think that I got it to work, but I was woundering if there is a more direct way.
I've created a custom template and used the following code to retrieve the subnavigation items:// get all menu locations $locations = get_nav_menu_locations(); // get the object for the primary menu location $menu = wp_get_nav_menu_object($locations['primary']); // get alle the menu items for the menu $menu_items = wp_get_nav_menu_items($menu->term_id); // get the current page id $current_id = get_queried_object_id(); // get all menu items where the parent equals the current page $children = array_filter($menu_items, function ($element) use ($current_id) { return ($element->post_parent == $current_id); } ); // reset the array index, since array_filter keeps the index number of the menu_items array $children = array_values($children);
It seems a bit cluncky to have to iterate over the arrays. Perhaps there is a more direct way to achieve this?
michaelrigartParticipantHi Anita,
thank you for pointing me in the direction of the of the customize plugin. This was exactly what I was looking for. Thanks to this plugin I was able to add some custom css, add an extra navigation without altering templates and add a custom template!
If I need specific support for the template, do I ask support through the support form of SEO-themes instead of the forum here? Because I have a specific question regarding the html sitemap that is shown in the theme demo, since I'm woundering how this page was build.
@braddalton: adding custom code to the end of the files would still force me to keep track of those changes. But thank you for the input.Kind regards
Michaƫl
-
AuthorPosts