Это мой первый раз, когда я использую wp_enqueue_script для решения IDX, которое я пытаюсь настроить на сайте WordPress. Мой путь к файлу ребенок Темы/JS/idx.jswp_enqueue_script не отображает скрипт
Я поместил этот код в моем файле functions.php:
<?php
function wptuts_scripts_with_jquery()
{
// Register the script like this for a theme:
wp_register_script('custom-script', get_template_directory_uri() . '/js/idx.js', array('jquery'));
// For either a plugin or a theme, you can then enqueue the script:
wp_enqueue_script('custom-script');
}
add_action('wp_enqueue_scripts', 'wptuts_scripts_with_jquery'); ?>
и этот код в моем файле idx.js:
<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type="text/javascript" ></script>
<script src="http://tools.example.com/scripts/postmessage.min.js" type="text/javascript" ></script>
<script type="text/javascript" >
$.createDynamicFrame('http://example.example.com', 'http://example.example.com/26611/Carets/search?parentUrl=' + encodeURIComponent(document.location.href), 'MapSearch');
Это ничего не делает. Когда я использую функцию wptuts_scripts_with_jquery() в функции functions.php с другими скриптами, это работает, но не с скриптом idx.js. Любая помощь могла бы быть полезна.
Спасибо!