Was public pressure (caused by Yellow Journalism) a major factor into the war being declared?
I think this is an incredibly complex question, and really one that has gained added depth the further we have gone from the events as more has been learned.
In particular I want to focus on two areas, the reporting of pre US intervention newspapers from Cuba, and the reaction to the loss of the Maine.
Men working on behalf of Hearst and Pulitzer in particular could be shameless at times in their reporting, such as relating how brutal Spanish police violated the privacy of a young American woman's bedroom and ordered her stripped in the hunt for smuggled messages and money for the rebels. But conversely the war against the Cuban rebels DID take some brutal turns, and for almost a century American interests had been eyeing Cuba while there was a feeling of at least basic support for a local uprising against a backwards colonial holdout.
And eyeing it all with both some general support, but also an eye on the bottom line Hearst in response to reports of cooling tensions was quoted as saying to one of his men in Cuba.
"You provide me with the photographs, and I'll provide you with the war"
However most evidence suggests this was apocryphal, while Hearst expected a Cuban victory and supported it, the paper was not actively engaged yet in supporting a US participation, nor were tensions particularly cooling at the time. The rebellion was still actively being fought. http://fs2.american.edu/wjc/www/wjc3/notlikely.htm
However an actual declaration of war in support of the rebels was far from on the table, McKinley was still uninterested in military action, but sought to appease both business interests and Cuban supporters by negotiating with Spain for reforms to bring peace, however that went nowhere in the end. However Spain did recall its Governor General from Havana who had been a good deal harsher than his predecessor, but this then enflamed loyal Cubans as a sign of wavering support and led to agitation in the capital.
In response the US Consul in Havana, Fitzhugh Lee(nephew of Robert E. Lee and a former CSA cavalry officer), called for a warship to help protect US citizens and property, and thus arrived the USS Maine. 3 weeks into her stay at about 9:30 PM an explosion completely destroyed the battleship and killed 3/4 of her crew. In March a naval inquiry reached the conclusion that the Maine had been sunk by the explosion of a mine. For the weeks following the sinking Hearst and Pullitzer's papers had been demanding blood, while Pulitzer supposedly thought it ridiculous that Spain would try to mine a US warship the fact was the Maine was now sitting in the harbor mud, and Spain was the obvious culprit. Calls for concessions did little to dampen tempers and the blood of the public. While many in government too thought war was the only answer, such as Senator henry Cabot Lodge, and his confidant, Assistant Secretary of the Navy Theodore Roosevelt. Thus with enough support in Congress and a penned in Executive, with a public calling for blood a month after the end of the Maine inquiry, with the caveat that the US would not annex Cuba thanks to the Teller Amendment, in late April the Congress passed a bill authorizing military force by the President to liberate Cuba and war followed a few days later.
The key here is of course the sinking of the Maine, and calls to "Remember the Maine" were echoed around the nation. In years since though there has been a good deal of examination into what actually sank the ship. Most notably was an investigation in the mid 70's by Admiral Hyman G. Rickover. Rickover was a no nonsense, damn near authoritarian, who was almost singlehandedly responsible for the creation and state of the modern nuclear navy even today. And his interest was peaked by the possibility, discounted at the time that a coal fire was responsible for setting of Maine's forward magazine.
He came to a conclusion that thanks to the use of more dangerous Bituminous Coal over Anthracite, combined with atmospheric conditions, and insufficient inspection and ventilation, were at least as likely as a mine. Bit coal has a dangerous tendency to self combust compared to Anthracite which could have produced the fire of sufficient heat to set off the magazine next door. In particular they noted a similar event in the USS New York shortly before the Maine's explosion where the same brand of coal that had sat for 2 weeks began to burn just 3 hours after being checked. The Maine went up 12 hours post inspection and the coal had been in that bunker for nearly 3 months!
The report that was prepared for Rickover: http://www.steelnavy.org/history/items/show/149
So while modern scholarship has come around to an accident though it is not unanimous, and a few voices raised the suggestion at the time, the reporting of the papers holding Spain to account for the loss were not out of step with what the US government concluded themselves had happened, just with more gusto.
I should recommend as another fine overview on the period and the coming together of many different interests as a good first reading on the topic: The War Lovers: Roosevelt, Lodge, Hearst, and the Rush to Empire, 1898 by Evan Thomas.