In Wordpress I create two forms: one for a teacher and a second for a student. I need to search for teacher data using the student search form. But I can't understand how to do it. Please give solution, how can i solve this issue?
Not sure what you are trying to do exactly, but if you are coding you could use the CiviCRM API to first find the teacher for the student with the API Relationship/Getsingle and then find the data for the teacher with the API Contact/Getsingle?
Aer you familiar with using the CiviCRM API? If not, explanation can be found on the documentation wiki: https://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API