I know that a URL formed: samplewebsite.com/?random will redirect to a random post.

Is it possible to create a URL that will redirect to a random post within a particular category?

samplewebsite.com/category/?random and samplewebsite.com/category?random

don't achieve this.

Does anyone know how this can be achieved? (Preferably with code, not a plugin)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.