{"id":8813,"date":"2019-12-28T11:33:04","date_gmt":"2019-12-28T11:33:04","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=8813"},"modified":"2023-01-27T19:23:34","modified_gmt":"2023-01-27T13:53:34","slug":"discover-the-steps-to-use-wordpress-do-shortcode","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/","title":{"rendered":"Discover the Steps To Use WordPress do_shortcode"},"content":{"rendered":"<p>You can easily extend your site\u2019s functionality by using shortcodes. Shortcodes can be placed on any part of your website by using WordPress do_shortcode function. In this article, we will show you how to apply it. So, let\u2019s start by understanding the basics of shortcodes!<\/p>\n<h3>What Exactly is Shortcode?<\/h3>\n<p>A snippet of code, shortcode allows you to run a function such as displaying content. For instance, if you create a slider with the help of the MetaSlider plugin, you need to embed the plugin\u2019s shortcode into your site to show the slider.<\/p>\n<p>But, you can only embed it on the site\u2019s body or widget or else, the content won\u2019t get displayed. For resolving this issue, you can use WordPress do_shortcode function. By using it you can embed the shortcode anywhere you want \u2013 including the header. It looks as below:<\/p>\n<pre class=\"lang:default decode:true \">&lt;?php echo do_shortcode( '[your shortcode goes here]' ); ?&gt;<\/pre>\n<p>To apply this function, go to the theme files and tweak them. Ensure that you take a complete backup of your WordPress site and use the WordPress child theme in advance to avoid data loss if anything goes wrong.<\/p>\n<h3>Steps to Use WordPress do_shortcode<\/h3>\n<p>Now, let\u2019s try to add a shortcode using WordPress <strong>do_shortcode<\/strong>. For instance, suppose you want to add a slider in your theme\u2019s header using <strong>MetaSlider<\/strong> \u2013 ensure you\u2019ve installed the plugin. However, there is no widget for the header area.<\/p>\n<p>Therefore, you need to embed the shortcode of the slider to the theme\u2019s header file. For this, follow the below steps:<\/p>\n<ol>\n<li>Click on <strong>MetaSlider<\/strong> located on the left sidebar of the WordPress admin dashboard.<\/li>\n<li>Go to the bottom right of the page and copy the <strong>shortcode<\/strong>.<\/li>\n<\/ol>\n<p>If the MetaSlider\u2019s shortcode is already present within the WordPress <strong>do_shortcode<\/strong> function then edit the theme\u2019s header file by going to your hosting provider\u2019s file manager or an FTP client like <strong>FileZilla<\/strong>.<\/p>\n<p>The below steps will show you the steps to edit theme files with MilesWeb\u2019s file manager \u2013 it can be applied in an <strong>FTP<\/strong> client as well:<\/p>\n<ol>\n<li>Hover to your cPanel and click on <strong>File Manager<\/strong>.<\/li>\n<li>Navigate to the <strong>public_html<\/strong> folder and move to <strong>wp-contents -&gt; themes<\/strong>.<\/li>\n<li>Find and go to your currently active theme folder.<\/li>\n<li>Open <strong>header.php<\/strong>, then scroll down the page and add the <strong>do_shortcode<\/strong> function above the tag.<\/li>\n<li>Save and check your website appearance.<\/li>\n<\/ol>\n<p>Sometimes when you edit theme core files, it can break your WordPress template. For this, you should alter the CSS to improve your website\u2019s appearance.<\/p>\n<h3>Conclusion<\/h3>\n<p>In this way, you have learned to use shortcodes and display them using the WordPress do_shortcode function. Just add the shortcode into the theme\u2019s file, and you\u2019re ready to go! Remember to take the backup of your site before editing the file to avoid the risk of losing data.<\/p>\n<p>If you have any questions regarding the topic, drop a comment below!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can easily extend your site\u2019s functionality by using shortcodes. Shortcodes can be placed on any part of your website by using WordPress do_shortcode function. In this article, we will show you how to apply it. So, let\u2019s start by understanding the basics of shortcodes! What Exactly is Shortcode? A snippet of code, shortcode allows [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[1204,78,1203],"class_list":["post-8813","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-wordpress-faq","tag-improve-wordpress-website-functionality","tag-wordpress-2","tag-wordpress-do_shortcode"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Discover the Steps To Use WordPress do_shortcode<\/title>\n<meta name=\"description\" content=\"The article describes the steps to use WordPress do_shortcode for extending your site&#039;s functionality.\" \/>\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.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Discover the Steps To Use WordPress do_shortcode\" \/>\n<meta property=\"og:description\" content=\"The article describes the steps to use WordPress do_shortcode for extending your site&#039;s functionality.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-28T11:33:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-27T13:53:34+00:00\" \/>\n<meta name=\"author\" content=\"Pallavi Godse\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pallavi Godse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/\"},\"author\":{\"name\":\"Pallavi Godse\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"headline\":\"Discover the Steps To Use WordPress do_shortcode\",\"datePublished\":\"2019-12-28T11:33:04+00:00\",\"dateModified\":\"2023-01-27T13:53:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/\"},\"wordCount\":497,\"commentCount\":0,\"keywords\":[\"Improve WordPress website functionality\",\"WordPress\",\"WordPress do_shortcode\"],\"articleSection\":[\"WordPress FAQ\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/\",\"name\":\"Discover the Steps To Use WordPress do_shortcode\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2019-12-28T11:33:04+00:00\",\"dateModified\":\"2023-01-27T13:53:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"description\":\"The article describes the steps to use WordPress do_shortcode for extending your site's functionality.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Discover the Steps To Use WordPress do_shortcode\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\",\"name\":\"Pallavi Godse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"caption\":\"Pallavi Godse\"},\"description\":\"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.\",\"sameAs\":[\"https:\/\/www.milesweb.in\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Discover the Steps To Use WordPress do_shortcode","description":"The article describes the steps to use WordPress do_shortcode for extending your site's functionality.","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.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/","og_locale":"en_US","og_type":"article","og_title":"Discover the Steps To Use WordPress do_shortcode","og_description":"The article describes the steps to use WordPress do_shortcode for extending your site's functionality.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-12-28T11:33:04+00:00","article_modified_time":"2023-01-27T13:53:34+00:00","author":"Pallavi Godse","twitter_misc":{"Written by":"Pallavi Godse","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/"},"author":{"name":"Pallavi Godse","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"headline":"Discover the Steps To Use WordPress do_shortcode","datePublished":"2019-12-28T11:33:04+00:00","dateModified":"2023-01-27T13:53:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/"},"wordCount":497,"commentCount":0,"keywords":["Improve WordPress website functionality","WordPress","WordPress do_shortcode"],"articleSection":["WordPress FAQ"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/","name":"Discover the Steps To Use WordPress do_shortcode","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2019-12-28T11:33:04+00:00","dateModified":"2023-01-27T13:53:34+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"description":"The article describes the steps to use WordPress do_shortcode for extending your site's functionality.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/discover-the-steps-to-use-wordpress-do-shortcode\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"Discover the Steps To Use WordPress do_shortcode"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945","name":"Pallavi Godse","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","caption":"Pallavi Godse"},"description":"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.","sameAs":["https:\/\/www.milesweb.in"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/8813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=8813"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/8813\/revisions"}],"predecessor-version":[{"id":8814,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/8813\/revisions\/8814"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=8813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=8813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=8813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}