Created
August 21, 2014 16:59
-
-
Save tormjens/651b832070b84337fc0d to your computer and use it in GitHub Desktop.
Eksempel på menyer fra flere blogger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach( wp_get_sites() as $site ) { | |
if( $site['blog_id'] !== 1 ) { // ikke hente roten (denne siden) | |
switch_to_blog( $site['blog_id'] ); // bytt tabellsett til bloggen | |
wp_nav_menu( array( 'theme_location' => 'primary-menu') ); // hent menyen som er assignet til primary-menu | |
} | |
} | |
restore_current_blog(); // tilbakestiller tabellene til nåværende side | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment