How to move menu item? PHP to HTML
-
Hi there,
I have a very interesting situation. I’m working on one of my client website, he was made a long time ago. The site doesn’t use plugins and they used one custom themes.
I need to move my top menu item “Photos” to the global menu
top_nav.php
<div id="top-nav"> <ul> <li <?php if (is_page("newsletter")) echo 'class="current_page"'?>> <a id="nav-newsletter" href="<?php echo get_option('siteurl') ?>/newsletter"><span class="hide">Join Our Mailing List</span></a> <span class='separator'>|</span> </li> <li <?php if (is_page("photo-gallery")) echo 'class="current_page"'?>> <a id="nav-photo-gallery" class="photo-gallery-popup" href="#"><span class="hide">Photos</span></a> <span class='separator'>|</span> </li> <li <?php if (is_page("videos")) echo 'class="current_page"'?>> <a id="nav-videos" href="<?php echo get_option('siteurl') ?>/videos"><span class="hide">Videos</span></a> <span class='separator'>|</span> </li> <li <?php if (is_page("directions")) echo 'class="current_page"'?>> <a id="nav-directions" href="<?php echo get_option('siteurl') ?>/directions"><span class="hide">Directions</span></a> <span class='separator'>|</span> </li> <li <?php if (is_page("contact-us")) echo 'class="current_page"'?>> <a id="nav-contact-us" href="<?php echo get_option('siteurl') ?>/contact-us"><span class="hide">Contact Us</span></a> </li> </ul> </div>
global_nav
Accommodations >> accommodations - Cliff >> accommodations/cliff - Pacific >> accommodations/pacific - Ocean >> accommodations/ocean - Coast >> accommodations/coast - Peak >> accommodations/peak - Tree >> accommodations/tree - Mountain >> accommodations/mountain - Butterfly >> accommodations/butterfly - Private Houses >> accommodations/houses Amenities >> activities-amenities Dining >> dining Spa >> spa Packages >> packages Honeymoons >> honeymoons Weddings >> weddings Area Guide >> big-sur-area-guide About Us >> about-us - Our Story >> about-us/our-story - Green >> about-us/green - Media/Accolades >> about-us/media-accolades - Mercantile >> about-us/mercantile - Resources >> about-us/resources # # each '-' char indicates a menu level depth # # the text after the >> chars indicate the site URL to open relative to the main site URL # e.g. ">> resources" will open https://www.site.com/resources #
I know it is not impossible but it will require some time because of the link editing in the back end section usually use for the blog posts and if I need to change global menu i need to go to “Posts – choose main nav and then I see this code
Accommodations >> accommodations - Cliff >> accommodations/cliff - Pacific >> accommodations/pacific - Ocean >> accommodations/ocean - Coast >> accommodations/coast - Peak >> accommodations/peak - Tree >> accommodations/tree - Mountain >> accommodations/mountain - Butterfly >> accommodations/butterfly - Private Houses >> accommodations/houses Amenities >> activities-amenities Dining >> dining Spa >> spa Packages >> packages Honeymoons >> honeymoons Weddings >> weddings Area Guide >> big-sur-area-guide About Us >> about-us - Our Story >> about-us/our-story - Green >> about-us/green - Media/Accolades >> about-us/media-accolades - Mercantile >> about-us/mercantile - Resources >> about-us/resources # # each '-' char indicates a menu level depth # # the text after the >> chars indicate the site URL to open relative to the main site URL # e.g. ">> resources" will open https://www.site.com/resources #
so for example is I will write this
Photo >> link
but I don’t have a real link, only
<?php if (is_page("photo-gallery")) echo 'class="current_page"'?>> <a id="nav-photo-gallery" class="photo-gallery-popup" href="#"><span class="hide">Photos</span></a>
any ideas how to make this work?
- The topic ‘How to move menu item? PHP to HTML’ is closed to new replies.