Hi stackoverflow community,
Well the think is that I have my custom menu already set for all the pages (no problem with that) the options are being getting by:
$links = wp_kses(wp_nav_menu($parameters), $allowed_tags);
(I just allow anchor tags and its attributes)
and then:
<nav class="menu-navigation">
<?php
echo $links;
?>
</nav>
Everything cool so far, however some options on the menu are sections of some pages, like:
Home#contact
Evidently on other pages like the blog page if a don't have the contact section but I click that option it should redirection the user to Home#contact otherwise do not reload the page and just go to the #contact section.
So I want to detect with php
which options are child and modify its href depending on the current page. I don't know php
enough though so please any ideas and clear walkthrough to get this done?
Thanks in advance.
PD: I would like to avoid use JS if it is possible
Update:
Following the approach of several nav menus
This is my current header-nav code: https://gist.github.com/duranmla/e70cc6073dfb2d79e19f and I make the navigations as suggested. Finally here my dashboard https://www.evernote.com/shard/s243/sh/9896863b-c10b-4e32-bad9-5bbc4341cfd9/d373ab95d0c3c3f5d72f455c03dea7d4/deep/0/Fullscreen-8-15-14,-11-35-AM.png