Ph and water hardness are directly linked.
yes and no.
Yes, in that in most natural situations, if you find water that is hard, it will has higher pH, and if you find water that is soft, it will have a low pH. And the reciprocals are true, too.
However, it is not impossible to have water with high pH and soft, or water with low pH and hard.
pH is a measure of the amount of H+ ions in the water.
Hardness is a measure of the amount of minerals in the water -- and specifically what kinds of minerals depends on which hardness you are talking about. Almost all the minerals are salts, and don't directly influence the amount of H+ in the water. Minerals typically means things like magnesium, calcium, sodium, silver, etc.
General hardness is a measure of all of these minerals, and is often abbreviated GH. Carbonate hardness is a measure of the minerals that are dissolved in the water's ability to act as a buffer. This takes the reactivity of the various minerals in the water, and represents it as a value of an equal amount of solely carbonate. It is often abbreviated KH, from the German spelling of carbonate.
The buffering of KH relates to pH, but I don't think that "directly" is a fair modifier. Because buffering is the amount the water resists changes to pH, not what the final pH itself is. Again, you have have water the has a very low pH, but if it has a high KH, it will resist changes to its pH because of the buffering agents.
"Indirectly" is probably the best modifier, because the individual values of pH and KH can be independent of one another, the amount of KH affects how much acid or base it will take to result in a change in pH.