cbc-adsmith
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Is it possible to have different menus for different pages?*Update*
I was trying to change more than just one specific page using an “if” and “else” conditional statement. I wasn’t sure how to force a second if statement, and nothing I tried was working (such as adding a comma between slugs, or just adding another if statement line). After reading this article about wordpress conditional statements, I realized I could create “elseif” statements and then end with a final “else” statement. Perhaps this was a dumb oversight, but at least I figured it out! Wanted to update in case anyone else read this.
This method is especially useful for breaking up a WordPress into two different sites, sort of. Client wanted a splash page that directed to two different sides of the same parent company website, each with different navigation menus.
Thanks again esmi for the help.
@blachance – sounds like a different issue. You should be able to customize your sidebars using widgets, I believe. You might get more responses if you start a new topic or further research the problem and find a more relevant question topic.
Forum: Fixing WordPress
In reply to: Is it possible to have different menus for different pages?*Update*
I added the code that esmi provided for the page template (page.php) to the header (header.php) instead, and it worked!
Thanks for your help, esmi!
Forum: Fixing WordPress
In reply to: Is it possible to have different menus for different pages?On the page (http://lcskleenaire.com/lcsi/) you can see a link showing up that says “Splash” which was not added to any custom menu, yet it’s showing up now that I’ve made these changes.
Thanks for your help. I will continue to work with it. I changed the slug to match but it’s still not working.
Forum: Fixing WordPress
In reply to: Is it possible to have different menus for different pages?I see that in the source too, but there is not a custom menu with the “Splash” page included, so I’m not sure where it’s pulling those links from. Is there any other cause for those links to show up? And why are the correct menu items not showing up as the theme’s navigation menu?
Forum: Fixing WordPress
In reply to: Is it possible to have different menus for different pages?Yes, both menus are created and assigned correctly.
Why is it suddenly adding menu links that I haven’t created? I haven’t changed anything with the theme CSS and it was working before these changes.
Forum: Fixing WordPress
In reply to: Is it possible to have different menus for different pages?Here is my code:
Functions:
function register_my_menus() { register_nav_menu( 'lcs', __( 'LCS Menu') ); register_nav_menu( 'lcsi', __( 'LCSi Menu' ) ); } add_action( 'init', 'register_my_menus' );Page Template:
<?php $args = array(); if (is_page('lcs') ) $args['theme_location'] = 'lcs'; else $args['theme_location'] = 'lcsi'; wp_nav_menu($args);?>Forum: Fixing WordPress
In reply to: Is it possible to have different menus for different pages?It is still not working as far as the actual page template. It’s listing out all the pages and then showing the correct navigation menu but it’s in a “widget” style vertical lineup
See what I mean: http://lcskleenaire.com/lcsi/
Do I need to create multiple page templates or something?
Forum: Fixing WordPress
In reply to: Is it possible to have different menus for different pages?That gave me the option to set multiple menus!
But how do I change which menu each specific page uses?