
១.ចូលទៅកាន់ Theme => Edit HTML រួចចម្លងកូដខាងក្រោមដាក់ពីខាងលើ </head>
២.ចម្លងកូដខាងក្រោមដាក់ពីខាងលើ </body> បន្ទាប់មកចុច Icon Save រួចចាកចេញពីផ្ទាំង Edit HTML
$('#ok-playlist').each(function () {
let $this = $(this),
zeroIndex = 0,
isDotBlogSpot = false;
const okUrl = (isUrl) => {
isUrl = isDotBlogSpot === true ? "https://vdoview.tumblr.com/?id=" : "https://ok.ru/videoembed/";
return isUrl;
}
const autoPlay = (isAutoPlay) => {
isAutoPlay = isDotBlogSpot !== true ? "?autoplay=1" : "";
return isAutoPlay;
}
const buildOkDotRu = () => {
let okDotRu = "";
okDotRu += '<div class="ok-container">';
okDotRu += '<div class="ok-responsive">';
okDotRu += '<iframe id="ok-iframe" src="' + okUrl() + window.atob(okVideoID[zeroIndex]) + '" width="100%" height="100%" allowfullscreen="true" loading="lazy"></iframe></div>';
okDotRu += '<div class="ok-wrap">';
okDotRu += '<div class="ok-playlist">';
okVideoID.forEach((okItems, index) => {
okDotRu += '<div class="ok-list" data-id="' + okVideoID[index] + '">' + (index + 1) + '</div>';
});
okDotRu += '</div></div></div>';
return okDotRu;
}
const activeFirstVideo = (isFirstVideo) => {
isFirstVideo = $('.ok-list').first().addClass('is-active');
return isFirstVideo;
}
});
៣.ចម្លងកូដខាងក្រោមដាក់ក្នុង Blog Post ដោយប្ដូរទៅជា HTML view
<div id="ok-playlist"></div>
<script>
const okVideoID = [
"3616509332147", // ភាគទី ០១
"3701113621171", // ភាគទី ០២
"3551737481907", // ភាគទី ០៣
"3638386428595", // ភាគទី ០៤
"3528933378739" // ភាគទី ០៥
];
</script>
៤.ផ្លាស់ប្ដូរ Ok.ru Video ID នីមួយៗខាងលើរួចចុចពាក្យ Publish ជាការស្រេច៕
Comments
Post a Comment