{"id":1798,"date":"2023-11-07T11:57:31","date_gmt":"2023-11-07T11:57:31","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=1798"},"modified":"2023-11-07T11:57:33","modified_gmt":"2023-11-07T11:57:33","slug":"vimeo","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/vimeo\/","title":{"rendered":"Vimeo Shortcode"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Vimeo 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 Vimeo 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 Vimeo 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\/vimeo\/assets\/icon-128x128.png?rev=2625237\" 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\/vimeo\" target=\"_blank\" rel=\"noopener\">\n                        Vimeo                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;Vimeo Plugin is a powerful tool that integrates seamlessly with your WordPress site, enabling smooth display and management of Vimeo videos directly on your webpages.&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\u2606<\/span> (5)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 5000+\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>: 5.6            <\/span>\n        <\/div>\n\n        <!-- List of Included Shortcodes -->\n        <div class=\"plugin-shortcodes\">\n            <strong>Included Shortcodes:<\/strong>\n            <ul>\n                <li>[vimeo_embed]<\/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\">Vimeo [vimeo_embed] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Vimeo Embed shortcode is a powerful tool that allows you to embed Vimeo videos directly into your WordPress site. \n\n\n\nThis shortcode uses the Vimeo Embed function to generate a unique ID for each embedded video, ensuring seamless integration and playback. It also allows for customization of video attributes, providing flexibility in presentation and design.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[vimeo_embed]<\/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 vimeo_embed shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>params<\/code> &#8211; Input array that overrides default settings for the Vimeo video<\/li>\n<li><code>atts<\/code> &#8211; Array that holds default or overridden settings for the Vimeo video<\/li>\n<li><code>id<\/code> &#8211; Unique identifier for each Vimeo video embedded on the page<\/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 usage of the Vimeo Embed shortcode would be to provide the ID of the Vimeo video you want to embed. This example demonstrates how to embed a Vimeo video with the ID &#8216;123456&#8217;.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[vimeo_embed id=123456 \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>1. Embedding a Vimeo video with custom width and height: In this example, we not only provide the ID of the Vimeo video, but also specify the width and height of the embedded video. The video will be embedded with a width of &#8216;500px&#8217; and a height of &#8216;300px&#8217;.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[vimeo_embed id=123456 width=500 height=300 \/]<\/code><\/pre>\n\n\n<p>2. Embedding a Vimeo video with autoplay: If you want the video to start playing automatically once the page is loaded, you can add the &#8216;autoplay&#8217; parameter and set it to &#8216;true&#8217;. This example demonstrates how to embed a Vimeo video with the ID &#8216;123456&#8217; that will autoplay.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[vimeo_embed id=123456 autoplay=true \/]<\/code><\/pre>\n\n\n<p>Please note that not all browsers allow autoplay videos, and the user&#8217;s settings may also override this parameter.<\/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>[vimeo_embed]<\/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( 'vimeo_embed', [ new Vimeo_Embed(), 'vimeo_embed'] );<\/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 vimeo_embed( $params = &#91;] ) {\n\t\t$atts = shortcode_atts( $this-&gt;embed-&gt;get_defaults(), $params, &#039;vimeo_embed&#039; );\n\t\t$id   = &#039;vimeo-wc-video-&#039; . uniqid();\n\n\t\treturn sprintf(\n\t\t\t&#039;&lt;div style=&quot;width: 100%%; min-height: 1px;&quot; id=&quot;%s&quot; data-js=&quot;vimeo-wc-video&quot; data-atts=&quot;%s&quot;&gt;&lt;\/div&gt;&#039;,\n\t\t\tesc_attr( $id ),\n\t\t\tesc_attr( wp_json_encode( $atts ) )\n\t\t);\n\t}\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\">vimeo\/vimeo\/src\/Core.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>Vimeo 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 Vimeo 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 Vimeo Plugin shortcode 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":"Vimeo","slug":"","version":"1.2.1","author":"<a href=\"https:\/\/vimeo.com\/?vcid=40637\">Vimeo<\/a>","icons":"https:\/\/ps.w.org\/vimeo\/assets\/icon-128x128.png?rev=2625237","plugin_tags":"{\"blocks\":\"blocks\",\"upload\":\"upload\",\"video\":\"video\",\"video-library\":\"video library\",\"vimeo\":\"vimeo\"}","author_profile":"https:\/\/profiles.wordpress.org\/vimeodev\/","requires":"5.4","tested":"6.1.4","requires_php":"5.6","rating":96,"num_ratings":5,"active_installs":5000,"downloaded":27762,"last_updated":"2022-11-16 3:39pm GMT","added":"2021-10-06","homepage":"https:\/\/vimeo.com\/create?vcid=40636","short_description":"Bring the power of video to your WordPress site and WooCommerce product pages by easily creating, uploading, and embedding videos to boost engagement  &hellip;","description":"\"Vimeo Plugin is a powerful tool that integrates seamlessly with your WordPress site, enabling smooth display and management of Vimeo videos directly on your webpages.\"","shortcodes":"[\"vimeo_embed\"]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1798","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/1798","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=1798"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/1798\/revisions"}],"predecessor-version":[{"id":2007,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/1798\/revisions\/2007"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=1798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=1798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=1798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}