I saw the sentence like 'The president to agree with the opinion.'in the news paper. I can understand the meaning of the 'to' in the sentence. Maybe I think that 'to' means 'will'. Am I right? If I am wrong, What is the right meaning of 'to' in the sentence? Please, tell me.
Newspaper headlines by their very nature are designed to grab as much attention as possible, in the least possible space, and as such, almost have a grammar of their own.
One example of this is the use of the infinitive form of the verb to refer to future events - e.g.
Parliament to decide new policy tomorrow.
Germany to take in 5000 more refugees.
President to visit France for further talks.
Using the infinitive in this manner, a future time is not always necessary to demonstrate the future tense in headlines.
In your example:
The president to agree with the opinion.
...simply means that the president will agree with this opinion, sometime in the future.
On a related note, I'm presuming your example is one you made up for the purposes of the question, as it doesn't seem to be as concise as one would expect form a headline. President to agree with reforms or similar would be more realistic.