Support » Networking WordPress » Broken permalink structure with wp_nav_menu

  • Hi guys, im creating a network menรน whit the wp_nav_menu function.

    At the moment this is my code:

    $site_list = $wpdb->get_results('SELECT * FROM wp_blogs ORDER BY blog_id');
    	foreach($site_list as $sito){
    		if($sito->blog_id == $current_blog_id || ( ! in_array( $sito->blog_id , $idBlog ) ) ) continue;
    		switch_to_blog($sito->blog_id);
    		$menuNetwork .= wp_nav_menu(array('menu'=>'category-menu','container_id'=>$idnome[$sito->blog_id],'container_class'=>'menu-category-menu-container nascosto','echo'=>0));
    	}

    It generates all menรนs i need, but permalink structure is
    http://www.mysite.it/?cat=222
    where should be like this
    http://www.mysite.it/cat-name

    In fact, on the active site, permalink structure works fine, but on the generated menรนs, permalinks aren’t right.

    This is the site where im working on it: Attualissimo. I hope you can help me ๐Ÿ™‚

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ๐Ÿณ๏ธโ€๐ŸŒˆ Halfelf Rogue & Plugin Review Team Rep

    Have you read http://wpmututorials.com/plugins/networkwide-menu/ ?

    Thanks, but that is not the solution i’m looking for ๐Ÿ™

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ๐Ÿณ๏ธโ€๐ŸŒˆ Halfelf Rogue & Plugin Review Team Rep

    Then I don’t understand what you’re doing, since you said you’re creating a network wide menu with wp_nav_menu.

    That’s exactly what those directions will help you do, but without monkeying with SQL directly.

    The point is that i don’t have to create additional menus on the main site. I’d like to know why permalinks are broken, since my network menรน actually works ( did you see the site? ๐Ÿ˜€ )

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ๐Ÿณ๏ธโ€๐ŸŒˆ Halfelf Rogue & Plugin Review Team Rep

    I did see, and your menu doesn’t work (or the permalinks would be functioning, no? ๐Ÿ˜‰ )

    1) Where are these menus located? Looking at your code it appears you’re trying to pull all the menus from all the sites?

    2) You are aware your css isn’t loading?

    1) Yes, im pulling all menus into $menuNetwork, then i echo the variable;
    2) Css is loaded ( and js too );

    You can see these menus by hovering the big menรน ( News – Gossip – Donna – etc ). They will show to you under that big menรน, just try it ๐Ÿ™‚

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ๐Ÿณ๏ธโ€๐ŸŒˆ Halfelf Rogue & Plugin Review Team Rep

    http://cl.ly/image/2J350p0x3V31

    Whole thing looks like that.

    Anywho. I’d use http://codex.wordpress.org/Function_Reference/switch_to_blog

    For each blog, switch to the blog, pull in the menu, list the items. Though really this is an inefficient way about things. Why are you trying to cross-pollinate all your menus? What;s the thinking there? (I’m asking because maybe there’s a better way)

    Sorry mate, it seems you looked at the wrong time ( now menus are rights ) ^^”

    BTW, i actually use switch to blog ( just see the code above ).

    I need to take all menus because my customer asked me to do this. Every site has an own menu, and i have to take all these menus and show them all in every single page, once you hover element of the big menรน.

    Do you know better ways to do this task? ๐Ÿ™‚

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ๐Ÿณ๏ธโ€๐ŸŒˆ Halfelf Rogue & Plugin Review Team Rep

    The problem is https – http://attualissimo.it/ works

    Are you actually making a menu for this, or are you trying to list the categories?

    http://codex.wordpress.org/Template_Tags/wp_list_categories would be a better pick, IMO.

    Each site has its own menu.
    This menu has categories as links ( for now )

    wp_list_categoris isn’t usefull, because on these menus, in the future, there could be posts, pages or other links.

    Thanks for the “https” thing, btw O_O

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ๐Ÿณ๏ธโ€๐ŸŒˆ Halfelf Rogue & Plugin Review Team Rep

    Bleah. Well. The ?cat_id… should still redirect to the pretty URL.

    How did you add these cats to the menu?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Broken permalink structure with wp_nav_menu’ is closed to new replies.