Take your guinea pig to an exotics vet ASAP. This means one who specialises in rodents, not an ordinary cat/dog vet. It is likely a UTI or bladder stones, both of which are common as pigs age and can be treated easily - but can be fatal if left untreated. Do not try home remedies. Go to a vet.