Merhaba arkadaşlar ;
Aşağıdaki gibi bir kod bloğu var, wordpress funcition içinde çalıştırıyorum. Amaç x sayfasına özel js kodu çalıştırmak.
if_single 'da yer alan değer, wordpress'deki post ıd'ye eşit bir değer, amacım burada birden fazla kod satırı kopyalayıp yapıştırmamak için, if_single ('34') 'ün yanına diğer post id'leri de eklemek istiyorum.
Bunu doğru bir şekilde nasıl yapabilirim?
function wpb_hook_javascript() {
if (is_single ('34')) {
?>
<!-- Add the code below inside the <body> tags of your HTML page -->
<script>
window.VIDEOASK_EMBED_CONFIG = {
"kind": "widget",
"url": "https://www.videoask.com/f9b5e01ox",
"options": {
"widgetType": "VideoThumbnailWindowTall",
"text": "Talk to me",
"backgroundColor": "#7D00FE",
"position": "bottom-left",
"dismissible": false
}
}
</script>
<script src="https://www.videoask.com/embed/embed.js"></script>
<!-- Important!!! In order to allow your videoask to open up on the same page when interacting with the widget, your website must use the secure https:// protocol (i.e have an SSL certificate). Otherwise, when clicking the widget, a new tab will be automatically opened in the browser.
-->
<?php
}
}
add_action('wp_head', 'wpb_hook_javascript');