Eğer birden fazla post ID'si eklemek istiyorsanız, is_single() fonksiyonunun içine virgülle ayrılmış olarak ID'leri yazabilirsiniz.
Örneğin:
if (is_single ('34, 56, 78')) {
Bu şekilde 34, 56 ve 78 ID'li postlar için JS kodu çalışacaktır.
Ayrıca, eğer post ID'leri arasında çok fazla sayı varsa, daha okunaklı bir kod yazmak için dizi oluşturabilirsiniz ve diziyi is_single() fonksiyonuna gönderebilirsiniz:
$post_ids = array(34, 56, 78);
if (is_single($post_ids)) {
Bu şekilde de aynı şekilde çalışacaktır.
Hocam aşağıdaki gibi çalıştırdım ama sayfada gözükmedi.
function wpb_hook_javascript14() {
if (is_single ('92','91','89','36','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_javascript14');