WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have a multisite whice i want to separate because its unneccery as two of my sites are on the same DATABASE and all i need is actually the dynamic custom menus which i have built in the main site(to let them be on the other site...)

i have this code from here(wordpress answers): How to duplicate custom menu settings to export to another site

    select tr.object_id from wp_terms t 
    left join wp_term_taxonomy tt on t.term_id = tt.term_id
    left join wp_term_relationships tr on tt.term_taxonomy_id =     
    left join wp_posts p on p.ID=tr.object_id
    left join wp_postmeta m on m.post_id=tr.object_id
    where t.slug ='%s' and tt.taxonomy='nav_menu' group by(ID)
    order by p.menu_order asc LIMIT 200;

and it suppose to do the job, but it doesnt....

what it needs to do is to get all the menu items...

im stuck at the moment...

my goal is to use the main site custom menu on the other site through the database.

share|improve this question
Try the query directly from PhpMyAdmin (or whatever interface you got). – kaiser Sep 21 '12 at 10:38
yeah i did....no results and what is this t and tt stand for? im a noob at this... – user1102152 Sep 21 '12 at 10:41
Normally that's short for some table/column name. If you write SELECT foo AS tt then basically foo equals tt and can be used instead. Maybe you should update your question and tell from where you got this query and why you think it should work. – kaiser Sep 21 '12 at 10:43

You can use the switch_to_blog() function to temporarily use data from a specific site instead of the current site.

switch_to_blog(1);  // Switch to Site ID 1 //
restore_current_blog();  // Switch back to Current Site //

restore_current_blog switches back to the current blog's data.

share|improve this answer

Your Answer


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.