{"id":1237,"date":"2023-10-26T13:19:55","date_gmt":"2023-10-26T13:19:55","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=1237"},"modified":"2023-10-26T13:19:56","modified_gmt":"2023-10-26T13:19:56","slug":"advanced-random-posts-widget-2","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/advanced-random-posts-widget-2\/","title":{"rendered":"Advanced Random Posts Widget Shortcode"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Advanced Random Posts Widget Shortcode<\/strong> to your WordPress website, including its <strong>parameters<\/strong>, <strong>examples<\/strong>, and <strong>PHP function code<\/strong>. Additionally, we&#8217;ll assist you with common issues that might cause the Advanced Random Posts Widget Plugin shortcode not to show or not to work correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, here is an overview of the Advanced Random Posts Widget Plugin and the shortcodes it provides:<\/p>\n\n\n<p>    <div class=\"plugin-info-box\">\n        <div class=\"top-main\">\n            <!-- SVG Image -->\n            <div class=\"plugin-image\">\n                <img decoding=\"async\" src=\"https:\/\/ps.w.org\/advanced-random-posts-widget\/assets\/icon-256x256.png?rev=2046099\" alt=\"Plugin Icon\" \/>\n            <\/div>\n            \n            <div class=\"plugin-descriptive-part\">\n                <!-- Plugin Name with Link -->\n\n                    <a class=\"plugin-title\" href=\"https:\/\/wordpress.org\/plugins\/advanced-random-posts-widget-2\" target=\"_blank\" rel=\"noopener\">\n                        Advanced Random Posts Widget                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;Advanced Random Posts Widget is a powerful WordPress plugin that dynamically displays random posts on your website. Ideal for boosting user engagement and showcasing diverse content.&quot;                <\/p>\n            <\/div>\n        <\/div>\n\n        <!-- Rating and Additional Info -->\n        <div class=\"plugin-meta\">\n            <span class=\"plugin-rating\">\n                <span class='stars'>\u2605\u2605\u2605\u2605\u2729<\/span> (39)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 20000+\n            <\/span>\n            <span class=\"plugin-tested\">\n                <strong>Tested with<\/strong>: 6.1.4            <\/span>\n            <span class=\"plugin-php-version\">\n                <strong>PHP Version<\/strong>: false            <\/span>\n        <\/div>\n\n        <!-- List of Included Shortcodes -->\n        <div class=\"plugin-shortcodes\">\n            <strong>Included Shortcodes:<\/strong>\n            <ul>\n                <li>[arpw]<\/li>            <\/ul>\n        <\/div>\n    <\/div>\n    <\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Advanced Random Posts Widget [arpw] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Advanced Random Posts Widget (arpw) shortcode is a tool that fetches and displays random posts on your WordPress site. \n\n\n\nThe shortcode is defined by add_shortcode( &#8216;arpw&#8217;, &#8216;arpw_shortcode&#8217; ). It calls the function &#8216;arpw_shortcode&#8217;, which retrieves the shortcode attributes, loads the default style, and then returns random posts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[arpw]<\/code><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n\n\n<p><strong>Basic example<\/strong> &#8211; The shortcode is used to display random posts on the webpage.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[arpw]<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[arpw]<\/code> shortcode, check below the related PHP functions code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode( 'arpw', 'arpw_shortcode' );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nfunction arpw_shortcode( $atts ) {\n\n\t\/\/ Get shortcode attr\n\t$args = shortcode_atts( arpw_get_default_args(), $atts );\n\n\t\/\/ Load default style\n\twp_enqueue_style( &#039;arpw-style&#039; );\n\n\t\/\/ Display the shortcode content\n\treturn arpw_get_random_posts( $args, get_the_ID() );\n\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">advanced-random-posts-widget\/advanced-random-posts-widget\/includes\/shortcode.php<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you&#8217;ve learned how to embed the <strong>Advanced Random Posts Widget Plugin shortcode<\/strong>, understood the parameters, and seen code examples, it&#8217;s easy to use and debug any issue that might cause it to &#8216;not work&#8217;. If you still have difficulties with it, don&#8217;t hesitate to leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below, you&#8217;ll find a detailed guide on how to add the Advanced Random Posts Widget Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we&#8217;ll assist you with common issues that might cause the Advanced Random Posts Widget Plugin shortcode not to show or not to work correctly. Before starting, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"name":"Advanced Random Posts Widget","slug":"","version":"2.2.1","author":"<a href=\"https:\/\/idenovasi.com\/\">satrya<\/a>","icons":"https:\/\/ps.w.org\/advanced-random-posts-widget\/assets\/icon-256x256.png?rev=2046099","plugin_tags":"{\"random-posts\":\"Random Posts\",\"sidebar\":\"sidebar\",\"thumbnail\":\"thumbnail\",\"widget\":\"widget\",\"widgets\":\"widgets\"}","author_profile":"https:\/\/profiles.wordpress.org\/satrya\/","requires":"4.5","tested":"6.1.4","requires_php":"false","rating":80,"num_ratings":39,"active_installs":20000,"downloaded":201720,"last_updated":"2023-08-05 11:11am GMT","added":"2013-02-11","homepage":"https:\/\/github.com\/idenovasi\/advanced-random-posts-widget","short_description":"Provides flexible and advanced random posts. Display it via shortcode or widget with thumbnails, post excerpt, and much more!","description":"\"Advanced Random Posts Widget is a powerful WordPress plugin that dynamically displays random posts on your website. Ideal for boosting user engagement and showcasing diverse content.\"","shortcodes":"[\"arpw\"]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1237","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/1237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/comments?post=1237"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/1237\/revisions"}],"predecessor-version":[{"id":1502,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/1237\/revisions\/1502"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=1237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=1237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=1237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}