In Guderian's "Panzer Leader" he mentions early on that Hitler visited the front less and less frequently as the war dragged on and "by doing so he lost contact with the feelings of the troops." Is this true of other heads of state?
Britain's head of state is the monarch, not the PM. During the war George VI and the Queen stayed in London and experienced the blitz. Buckingham Palace was actually bombed while they were in it. The King did visit the front, and was quite effective at raising morale. The royal family's reputation and popularity was somewhat enhanced by the war.
When Stalin once wanted to visit the front of the battle in World War II, he was allowed to go 30 miles within it. But to be extra safe, the entire town that he visited was cleared of real people and filled with disguised NKVD agents who attempted to fool Stalin that they were collective farm workers. He soon realized this and asked to go closer, but his chief of security, Lavrentii Beria, forbade it.
Source: Court of the Red Tsar by Simon Sebag-Montifiore.
Well it depends on what you mean by front lines. Churchill visited Montgomery in Normandy 6 days after D-Day. In Triumph and Tragedy Churchill relates his recollection of that luncheon as follows:
'We lunched in a tent looking towards the enemy. The General was in the highest of spirits. I asked him how far away was the actual front. He said about three miles. I asked if he had a continuous line. He said "No." "What is there then to prevent an incursion of German armour breaking up our luncheon?" He said he did not think they would come.'
On his way back from the meeting he persuaded the captain of the destroyer HMS Kelvin to participate in the bombardment of the German coastal defenses. He mentions that this is the only time he had ever been on board one of his majesty's ships when she fired "in anger".
Of course this episode is memorable because it was not typical, so it is likely about as close as he ever came to the front while Prime Minister.
Churchill visited the frontline during Operation Plunder, the crossing of the Rhine in March 1945, and watched the airborne landings on the German side of the river on the 24th. On the 25th, after badgering Montgomery to go and have a closer look, he crossed over to the other side of the river with Montgomery and some other officers in tow to an undefended strech and stayed there for half an hour. A trip futher up the river to the bombed out bridge at Wesel had to be abandoned when German guns started shelling them.
I appolgise for the fact this is somewhat paraphrased from the Wikipedia article on Operation Plunder, but Max Hastings Armagedon (which I don't have to hand) gives a good account of how Churchill was extremly excited about being so close to the front, and the lengths he went to go behind Esienhowers back (who was opposed to him being there in the first place) when carrying out his trip across the river.
Edit:Spelling
Stalin made at least one visit to the front during the war. Following the battle of Kursk in 1943, he traveled to visit the front in early August. He made an appearance at Western Front HQ, and then Kalinin Front HQ. He didn't spend much time at either, and had no discussions with soldiers or lower ranking officers. According to Beevor, the purpose of the visit was simply so he could be able to say that he had.
Additionally, during the fall of 1941 as the Germans pressed towards Moscow, parts of the government fled to Kuibyshev, which was denoted as the 'backup' capital should Moscow fall. Stalin apparently was quite torn about whether to stay in Moscow or leave. For a time it seemed that the capital was to be abandoned, and Moscow degenerated into chaos for a few days, with widespread looting and panic. Stalin finally made up his mind after hearing of this, and made a public announcement that he would stay in Moscow. Order was restored, and Stalin started to make sure his presence was very public, which absolutely contributed to the morale of the public and their optimism for stalling the German offensive. While it wouldn't be right to call it a visit to the front, it was a conscious decision on the part of Stalin to stay in a city which was directly in the path of the German advance.