Primarily because of another decline in food prices, the wholesale price index fell 0.1 per cent in July, the Department of Labor reported yesterday.

It was the third month in a row that farm prices had fallen and the second month that overall wholesale prices, both farm and industrial, had declined.

John Layng, top price expert at the Bureau of Labor Statistics, said the falling farm prices should show up on supermarket shelves soon, if they have not already.

The wholesale price index measures the prices businessmen pay each other for products, but wholesale prices are a precursor of costs consumers eventually pay.

The prices of industrial commodities, such as fuels, metals or chemicals, increased 0.5 per cent in July, after rising 0.3 per cent in June and 0.4 per cent in May. Movements in industrial prices are considered a better gauge of inflationary trends than are changes in food costs.

Even though the Labor Department adjusts the changes to take into account regular seasonal ups and downs, food prices tend to behave erractically - unlike industrial prices.

A spokesman for the President's Council of Economic Advisers said the 0.1 per cent decline in the wholesale price index is a "good number" and is consistent with the administration's forecast that the big surge in prices early this year will slow markedly in the last few months of 1977.

The administration says that the underlying rate of inflation is about 6 per cent, although it will be close to 7 per cent for 1977 because of big price surges early in the year due to the severe winter and the dislocations caused by the natural gas shortage.

While the declining farm prices may be good news for consumers - who saw their food costs rise sharply between December and April - farmers are less happy. Congress has voted to spend several billion dollars more than originally planned last spring for price supports for crops such as corn and wheat.

The Labor Department said that unlike June, when a wide variety of farm products showed lower prices most of the drop in July was caused by sharp declines for oilseeds such as soubeans. In June Farm prices tumbled 6.8 per cent, compared with the 1.8 per cent decline last month and the 2.3 per cent drop in May.

The Labor Department noted price increases in dried fruits and vegetables, cattle, eggs, green coffee and cocoa beans, commodities whose prices had declined sharply in June.

The 0.5 per cent in industrial prices was led by increases for lumber and machinery.

Layng, of the Bureau of Labor Statistics sad the most worrisome of the July wholesale price rises is the cost of steel. On June 16 steel companies boosted prices on sheet steel, the type used in building appliances and automobiles.

Layng noted that the rise in sheet-steel prices could translate into higher prices for those products in the fall. Last month the steel companies announced price boosts on structural steel products (used in heavy construction) and tin mill products (used to make beverage containers), to take effect Sept. 4.

The wholesale price index last month stood at 194.8 per cent of its 1967 average, which means that a collection of goods that cost a businessman $100 in 1967 cost $194.80 in July. The index itself, unlike all the percentage changes reported by the Labor Department, is not adjustable for seasonal variations.