Archived topic
random pages shortcode function
3 replies · Started by Juan Jose on August 26, 2020
I want to show under each page, 6 random pages without showing the current page, how could I do this script?
Could it be done with a shortcode function?
Hi there,
try the WP Show Posts plugin.
https://wordpress.org/plugins/wp-show-posts/
You can create a new list, and from the More Settings you can check 'Exclude Current' and set the Order By to Random.
Thanks, I have installed it, but when I try to exclude a page, like the home page, it doesn't exclude it, how can I do it?
There is also a field named Exclude IDs - you can add the ID of the home page in there.
You can get its ID by Right Click inspecting the Home Page in the live site. You will see something like page-id-123 which you would enter just 123 into the field.
Or you can see the same number by editing the Home Page and checking the URL.