{"id":83761,"date":"2018-03-30T15:22:51","date_gmt":"2018-03-30T15:22:51","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/random-post-on-refresh\/"},"modified":"2025-05-25T21:19:17","modified_gmt":"2025-05-25T21:19:17","slug":"random-post-on-refresh","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/random-post-on-refresh\/","author":9114287,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2.3","stable_tag":"1.2.3","tested":"6.8.5","requires":"6.4","requires_php":"7.4","requires_plugins":null,"header_name":"Random Post on Refresh","header_author":"Micah Wood","header_description":"Show a random post on every page load.","assets_banners_color":"","last_updated":"2025-05-25 21:19:17","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.me\/wpscholar","header_plugin_uri":"http:\/\/wpscholar.com\/wordpress-plugins\/random-post-on-refresh\/","header_author_uri":"https:\/\/wpscholar.com","rating":5,"author_block_rating":0,"active_installs":400,"downloads":7853,"num_ratings":6,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"woodent","date":"2018-03-30 15:22:14"},"1.1":{"tag":"1.1","author":"woodent","date":"2018-12-11 21:15:23"},"1.1.1":{"tag":"1.1.1","author":"woodent","date":"2019-09-18 14:01:08"},"1.2":{"tag":"1.2","author":"wpscholar","date":"2021-04-28 22:12:04"},"1.2.1":{"tag":"1.2.1","author":"wpscholar","date":"2025-05-25 17:57:18"},"1.2.2":{"tag":"1.2.2","author":"wpscholar","date":"2025-05-25 20:25:00"},"1.2.3":{"tag":"1.2.3","author":"wpscholar","date":"2025-05-25 21:19:17"}},"upgrade_notice":{"1.1":"<ul>\n<li>The latest update pulls from a larger selection of matching posts before selecting a random post. Works with WordPress 5.0.<\/li>\n<\/ul>","1.1.1":"<ul>\n<li>Bug fix for how post excerpts are generated. Tested with WordPress 5.2.3.<\/li>\n<\/ul>","1.2":"<ul>\n<li>Minor bug fixes and improvements.<\/li>\n<\/ul>","1.2.1":"<ul>\n<li>Allow filtering of query args.<\/li>\n<\/ul>","1.2.2":"<ul>\n<li>Allow customization of posts_per_page query arg.<\/li>\n<\/ul>","1.2.3":"<ul>\n<li>Allow customization of order and orderby query args.<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":6},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3300317,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3300317,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.1.1","1.2","1.2.1","1.2.2","1.2.3"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[155029,155028,10529],"plugin_category":[],"plugin_contributors":[155030,161669],"plugin_business_model":[],"class_list":["post-83761","plugin","type-plugin","status-publish","hentry","plugin_tags-different-post","plugin_tags-post-rotation","plugin_tags-random-post","plugin_contributors-imzodigital","plugin_contributors-wpscholar","plugin_committers-wpscholar"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/random-post-on-refresh\/assets\/icon-128x128.png?rev=3300317","icon_2x":"https:\/\/ps.w.org\/random-post-on-refresh\/assets\/icon-256x256.png?rev=3300317","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>The <strong>Random Post on Refresh<\/strong> plugin allows you to randomly display a different post on every page load.<\/p>\n\n<p>Using this plugin is simple:<\/p>\n\n<ol>\n<li>Install the plugin<\/li>\n<li>Activate the plugin<\/li>\n<li>On the page or post where you want to have a random post display, add the <code>[random_post_on_refresh]<\/code> shortcode where you want your post to appear.<\/li>\n<li>Save your changes.<\/li>\n<\/ol>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>Works with custom post types<\/li>\n<li>No settings page, just an easy way for you to add random posts to your site<\/li>\n<li>Clean, well written code that won't bog down your site<\/li>\n<\/ul>\n\n<!--section=installation-->\n<h4>Prerequisites<\/h4>\n\n<p>If you don't meet the below requirements, I highly recommend you upgrade your WordPress install or move to a web host\nthat supports a more recent version of PHP.<\/p>\n\n<ul>\n<li>Requires WordPress version 6.4 or greater<\/li>\n<li>Requires PHP version 7.4 or greater<\/li>\n<\/ul>\n\n<h4>The Easy Way<\/h4>\n\n<ol>\n<li>In your WordPress admin, go to 'Plugins' and then click on 'Add New'.<\/li>\n<li>In the search box, type in 'Random Post on Refresh' and hit enter.  This plugin should be the first and likely the only result.<\/li>\n<li>Click on the 'Install' link.<\/li>\n<li>Once installed, click the 'Activate this plugin' link.<\/li>\n<\/ol>\n\n<h4>The Hard Way<\/h4>\n\n<ol>\n<li>Download the .zip file containing the plugin.<\/li>\n<li>Upload the file into your <code>\/wp-content\/plugins\/<\/code> directory and unzip<\/li>\n<li>Find the plugin in the WordPress admin on the 'Plugins' page and click 'Activate'<\/li>\n<\/ol>\n\n<!--section=faq-->\n<p>The <code>[random_post_on_refresh]<\/code> shortcode supports a few attributes to give you more control over the results:<\/p>\n\n<ul>\n<li><p><strong>author<\/strong> - Provide an author ID or a comma-separated list of author IDs if you want to limit the random post to one of those authors. Example: <code>[random_post_on_refresh author=\"1, 11, 14\"]<\/code><\/p><\/li>\n<li><p><strong>ids<\/strong> - Provide a comma-separated list of post IDs to pull random posts from.  Example: <code>[random_post_on_refresh ids=\"19, 87, 113, 997\"]<\/code><\/p><\/li>\n<li><p><strong>image_required<\/strong> - Only applies when the <code>show<\/code> attribute contains <code>image<\/code>. This attribute defaults to <code>true<\/code> and will cause WordPress to filter out any posts without images. If set to <code>false<\/code>, then posts with or without images will be shown.  Example: <code>[random_post_on_refresh show=\"title, image\" image_required=\"false\"]<\/code><\/p><\/li>\n<li><p><strong>not<\/strong> - Provide a comma-separated list of post IDs to exclude. Example: <code>[random_post_on_refresh not=\"3, 456, 876\"]<\/code><\/p><\/li>\n<li><p><strong>order<\/strong> - Can be either 'asc' or 'desc'. Defaults to 'desc'.<\/p><\/li>\n<li><p><strong>orderby<\/strong> - Customize how WordPress orders the fetched results. See https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/#order-orderby-parameters<\/p><\/li>\n<li><p><strong>post_type<\/strong> - Provide a post type or a comma-separated list of post types to pull from. You must use the internal post type name. Default is <code>post<\/code>. Example: <code>[random_post_on_refresh post_type=\"page\"]<\/code><\/p><\/li>\n<li><p><strong>posts_per_page<\/strong> - Provide the number of posts to fetch. Defaults to 100. Posts are randomly selected from the posts fetched.<\/p><\/li>\n<li><p><strong>search<\/strong> - Provide a custom search term to limit the random posts returned.  Example: <code>[random_post_on_refresh search=\"relativity\"]<\/code><\/p><\/li>\n<li><p><strong>taxonomy<\/strong> - Provide a custom taxonomy to pull from. Requires the <code>terms<\/code> attribute to be set as well. Example: <code>[random_post_on_refresh taxonomy=\"post_tag\" terms=\"2,4\"]<\/code><\/p><\/li>\n<li><p><strong>terms<\/strong> - Provide a term ID or comma-separated list of term IDs to limit the random posts returned. Requires the <code>taxonomy<\/code> attribute to be set as well. Example: <code>[random_post_on_refresh taxonomy=\"post_tag\" terms=\"2,4\"]<\/code><\/p><\/li>\n<li><p><strong>class<\/strong> - Provide a custom class name for the wrapping HTML div. Example: <code>[random_post_on_refresh class=\"my-custom-class\"]<\/code><\/p><\/li>\n<li><p><strong>size<\/strong> - Provide a registered image size to use for image display (optional, only takes effect if images are being shown). Example: <code>[random_post_on_refresh size=\"thumbnail\"]<\/code><\/p><\/li>\n<li><p><strong>show<\/strong> - Provide a comma-separated list of post elements to display. You can also use a vertical pipe <code>|<\/code> character instead of a comma to separate items into columns. Options are: title, image, excerpt, content. Defaults to <code>title, image, excerpt<\/code>. Items will show in the order you provide. Note: If images are shown, only posts with featured images will be returned. Example: <code>[random_post_on_refresh show=\"title, image\"]<\/code><\/p><\/li>\n<\/ul>\n\n<p>Keep in mind that any of these attributes can be combined as needed.  Example: <code>[random_post_on_refresh author=\"19\" size=\"full\" not=\"2310\"]<\/code>.  Also, keep in mind that the shortcode can be used in text widgets.<\/p>\n\n<!--section=changelog-->\n<h4>1.2.3<\/h4>\n\n<ul>\n<li>Allow customization of order and orderby query args.<\/li>\n<\/ul>\n\n<h4>1.2.2<\/h4>\n\n<ul>\n<li>General maintenance<\/li>\n<li>Allow customization of posts_per_page query arg<\/li>\n<\/ul>\n\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>General maintenance<\/li>\n<li>Allow filtering of query args<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Added a shortcode attribute to allow posts without images to be shown when the <code>show<\/code> attribute contains <code>image<\/code>.<\/li>\n<li>Bug fix for certain strings not being translatable.<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>Fixed bug where post excerpts were being generated incorrectly.<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Ensure code meets coding standards.<\/li>\n<li>Don't allow the current post to be selected as the random post.<\/li>\n<li>Always return the last 100 matching items and select the random post from one of those.<\/li>\n<li>Tested in WordPress 5.0<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Tested in WordPress version 4.9.2<\/li>\n<\/ul>","raw_excerpt":"Show a random post on every page load.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/83761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=83761"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/wpscholar"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=83761"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=83761"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=83761"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=83761"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=83761"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=83761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}