{"id":2217,"date":"2024-03-01T09:55:46","date_gmt":"2024-03-01T09:55:46","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=2217"},"modified":"2024-03-01T09:55:47","modified_gmt":"2024-03-01T09:55:47","slug":"sitekit","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/sitekit\/","title":{"rendered":"Sitekit Shortcodes"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Sitekit Shortcodes<\/strong> to your WordPress website, including their <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 Sitekit Plugin shortcodes 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 Sitekit 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\/sitekit\/assets\/icon-128x128.png?rev=1384456\" 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\/sitekit\" target=\"_blank\" rel=\"noopener\">\n                        Sitekit                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;Sitekit is a powerful WordPress plugin designed to enhance your website&#039;s functionality. It simplifies site management, offering tools for SEO, speed optimization, and more. Elevate your WordPress experience with Sitekit.&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\u2605<\/span> (1)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 3000+\n            <\/span>\n            <span class=\"plugin-tested\">\n                <strong>Tested with<\/strong>: 6.3.2            <\/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>[sitekit_archives]<\/li><li>[sitekit_bloginfo]<\/li><li>[sitekit_categories]<\/li><li>[sitekit_iframe]<\/li><li>[]<\/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\">Sitekit [sitekit_archives] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Sitekit Archives shortcode is a powerful tool for displaying your website&#8217;s archives. This shortcode allows you to specify the type of archives to display (yearly, monthly, weekly, daily, or post-by-post), limit the number of entries, format the output, and more.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[sitekit_archives]<\/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\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible sitekit_archives shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>type<\/code> &#8211; Specifies the type of archive to display (yearly, monthly, weekly, daily, postbypost, alpha).<\/li>\n<li><code>limit<\/code> &#8211; Sets the maximum number of archives to show.<\/li>\n<li><code>format<\/code> &#8211; Defines the format of the archive list (html, option).<\/li>\n<li><code>before<\/code> &#8211; Text or HTML to place before each archive.<\/li>\n<li><code>after<\/code> &#8211; Text or HTML to place after each archive.<\/li>\n<li><code>show_post_count<\/code> &#8211; If set to 1, displays the number of posts in each archive.<\/li>\n<li><code>echo<\/code> &#8211; If set to 0, returns the archive list instead of echoing it.<\/li>\n<li><code>order<\/code> &#8211; Sets the order of the archives (ASC, DESC).<\/li>\n<\/ul>\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; Display the archives in a monthly format with the default settings.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_archives]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Display the archives in a yearly format as an HTML unordered list, showing the post count, and in ascending order.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_archives type=\"yearly\" format=\"html\" show_post_count=\"1\" order=\"ASC\"]<\/code><\/pre>\n\n\n<p>Display the archives in a daily format as a dropdown, without showing the post count, and in descending order.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_archives type=\"daily\" format=\"option\" show_post_count=\"0\" order=\"DESC\"]<\/code><\/pre>\n\n\n<p>Display the archives in an alpha format (sorted by post title) as plain text, showing the post count, and in ascending order.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_archives type=\"alpha\" format=\"other\" show_post_count=\"1\" order=\"ASC\"]<\/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>[sitekit_archives]<\/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( 'sitekit_archives', 'sitekit_shortcode_archives' );<\/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 sitekit_shortcode_archives( $atts ) {\n\t$defaults = array(\n\t\t&#039;type&#039; =&gt; &#039;monthly&#039;,\n\t\t&#039;limit&#039; =&gt; &#039;&#039;,\n\t\t&#039;format&#039; =&gt; &#039;html&#039;,\n\t\t&#039;before&#039; =&gt; &#039;&#039;,\n\t\t&#039;after&#039; =&gt; &#039;&#039;,\n\t\t&#039;show_post_count&#039; =&gt; 0,\n\t\t&#039;echo&#039; =&gt; 0,\n\t\t&#039;order&#039; =&gt; &#039;DESC&#039;\n\t);\n\t$atts_obj = shortcode_atts( $defaults, $atts );\n\t\n\t$archives = wp_get_archives( $atts_obj );\n\t\n\tif ( $atts_obj&#91;&#039;format&#039;] == &#039;option&#039; ) { \/\/ Archives as a dropdown\n\n\t\t\/\/ Create a title for the drop-down based on the archive type\n\t\tif ( $atts_obj&#91;&#039;type&#039;] == &#039;yearly&#039; ) {\n\t\t\t$option_title = __( &#039;Select Year&#039;, &#039;sitekit&#039; );\n\n\t\t} elseif ( $atts_obj&#91;&#039;type&#039;] == &#039;monthly&#039; ) {\n\t\t\t$option_title = __( &#039;Select Month&#039;, &#039;sitekit&#039; );\n\n\t\t} elseif ( $atts_obj&#91;&#039;type&#039;] == &#039;weekly&#039; ) {\n\t\t\t$option_title = __( &#039;Select Week&#039;, &#039;sitekit&#039; );\n\n\t\t} elseif ( $atts_obj&#91;&#039;type&#039;] == &#039;daily&#039; ) {\n\t\t\t$option_title = __( &#039;Select Day&#039;, &#039;sitekit&#039; );\n\n\t\t} elseif ( $atts_obj&#91;&#039;type&#039;] == &#039;postbypost&#039; || $atts_obj&#91;&#039;type&#039;] == &#039;alpha&#039; ) {\n\t\t\t$option_title = __( &#039;Select Post&#039;, &#039;sitekit&#039; );\n\t\t}\n\t\t\/\/ Output the &lt;select&gt; element and each &lt;option&gt;\n\t\t$archives_output = &#039;&lt;p class=&quot;sitekit-archives&quot;&gt;&lt;select name=&quot;archive-dropdown&quot; onchange=\\&#039;document.location.href=this.options&#91;this.selectedIndex].value;\\&#039;&gt;&#039;;\n\t\t\t$archives_output .= &#039;&lt;option value=&quot;&quot;&gt;&#039; . $option_title . &#039;&lt;\/option&gt;&#039;;\n\t\t\t$archives_output .= $archives;\n\t\t$archives_output .= &#039;&lt;\/select&gt;&lt;\/p&gt;&lt;!-- .sitekit-archives --&gt;&#039;;\n\t\t\n\t} elseif ( $atts_obj&#91;&#039;format&#039;] == &#039;html&#039; ) { \/\/ Archives as an unordered list\n\n\t\t$archives_output = &#039;&lt;ul class=&quot;sitekit-archives&quot;&gt;&#039; . $archives . &#039;&lt;\/ul&gt;&lt;!-- .sitekit-archives --&gt;&#039;;\n\n\t} else { \/\/ Other formats\n\n\t\t$archives_output = $archives;\n\n\t}\n\t\n\treturn $archives_output . SITEKIT_PLUGIN_POWERED;\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\">sitekit\/sitekit\/inc\/sitekit-shortcode-archives.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\">Sitekit [sitekit_bloginfo] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Sitekit Bloginfo shortcode is a useful tool for WordPress users. It allows retrieval of information about the blog by using get_bloginfo() function. \n\n\n\nThis shortcode accepts an attribute &#8216;show&#8217; which defaults to &#8216;name&#8217;. Depending on the &#8216;show&#8217; attribute, it returns the blog name, description, URL, or other blog information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[sitekit_bloginfo]<\/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\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible sitekit_bloginfo shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>show<\/code> &#8211; defines what blog information to display<\/li>\n<\/ul>\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; A simple way to use the &#8216;sitekit_bloginfo&#8217; shortcode is to display the name of the blog. Here&#8217;s how you can do it:<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_bloginfo show=\"name\" \/]<\/code><\/pre>\n\n\n<p>With this shortcode, you can easily display the name of your blog anywhere on your site where shortcodes are supported.<\/p>\n<p><strong>Advanced examples<\/strong><\/p>\n<p>One of the powerful features of the &#8216;sitekit_bloginfo&#8217; shortcode is its ability to display different types of information based on the &#8216;show&#8217; attribute. For instance, you can use it to display the description of your blog:<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_bloginfo show=\"description\" \/]<\/code><\/pre>\n\n\n<p>This shortcode will return the description of your blog, as defined in your WordPress settings.<\/p>\n<p>You can also use the &#8216;sitekit_bloginfo&#8217; shortcode to display the URL of your blog. Here&#8217;s how:<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_bloginfo show=\"url\" \/]<\/code><\/pre>\n\n\n<p>The above shortcode will return the URL of your blog, allowing you to easily insert it into your posts or pages.<\/p>\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>[sitekit_bloginfo]<\/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( 'sitekit_bloginfo', 'sitekit_shortcode_bloginfo' );<\/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 sitekit_shortcode_bloginfo( $atts ) {\n\textract(shortcode_atts(array(\n\t\t&#039;show&#039; =&gt; &#039;name&#039;\n\t), $atts));\n\treturn get_bloginfo($show);\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\">sitekit\/sitekit\/inc\/sitekit-shortcode-bloginfo.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\">Sitekit [sitekit_categories] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Sitekit Categories shortcode is a powerful tool that lists your website&#8217;s categories. It allows you to customize the order, display count, hierarchy, and more. \n\n\n\nThis shortcode fetches and displays categories based on specified attributes. It can hide empty categories and sort them by name or count. It can also exclude certain categories.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[sitekit_categories]<\/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\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible sitekit_categories shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>orderby<\/code> &#8211; Determines the order of categories based on name or ID<\/li>\n<li><code>order<\/code> &#8211; Sets the direction of the order, ascending (ASC) or descending (DESC)<\/li>\n<li><code>show_count<\/code> &#8211; Decides whether to display the number of posts in each category<\/li>\n<li><code>hide_empty<\/code> &#8211; Decides whether to hide categories without posts<\/li>\n<li><code>hierarchical<\/code> &#8211; Determines whether child categories should be included<\/li>\n<li><code>depth<\/code> &#8211; Controls how many levels of the hierarchy of categories are included<\/li>\n<li><code>taxonomy<\/code> &#8211; Specifies the taxonomy to retrieve categories from<\/li>\n<li><code>child_of<\/code> &#8211; Retrieves categories that are children of the specified category<\/li>\n<li><code>exclude<\/code> &#8211; Excludes certain categories from the list<\/li>\n<li><code>exclude_tree<\/code> &#8211; Excludes a category and all its children<\/li>\n<li><code>title_li<\/code> &#8211; Sets the title for the list of categories<\/li>\n<li><code>show_option_all<\/code> &#8211; Shows an option to view all categories<\/li>\n<li><code>show_option_none<\/code> &#8211; Displays a message when no categories are available<\/li>\n<li><code>feed<\/code> &#8211; Adds a feed link to each category<\/li>\n<li><code>echo<\/code> &#8211; Decides whether to echo the list of categories or return it<\/li>\n<\/ul>\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; Display categories ordered by name in ascending order.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_categories orderby=\"name\" order=\"ASC\"]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Display categories ordered by count in descending order, excluding a specific category.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_categories orderby=\"count\" order=\"DESC\" exclude=\"10\"]<\/code><\/pre>\n\n\n<p>Show all categories including the ones without any posts, ordered by name in descending order.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_categories orderby=\"name\" order=\"DESC\" hide_empty=\"0\"]<\/code><\/pre>\n\n\n<p>Display categories in a hierarchical order, excluding a specific category tree.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_categories hierarchical=\"1\" exclude_tree=\"5\"]<\/code><\/pre>\n\n\n<p>Show categories with a feed link, ordered by name in ascending order.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_categories orderby=\"name\" order=\"ASC\" feed=\"RSS\"]<\/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>[sitekit_categories]<\/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( 'sitekit_categories', 'sitekit_shortcode_categories' );<\/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 sitekit_shortcode_categories( $atts ) {\n\t$defaults = array(\n\t\t&#039;orderby&#039; =&gt; &#039;name&#039;,\n\t\t&#039;order&#039; =&gt; &#039;ASC&#039;,\n\t\t&#039;show_count&#039; =&gt; 0,\n\t\t&#039;hide_empty&#039; =&gt; 1,\n\t\t&#039;hierarchical&#039; =&gt; 1,\n\t\t&#039;depth&#039; =&gt; 0,\n\t\t&#039;taxonomy&#039; =&gt; &#039;category&#039;,\n\t\t&#039;child_of&#039; =&gt; 0,\n\t\t&#039;exclude&#039; =&gt; &#039;&#039;,\n\t\t&#039;exclude_tree&#039; =&gt; &#039;&#039;,\n\t\t&#039;title_li&#039; =&gt; &#039;&#039;,\n\t\t&#039;show_option_all&#039; =&gt; &#039;&#039;,\n\t\t&#039;show_option_none&#039; =&gt; &#039;&#039;,\n\t\t&#039;feed&#039; =&gt; &#039;&#039;,\n\t\t&#039;echo&#039; =&gt; 0\n\t);\n\t$atts_obj = shortcode_atts( $defaults, $atts );\n\t\n\t$categories = wp_list_categories( $atts_obj );\n\t\n\t$categories = &quot;\\n&quot;.&#039;&lt;ul class=&quot;sitekit-categories&quot;&gt;&#039; . &quot;\\n&quot; . $categories . &quot;\\n&quot; . &#039;&lt;\/ul&gt;&lt;!-- .sitekit-categories --&gt;&#039; . &quot;\\n&quot;;\n\t\n\treturn $categories . SITEKIT_PLUGIN_POWERED;\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\">sitekit\/sitekit\/inc\/sitekit-shortcode-categories.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\">Sitekit [sitekit_iframe] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Sitekit iframe shortcode is a flexible tool for embedding content. It allows users to customize the source URL, dimensions, scrolling, and frameborder of the iframe.\n\n\n\nThe default values can be overridden by providing new parameters. It sanitizes the URL and excludes any attributes starting with &#8220;on&#8221;, enhancing security.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[sitekit_iframe]<\/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\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible sitekit_iframe shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>src<\/code> &#8211; URL of the content to display in the iframe<\/li>\n<li><code>width<\/code> &#8211; width of the iframe, can be in pixels or percentage<\/li>\n<li><code>height<\/code> &#8211; height of the iframe in pixels<\/li>\n<li><code>scrolling<\/code> &#8211; allows or disallows scrolling in the iframe<\/li>\n<li><code>frameborder<\/code> &#8211; controls the appearance of the border around the iframe<\/li>\n<\/ul>\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; Embeds a YouTube video using the default parameters.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_iframe]<\/code><\/pre>\n\n\n<p><strong>Advanced Examples<\/strong><\/p>\n<p>Embeds a Vimeo video by specifying the &#8216;src&#8217; parameter and adjusting the height and width of the iframe.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_iframe src=\"http:\/\/vimeo.com\/123456789\" width=\"800\" height=\"600\"]<\/code><\/pre>\n\n\n<p>Embeds a Google Maps location by specifying the &#8216;src&#8217; parameter, adjusting the height and width of the iframe, and disabling scrolling.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_iframe src=\"https:\/\/www.google.com\/maps\/embed?pb=!1m18!1m12!1m3!1d3151.8354345096036!2d144.95373531533367!3d-37.817209979751795!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6ad642af0f11fd81%3A0x5045675218ce6e0!2sMelbourne%20VIC%2C%20Australia!5e0!3m2!1sen!2sus!4v1574224245000\" width=\"800\" height=\"600\" scrolling=\"no\"]<\/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>[sitekit_iframe]<\/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( 'sitekit_iframe', 'sitekit_shortcode_iframe' );<\/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 sitekit_shortcode_iframe( $atts ) {\n\t$defaults = array(\n\t\t&#039;src&#039; =&gt; &#039;http:\/\/www.youtube.com\/embed\/4qsGTXLnmKs&#039;,\n\t\t&#039;width&#039; =&gt; &#039;100%&#039;,\n\t\t&#039;height&#039; =&gt; &#039;500&#039;,\n\t\t&#039;scrolling&#039; =&gt; &#039;yes&#039;,\n\t\t&#039;frameborder&#039; =&gt; &#039;0&#039;\n\t);\n\n\tforeach ( $defaults as $default =&gt; $value ) { \/\/ add defaults\n\t\tif ( ! @array_key_exists( $default, $atts ) ) { \/\/ mute warning with &quot;@&quot; when no params at all\n\t\t\t$atts&#91;$default] = $value;\n\t\t}\n\t}\n\n\t$html = &quot;\\n&quot;.&#039;&lt;iframe&#039;;\n\tforeach( $atts as $attr =&gt; $value ) {\n\t\t\/\/ sanitize url\n\t\tif ( strtolower($attr) == &#039;src&#039; ) {\n\t\t\t$value = esc_url( $value );\n\t\t}\n\t\t\/\/ remove all attributes starting with &quot;on&quot;. Examples: onload, onmouseover, onfocus, onpageshow, onclick\n\t\tif ( strpos( strtolower( $attr ), &#039;on&#039; ) !== 0 ) {\n\t\t\tif ( $value != &#039;&#039; ) {\n\t\t\t\t\/\/ adding all attributes\n\t\t\t\t$html .= &#039; &#039; . esc_attr( $attr ) . &#039;=&quot;&#039; . esc_attr( $value ) . &#039;&quot;&#039;;\n\t\t\t} else {\n\t\t\t\t\/\/ adding empty attributes\n\t\t\t\t$html .= &#039; &#039; . esc_attr( $attr );\n\t\t\t}\n\t\t}\n\t}\n\t$html .= &#039;&gt;&lt;\/iframe&gt;&#039;.&quot;\\n&quot;;\n\n\treturn $html . SITEKIT_PLUGIN_POWERED;\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\">sitekit\/sitekit\/inc\/sitekit-shortcode-iframe.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\">Sitekit [null] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Sitekit Posts shortcode is a powerful tool that fetches and displays posts based on specified parameters. The shortcode: [sitekit_posts] allows you to customize the post type, order, and other attributes.\n\nThe PHP function &#8216;sitekit_shortcode_posts&#8217; defines these parameters, such as post type, posts per page, and order. It then creates a new WP_Query object with these attributes.\n\nThe function loops through the posts and generates an HTML structure, displaying each post&#8217;s title as a link. If no posts match the criteria, it displays an error message.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[null]<\/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\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible null shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>post_type<\/code> &#8211; Specifies the type of posts to display<\/li>\n<li><code>posts_per_page<\/code> &#8211; Defines the number of posts per page<\/li>\n<li><code>paged<\/code> &#8211; Controls the page number to display<\/li>\n<li><code>post_status<\/code> &#8211; Filters the posts by their publication status<\/li>\n<li><code>ignore_sticky_posts<\/code> &#8211; Skips over sticky posts if set to true<\/li>\n<li><code>order<\/code> &#8211; Sets the direction of the posts order<\/li>\n<li><code>orderby<\/code> &#8211; Determines the parameter to order the posts by<\/li>\n<\/ul>\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; Displays a list of the most recent posts on your site.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_posts]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Display a list of the most recent posts, but limit the number of posts to 5.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_posts posts_per_page=5]<\/code><\/pre>\n\n\n<p>Display a list of posts, but order them in ascending order based on the post title.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_posts order='ASC' orderby='title']<\/code><\/pre>\n\n\n<p>Display a list of posts from a specific post type, for example &#8216;product&#8217;.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_posts post_type='product']<\/code><\/pre>\n\n\n<p>Display a list of posts, but exclude sticky posts.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[sitekit_posts ignore_sticky_posts=true]<\/code><\/pre>\n\n\n<p>These examples demonstrate the versatility of the &#8216;sitekit_posts&#8217; shortcode and how it can be customized with different attributes to suit your specific needs.<\/p>\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>[null]<\/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( 'sitekit_posts', 'sitekit_shortcode_posts' );<\/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 sitekit_shortcode_posts( $atts ) {\n\t\n\tif ( get_query_var(&#039;paged&#039;) ) {\n\t\t$paged = get_query_var(&#039;paged&#039;);\n\t} elseif ( get_query_var(&#039;page&#039;) ) { \/\/ &#039;page&#039; is used instead of &#039;paged&#039; on Static Front Page\n\t\t$paged = get_query_var(&#039;page&#039;);\n\t} else {\n\t\t$paged = 1;\n\t}\n\t\n\t$defaults = array(\n\t\t&#039;post_type&#039; =&gt; &#039;post&#039;,\n\t\t&#039;posts_per_page&#039; =&gt; 100, \/\/get_option(&#039;posts_per_page&#039;),\n\t\t&#039;paged&#039; =&gt; $paged,\n\t\t&#039;post_status&#039; =&gt; &#039;publish&#039;,\n\t\t&#039;ignore_sticky_posts&#039; =&gt; true,\n\t\t\/\/&#039;cat&#039; =&gt; 47,\n\t\t\/\/&#039;category_name&#039; =&gt; &#039;custom-cat&#039;,\n\t\t&#039;order&#039; =&gt; &#039;DESC&#039;, \/\/ &#039;ASC&#039;\n\t\t&#039;orderby&#039; =&gt; &#039;date&#039; \/\/ modified | title | name | ID | rand\n\t);\n\t$atts_obj = shortcode_atts( $defaults, $atts );\n\t\n\t$custom_query = new WP_Query( $atts_obj );\n\t\n\t\/\/print_r($atts);\n\t\n\t$posts_output = &#039;&#039;;\n\n\tif ( $custom_query-&gt;have_posts() ) :\n\t\t$posts_output .= &#039;&lt;ul class=&quot;sitekit-posts&quot;&gt;&#039;.&quot;\\n&quot;;\n\t\twhile( $custom_query-&gt;have_posts() ) : $custom_query-&gt;the_post();\n\t\t\t$posts_output .= &#039;&lt;li&gt;&#039;;\n\t\t\t$posts_output .= &#039;&lt;a href=&quot;&#039;. get_permalink() .&#039;&quot;&gt;&#039;. get_the_title(). &#039;&lt;\/a&gt;&#039;;\n\t\t\t$posts_output .= &#039;&lt;\/li&gt;&#039;.&quot;\\n&quot;;\n\t\tendwhile;\n\t\t$posts_output .= &#039;&lt;\/ul&gt;&lt;!-- .sitekit-posts --&gt;&#039;.&quot;\\n&quot;;\n\t\tif ($custom_query-&gt;max_num_pages &gt; 1) : \/\/ custom pagination\n\t\t\t\/\/$orig_query = $wp_query; \/\/ fix for pagination to work\n\t\t\t\/\/$wp_query = $custom_query;\n\t\t\t\/* ?&gt;\n\t\t\t&lt;nav class=&quot;prev-next-posts&quot;&gt;\n\t\t\t\t&lt;div class=&quot;prev-posts-link&quot;&gt;\n\t\t\t\t\t&lt;?php echo get_next_posts_link( &#039;Older Entries&#039;, $custom_query-&gt;max_num_pages ); ?&gt;\n\t\t\t\t&lt;\/div&gt;\n\t\t\t\t&lt;div class=&quot;next-posts-link&quot;&gt;\n\t\t\t\t\t&lt;?php echo get_previous_posts_link( &#039;Newer Entries&#039; ); ?&gt;\n\t\t\t\t&lt;\/div&gt;\n\t\t\t&lt;\/nav&gt;\n\t\t\t&lt;?php *\/\n\t\t\t\/\/$wp_query = $orig_query; \/\/ fix for pagination to work\n\t\tendif;\n\t \n\t\twp_reset_postdata(); \/\/ reset the query \n\telse:\n\t\t$posts_output .= &#039;&lt;p&gt;&#039;.__(&#039;Sorry, no posts matched your criteria.&#039;, &#039;sitekit&#039;).&#039;&lt;\/p&gt;&#039;;\n\tendif;\n\t\n\treturn $posts_output . SITEKIT_PLUGIN_POWERED;\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\">sitekit\/sitekit\/inc\/sitekit-shortcode-posts.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>Sitekit Plugin shortcodes<\/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 Sitekit Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we&#8217;ll assist you with common issues that might cause the Sitekit Plugin shortcodes not to show or not to work correctly. Before starting, here is an overview of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"name":"Sitekit","slug":"","version":"1.5","author":"<a href=\"http:\/\/web-profile.net\/wordpress\/plugins\/\">webvitaly<\/a>","icons":"https:\/\/ps.w.org\/sitekit\/assets\/icon-128x128.png?rev=1384456","plugin_tags":"{\"archive\":\"archive\",\"archives\":\"archives\",\"search\":\"search\",\"widget\":\"widget\",\"widgets\":\"widgets\"}","author_profile":"https:\/\/profiles.wordpress.org\/webvitaly\/","requires":"4.0","tested":"6.3.2","requires_php":"false","rating":100,"num_ratings":1,"active_installs":3000,"downloaded":27644,"last_updated":"2023-09-23 11:43pm GMT","added":"2016-03-31","homepage":"https:\/\/wordpress.org\/plugins\/sitekit\/","short_description":"Widgets: search, archives and categories. Shortcodes: archives, bloginfo, iframe and categories.","description":"\"Sitekit is a powerful WordPress plugin designed to enhance your website's functionality. It simplifies site management, offering tools for SEO, speed optimization, and more. Elevate your WordPress experience with Sitekit.\"","shortcodes":"[\"sitekit_archives\",\"sitekit_bloginfo\",\"sitekit_categories\",\"sitekit_iframe\",null]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-2217","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2217","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=2217"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2217\/revisions"}],"predecessor-version":[{"id":2739,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2217\/revisions\/2739"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=2217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=2217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=2217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}