Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Setup: WordPress v 3.0.4, multisite network enabled, Theme: Twentyten child, local installation with MAMP 1.9.4, PHP 5.3.2, using SUBFOLDERS (not subdomains) for 4 sub sites


Problem: Same global navigation menu, but sub sites construct urls for categories different to urls constructed in main site.


In main site, an instance of a category link in the main navigation menu: --

http://localhost/BHAKTIVEDANTAS-dev/public_html/blog/category/asides/

Note the '/blog/' directory. Selecting the link returns a page with the category's list of posts. This is as it should be.

Whereas in sub sites, using the same main site navigation menu for global navigation, the link for the same category is constructed differently: --

http://localhost/BHAKTIVEDANTAS-dev/public_html/category/asides/

Note the absence of the '/blog/' directory. Selecting the link returns a 404 page. :(

In order to integrate the 4 sub sites together with the main site, I am using the main site's navigation menu for all by inserting the following code in the 'header.php' file for each of the sub sites. All other links on the navigation menu are working sitewide.

<?php /* for main site menu to display globally or sitewide */
switch_to_blog(1); ?> <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>

<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?> <?php /* restore settings for current blog */ restore_current_blog(); ?>

Can it have anything to do with how the 'Categories' link was added to the menu? In the Super Admin > Appearance > Menus panel, I created a custom link, typed '#' in the URL field and 'Categories' for the label, then added to the menu. Next I added various Categories as children of the custom link.

share|improve this question

2 Answers 2

"Can it have anything to do with how the 'Categories' link was added to the menu? In the Super Admin > Appearance > Menus panel, I created a custom link, typed '#' in the URL field and 'Categories' for the label, then added to the menu."

That's exactly the problem.

share|improve this answer
    
Are you saying there should be a Super Admin > Appearance > Menus panel in the Super Admin menu list on the left? I can't see how to create that, or even how to have an 'Appearance' menu appear there for Super Admin? –  davemac Sep 28 '11 at 3:01
up vote 1 down vote accepted

This problem has been resolved by use of the plugin 'Remove Blog Slug' available at buddydev.com/plugins/remove-blog-slug-plugin/.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.