I've been searching the forums for this, running into many snippets for displaying random images, random users, random blog entries.

I am looking to display a random node from one content type (a flexinode type). Basically, I just need to find a snippet of PHP that will allow me to define the content type being displayed, and the number of nodes displayed (i want to display just one node).

Or, alternatively, if I could display a single random node from one vocabulary/term, that would be ideal as well.

Has anyone come across this? Thanks in advance,
-=Vince

Comments

rzelnik’s picture

You can display a random node by Views. Create a new view, set random sorting and set to display one line of output. Thats all.

dennis714’s picture

OK, I got page host?q=frontpage which contain random posts, but how can I set default frontpage to this view?

rzelnik’s picture

admin/settings/site-information
Default front page: ?q=frontpage