{"id":4234,"date":"2017-11-07T18:49:35","date_gmt":"2017-11-07T18:49:35","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2017\/11\/07\/how-to-create-a-random-posts-shortcode\/"},"modified":"2023-06-09T10:00:25","modified_gmt":"2023-06-09T14:00:25","slug":"how-to-create-a-random-posts-shortcode","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/","title":{"rendered":"How to Create a Random Posts Shortcode"},"content":{"rendered":"<p>In the course of developing your WordPress site, you have likely considered the importance of site navigation. Once users have visited your site, the goal is to provide more opportunities for the user to find other valuable content beyond the page they have landed on. This is why many WordPress themes come with sidebars and widget areas in the header and\/or footer to provide more links for users to click on. In the same fashion, you can encourage users to venture further into your site\u2019s posts by providing a list of random posts on a certain page or posts via a <strong>random posts shortcode<\/strong>. That may sound complicated, but it\u2019s very simple.<\/p>\n<p>If you have been using WordPress for a while, you have likely used shortcodes with a plugin or theme that allow you to run certain backend functions. If you are not familiar with shortcodes, they are basically short phrases you can add to a page or post to perform a special action.<\/p>\n<p>With a single code snippet added to your theme\u2019s function file, you can easily add a list of random posts to any post or page via a small shortcode. The advantage in this procedure is that you don\u2019t need to install a third party plugin. If you are someone who likes to use your own code, or if you already have too many plugins going, this method is ideal for you.<\/p>\n<p>First, we\u2019ll show you how to create the shortcode, then we\u2019ll show you where to insert it within a page or post.<\/p>\n<h2>How to Create Your Random Posts Shortcode<\/h2>\n<p>In order to get the most out of this article, we recommend you use a <a href=\"\/support\/edu\/wordpress\/wp-childtheme-2014\/\">child theme<\/a> to make these modifications. We are only going to editing the <em>functions<\/em> file for your child theme. Or, if you are editing your own custom theme, then you are ready to get started now.<\/p>\n<p>Changes to your theme will always be made in \u201ctheme directory.\u201d The location of the theme directory is always the same. Starting from the document root of your website, you will go <em>\/wp-content\/themes\/<\/em> followed the by the theme you want to edit. For example, if you wanted to edit the Twenty Sixteen theme, the theme directory will be called \u201ctwenty-sixten.\u201d Likewise, a Twenty Sixteen child theme will likely be called \u201ctwenty-sixteen-child.\u201d<\/p>\n<ol class=\"article_list\">\n<li><a href=\"\/support\/images\/stories\/cpanel\/lanternUpdatesMay17\/cmPape_03.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/cpanel\/lanternUpdatesMay17\/cmPape_03.png\" alt=\"cPanel login screen\"><\/a>Log into cPanel\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-51.png--><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-51.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-51.png\" alt=\"File Manager icon\"><\/a>Under <em>Files<\/em> choose <b>File Manager<\/b>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-52.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-52.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-52.png\" alt=\"find theme directory\"><\/a>Enter the theme directory (mentioned above)\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-53.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-53.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-53.png\" alt=\"create functions.php file\"><\/a><a href=\"\/support\/website\/create-new-file\/\">Create a file<\/a> called <code>functions.php<\/code>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-54.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-54.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-54.png\" alt=\"edit functions.php file\"><\/a><a href=\"\/support\/website\/how-to-edit-a-file\/\">Edit<\/a> the <code>functions.php<\/code> file created above\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-55.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-55.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-55.png\" alt=\"sample functions.php file\"><\/a>Paste the following code into the <code>functions.php<\/code> file:\n<pre class=\"code_block\"> &lt;?php function wpb_rand_posts() {          \n      $args = array(     \n      'post_type' =&gt; 'post',     \n      'orderby'   =&gt; 'rand',     \n      'posts_per_page' =&gt; 5,      \n      );     \n      $the_query = new WP_Query( $args );     \n      if ( $the_query-&gt;have_posts() ) {     \n      $string = '&lt;ul&gt;';         \n            while ( $the_query-&gt;have_posts() ) {         \n            $the_query-&gt;the_post();         \n            $string .= '&lt;li&gt;&lt;a href=\"'. get_permalink() .'\"&gt;'. get_the_title() .'&lt;\/a&gt;&lt;\/li&gt;';         \n            }         \n            $string .= '&lt;\/ul&gt;';     \n            \/* Restore original Post Data *\/     \n            wp_reset_postdata();     \n            } else {     \n            $string .= 'no posts found';     \n            }     \n            return $string;  \n}  \nadd_shortcode('random-posts','wpb_rand_posts'); \nadd_filter('widget_text', 'do_shortcode');  ?&gt;<\/pre>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-56.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-56.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-56.png\" alt=\"click Save Changes button\"><\/a>Save the file\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-57.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-57.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-57.png\" alt=\"Click Close button\"><\/a>Close the file\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<\/ol>\n<p>Now that we have created the functions file and added our random posts shortcode, we are going to proceed into our WordPress admin area to use the shortcode on a page or post.<\/p>\n<p><!-- Next steps --><\/p>\n<h2>How to Use the Random Posts Shortcode in a Page or Post<\/h2>\n<p>Now that we have inserted the necessary modifications to allow for a shortcode, we need to use the shortcode somewhere in our site to see how it works.<\/p>\n<ol class=\"article_list\">\n<li><a href=\"\/support\/images\/stories\/wordpress\/Selection_087-cm-wpblank.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress\/Selection_087-cm-wpblank.png\" alt=\"WordPress login screen\"><\/a><a href=\"\/support\/edu\/wordpress\/logging-into-wordpress-dashboard\/\">Log into your WordPress Dashboard<\/a>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-58.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-58.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-58.png\" alt=\"Add New Post\"><\/a>Under <em>Posts<\/em> select <b>Add New<\/b>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-59.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-59.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-59.png\" alt=\"Enter a post title\"><\/a>Add a title to your post\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-60.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-60.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-60.png\" alt=\"Add shortcode to post\"><\/a>In the main post body, add the following short-code with brackets included: <b>[random-posts]<\/b>\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<li><!-- imhCmpix_-61.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-61.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-61.png\" alt=\"Click Preview button\"><\/a>Click the <b>Preview<\/b> link\n<div style=\"clear: both;\"><\/div>\n<\/li>\n<\/ol>\n<p><!-- imhCmpix_-62.png --><a href=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-62.png\" rel=\"lightbox-0\"><img decoding=\"async\" class=\"std_ss\" style=\"float: right; margin: 0px 15px 15px 15px; width: 200px;\" src=\"\/support\/images\/stories\/wordpress-development\/shortcodes\/imhCmpix_-62.png\" alt=\"Front end preview\"><\/a><\/p>\n<div style=\"clear: both;\"><\/div>\n<p>You will now see a preview page for your post. In the main body of the post, you will see a list containing five random posts from your site. This means you have successfully completed this tutorial. You can use this shortcode on any page or post.<\/p>\n<div style=\"clear: both;\"><\/div>\n<p>Well done! You now know how to easily create a <strong>random posts shortcode<\/strong> to any page or post in WordPress without plugins.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the course of developing your WordPress site, you have likely considered the importance of site navigation. Once users have visited your site, the goal is to provide more opportunities for the user to find other valuable content beyond the page they have landed on. This is why many WordPress themes come with sidebars and<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/\"> Read More ><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[56],"tags":[],"class_list":["post-4234","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create a Random Posts Shortcode | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"In this article, you&#039;ll learn how to create your own random posts shortcode.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a Random Posts Shortcode | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"In this article, you&#039;ll learn how to create your own random posts shortcode.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-07T18:49:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-09T14:00:25+00:00\" \/>\n<meta name=\"author\" content=\"Christopher Maiorana\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Christopher Maiorana\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/\"},\"author\":{\"name\":\"Christopher Maiorana\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f\"},\"headline\":\"How to Create a Random Posts Shortcode\",\"datePublished\":\"2017-11-07T18:49:35+00:00\",\"dateModified\":\"2023-06-09T14:00:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/\"},\"wordCount\":612,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"WordPress Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/\",\"name\":\"How to Create a Random Posts Shortcode | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2017-11-07T18:49:35+00:00\",\"dateModified\":\"2023-06-09T14:00:25+00:00\",\"description\":\"In this article, you'll learn how to create your own random posts shortcode.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create a Random Posts Shortcode\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f\",\"name\":\"Christopher Maiorana\",\"description\":\"Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/chris-m-4623144b\/\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/christopherm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a Random Posts Shortcode | InMotion Hosting","description":"In this article, you'll learn how to create your own random posts shortcode.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a Random Posts Shortcode | InMotion Hosting","og_description":"In this article, you'll learn how to create your own random posts shortcode.","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2017-11-07T18:49:35+00:00","article_modified_time":"2023-06-09T14:00:25+00:00","author":"Christopher Maiorana","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Christopher Maiorana","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/"},"author":{"name":"Christopher Maiorana","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f"},"headline":"How to Create a Random Posts Shortcode","datePublished":"2017-11-07T18:49:35+00:00","dateModified":"2023-06-09T14:00:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/"},"wordCount":612,"commentCount":1,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["WordPress Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/","name":"How to Create a Random Posts Shortcode | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2017-11-07T18:49:35+00:00","dateModified":"2023-06-09T14:00:25+00:00","description":"In this article, you'll learn how to create your own random posts shortcode.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/wordpress\/how-to-create-a-random-posts-shortcode\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Create a Random Posts Shortcode"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f","name":"Christopher Maiorana","description":"Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog.","sameAs":["https:\/\/www.linkedin.com\/in\/chris-m-4623144b\/"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/christopherm\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=4234"}],"version-history":[{"count":6,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4234\/revisions"}],"predecessor-version":[{"id":104992,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/4234\/revisions\/104992"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=4234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=4234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=4234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}