[Theme: Case] Theme Overriding my Custom Menu?
-
Hi guys,
I’ve been having this problem for the past couple days and am now having to (begrudgingly!) admit defeat.. it seems as though it should be such a simple fix!? (I’d just like to add my own menu to a different page).
Site: https://foxaluminium.co.uk/hidden/more-projects
I’m making a site for my Dad’s friend, using a theme they provided called ‘Case’. I’ve installed a smooth scrolling plugin for the homepage menu, which works fine and I’m happy with it.. problem being I have 1 external page and just wanted to add a separate menu to that page, so I can put full hyperlinks back to the homepage (otherwise it tries to find an #anchor that isn’t on it’s own page). – If I add the full link to the ‘primary top menu’, the homepage loses the scrolling effect and just reopens the page at the corresponding #anchor.
To add my own menu I have tried following multiple threads and also the codex on how to register a nav menu. I’ve successfully added it to the themes ‘functions.php’ file, and it is showing up in the backend Menu area. (Step one a success!). My problem is, I can’t get the php ‘if statement’ I’m using to display my custom menu in the frontend :/
I used this in the functions.php file:
function register_my_menu() { register_nav_menu('gallery-menu',__( 'Gallery Menu' )); } add_action( 'init', 'register_my_menu' );
That worked fine.. I’ve then tried to paste the following into the themes ‘header.php’ file:
<?php if (is_page('more-projects')){ wp_nav_menu(array('menu'=>'gallery-menu' )); } ?>
I’ve tried refreshing caches, and as it seems the theme has lots of other files for different types of header, I’ve also tried putting it in those, but no luck :/ I’ve also tried pasting in the ‘page.php’.. and also tried looking at the pages source to try pick out the particular file I might need to paste this into? I think they’ve purposefully made the theme so it’s very difficult to update yourself.. However, I’m not one to back down from this sort of challenge! ??
I’m by no means a whizz at WP, so have I maybe typed something incorrectly? My thought is the theme does come with it’s own custom menus (and page templates) – a ‘Parallax’ menu, a ‘hidden’ and lastly a ‘custom’… I can see in the Source it’s using it’s own ‘custom’ menu still.. do I need to write the php ‘if statement’ slightly differently? Maybe something like this: `<?php
if (is_page(‘more-projects’)){
wp_nav_menu(array(‘custom-menu’=>’gallery-menu’ ));
}
?>`Would that turn any instance of the theme trying to use it’s own ‘custom-menu’, into using my ‘gallery-menu’?? I think it’s probably falling back onto it’s default menu, but I can’t find the file I need to edit to resolve this >.<
Very sorry for the long post, it’s driving me a bit bananas! Would be so grateful if someone could help me. If there’s anything else I can post that might help please let me know! I did a search to try find help on this particular theme, but no joy.
Thank you for any help, much appreciated!
Kind regards,
Sophie
- The topic ‘[Theme: Case] Theme Overriding my Custom Menu?’ is closed to new replies.