Food and clothing prices fell in July, but other prices still rose enough to boost the consumer price index 0.5 percent, the Labor Department reported yesterday.

The overall July increase was the smallest since last December, but presidential inflation counselor Robert S. Strauss predicted in Boston yesterday that the rate over the year would be closer to 8 percent, a sharp upward revision of the 7.2 percent prediction the administration made early last month.

Last January, President Carter predicted in his annual economic report an inflation rate of about 6 percent.

Grocery stores prices, which increased an average of 1.6 percent a month for the first six months of the year, tumbled 0.4 percent last month. Beef prices, the chief villain in food inflation this year, declined 2.2 percent. Clothing prices, which had been rising steadily since March, fell 0.6 percent.

But the good news on food, which the administration had been counting on since last spring, was tempered by continued strong increases in nonfood prices. They increased 0.7 percent last month, about the same as in May and June.

Over the past three months, nonfood prices have risen at an annual rate of 9.3 percent.

The Labor Department also reported that because of the more moderate 0.5 percent increase in the consumer price index last month - it rose 0.9 percent in each of the previous three months - the purchasing power of an average hour's work rose 0.3 percent in July.

In June, the earnings index fell 0.4 percent. Over the year, the buying power of an average hour's work - as measured by the hourly earnings index - rose 0.5 percent.

Charles L. Schultze, chairman of the president's Council of Economic Advisers, said the "moderation in the rise of the consumer price index in July is heartening. We expected food prices to fall and they did."

Schultze said there is "good reason" to look for "comparatively small increases" in food prices in the coming months.

John Layng, the top price analyst for the Bureau of Labor Statistics, said beef supplies should be larger for the rest of the year and beef prices probably will not rise too much more.

But the past increases in food prices have already spilled over into other sectors of the economy as cost of living adjustments in labor contracts drive up wage costs.

The administration is hard at work on a second phase of its "voluntary" program to hold down wage and price increases.

Strauss, speaking to the nation's governors yesterday, conceded that the administration has had little success in its efforts to persuade unions to moderate their wage demands. "So far," he said, "we have nothing to show for it that would build any credibility into our own program."

The first two major contracts negotiated this year - in the coal and railroad industries - called for increases far in excess of what the government wanted. The postal settlement agreed to last month, which called for wage increases more in line with the government's anti-inflation goals, was rejected by the members of the postal unions.

Several governors stressed to Strauss that the Carter administration must maintain a firm stand on the postal workers settlement, now in mediation and arbitration.

North Carolina Gov. James B. Hunt Jr., a Democrat, said that pay increases for state employes must be held below the inflation rate and that the postal contract is "obsolutely critical" to holding down state employe wages.

The postal contract "has to be settled on noninflationary terms, no matter what it takes, or the limb will be cut out from beneath us," Hunt said. Strauss declined to discuss the talk in detail publicly, but told Hunt, "I have no quarrel with what you say."

Strauss also conceded that although many business have pledged to cooperate with the administration's plan to keep wage and price increases less than last year's "there have been less results than I would have hoped."

Transportation costs continued to rise at a 0.7 percent pace, while the costs of owning and maintaining a home rose 1.2 percent, about as fast as those costs have been rising all year. Gasoline prices rose 0.8 percent.

The overall consumer price index, which is not adjusted for seasonal variation, stood at 196.7 percent of its 1967 average. That means a selection of goods and services that cost $10 in 1967 cost $19.67 last month.

The overall consumer price index, including the July decline in grocery price store prices, has been rising at an annual rate of 9.8 percent for the last six months and is 7.7 percent higher than it was in July 1977.