Undated (AP) _ Knight-Ridder Inc. said Tuesday its second-quarter profit edged up 4 percent from a year earlier on a 9.6 percent revenue gain.

Two other media companies posted declines, however. Taft Broadcasting Co., citing costs associated with an acquisition, reported a 69 percent earnings drop for its fiscal first quarter.

A.H. Belo Corp. said its profit for the quarter ended June 30 fell 6.6 percent, and the company said earnings were likely to remain under pressure ''for the foreseeable future.''

Knight-Ridder said net income in the latest quarter rose to $38.3 million, or 66 cents a share, from $36.8 million, or 59 cents a share, a year earlier. Revenue climbed to $487.9 million from $445.4 million.

The Miami-based company publishes 28 daily newspapers, including the Miami Herald, Philadelphia Inquirer and Detroit Free Press, and operates eight television stations.

Knight-Ridder said its total advertising revenue in the latest quarter rose 8.3 percent to $342.3 million from $316.2 million a year ago.

The company said its latest earnings also were were helped by moderating newsprint costs and by a comparison with year-earlier results that reflected a one-day strike at the Philadelphia Inquirer in April 1985.

The Inquirer and another Knight-Ridder newspaper in Philadelphia, the Daily News, also were hit with a seven-week strike during the second half of last year.

''We continue to be optimistic about the second half of 1986,'' Robert F. Singleton, Knight-Ridder's senior vice president for finance, said in a statement. ''We expect substantial increases over the second half of 1985 when the 46-day strike in Philadelphia depressed earnings significantly.''

For the first half of 1986, Knight-Ridder's profit slipped 1.4 percent to $64.9 million, or $1.12 a share, from $65.8 million, or $1.03 a share, a year earlier.

Although total net income edged lower, per-share earnings rose in the latest period because Knight-Ridder had fewer average shares outstanding than a year earlier.

Six-month revenue climbed 8 percent to $935.3 million from $867.1 million.

Taft Broadcasting, headquartered in Cincinnati, said profit for its fiscal first quarter ended June 30 skidded to $3.62 million, or 39 cents a share, from $11.8 million, or $1.28 a share, a year earlier. Revenue jumped to $129.3 million from $94.9 million.

Taft, which owns 12 TV stations and 15 radio stations, said the earnings decline partly reflected costs associated with its $760 million acquisition of Gulf Broadcast Co. last year. But Taft said the lower results also reflected weakness at its independent broadcast stations - those not affiliated with a major network.

''The general weakness of the independents, reflecting an industrywide slump, is exacerbated by our presence in Dallas and Houston,'' Charles S. Mechem Jr., Taft's chairman and chief executive, said in a statement. ''Both economies have been badly hurt by the drop in oil prices.''

The rest of Taft's fiscal year also is likely to be difficult, and the company's earnings for the full year ending March 31, 1987, probably will trail the previous year's results, when Taft earned $19.4 million on revenue of $472.8 million, Mechem said.

Dallas-based Belo, meanwhile, also cited sluggish market conditions in Texas in predicting that its profit would remain under pressure.

Belo publishes the Dallas Morning News and several community newspapers in the Dallas-Fort Worth area. It also owns five TV stations, including one in Dallas and one in Houston.

Belo said its prediction of further earnings weakness also reflects its expectations of stronger competition from the Morning News' rival, the Dallas Times Herald, now that the Times Herald is about to be sold.

Last month Times Mirror Co., a Los Angeles-based media concern, agreed to sell the Times Herald for $110 million to MediaNews Group, a New Jersey-based newspaper publishing company.

In the second quarter, Belo's net income fell to $7.59 million, or 66 cents a share, from $8.13 million, or 70 cents a share, a year earlier. Revenue rose 4 percent to $104.9 million from $101 million.

In the first six months of this year, Belo's profit dropped to $9.19 million, or 80 cents a share, from $10.5 million, or 90 cents a share, a year earlier. First-half revenue rose to $195 million from $186.6 million.