powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Как в wordpress правильно подключить файлы?
1 сообщений из 1, страница 1 из 1
Как в wordpress правильно подключить файлы?
    #38903618
dik_k
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Есть слайдер http://demo.labtempl...ider/index.html
Пытаюсь его поставить на свою тему. Пока верстал страницу - слайдер работал, при переносе на WP слайдер работать перестал.
Вот как подключал скрипты и всё остальное при верстке:
Код: html
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="style000.css" />
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type='text/javascript' src='js/jquery.hoverIntent.minified.js'></script>
<script type='text/javascript' src='js/jquery.dcverticalmegamenu.1.3.js'></script>
<script type="text/javascript">
$(document).ready(function($){
  $('#mega-1').dcVerticalMegaMenu({
        rowItems: '3',
        speed: 'fast',
        effect: 'show',
        direction: 'right'
  });
});
</script>
<link rel="stylesheet" type="text/css" href="style000.css">
<script type="text/javascript" src="js/jquery00.js"></script>
<script type="text/javascript" src="js/jquery-u.js"></script>
<script type="text/javascript">
  $(document).ready(function(){
        $("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
  });
</script>
<script type="text/javascript">
  $(document).ready(function(){
        $(".basket-str").click(function(){
          $(".basket-in").slideToggle("fast");
          return false;
        });               
  });
</script>                         
</head>


Вот как перенес это всё в WP:
В файле index.php
Код: html
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript">
$(document).ready(function($){
  $('#mega-1').dcVerticalMegaMenu({
        rowItems: '3',
        speed: 'fast',
        effect: 'show',
        direction: 'right'
  });
});
</script>
<script type="text/javascript">
  $(document).ready(function(){
        $("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
  });
</script>
<script type="text/javascript">
  $(document).ready(function(){
        $(".basket-str").click(function(){
          $(".basket-in").slideToggle("fast");
          return false;
        });               
  });
</script>                         
<?php wp_head();  ?>
</head>


В файле functions.php
Код: html
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
<?php
/* загружаемые стили и скрипты*/
function load_style_script(){
wp_enqueue_script('jquery-google', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');
wp_enqueue_script('dcverticalmegamenu.1.3', get_template_directory_uri() . '/js/jquery.dcverticalmegamenu.1.3.js');
wp_enqueue_script('hoverIntent.minified', get_template_directory_uri() . '/js/jquery.hoverIntent.minified.js');
wp_enqueue_script('jquery00', get_template_directory_uri() . '/js/jquery00.js');
wp_enqueue_script('jquery-u', get_template_directory_uri() . '/js/jquery-u.js');
wp_enqueue_style('style', get_template_directory_uri() . '/style.css');
  wp_enqueue_style('style000', get_template_directory_uri() . '/style000.css');
}
add_action('wp_enqueue_scripts', 'load_style_script');


Теперь смотрим исходный код полученной страницы:
Код: html
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript">
$(document).ready(function($){
  $('#mega-1').dcVerticalMegaMenu({
        rowItems: '3',
        speed: 'fast',
        effect: 'show',
        direction: 'right'
  });
});
</script>
<script type="text/javascript">
  $(document).ready(function(){
        $("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
  });
</script>
<script type="text/javascript">
  $(document).ready(function(){
        $(".basket-str").click(function(){
          $(".basket-in").slideToggle("fast");
          return false;
        });               
  });
</script>                         
<meta name='robots' content='noindex,follow' />
<link rel='stylesheet' id='style-css'  href='http://localhost/site_old/wp-content/themes/site_old/style.css?ver=4.1.1' type='text/css' media='all' />
<link rel='stylesheet' id='style000-css'  href='http://localhost/site_old/wp-content/themes/site_old/style000.css?ver=4.1.1' type='text/css' media='all' />
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=4.1.1'></script>
<script type='text/javascript' src='http://localhost/site_old/wp-content/themes/site_old/js/jquery.dcverticalmegamenu.1.3.js?ver=4.1.1'></script>
<script type='text/javascript' src='http://localhost/site_old/wp-content/themes/site_old/js/jquery.hoverIntent.minified.js?ver=4.1.1'></script>
<script type='text/javascript' src='http://localhost/site_old/wp-content/themes/site_old/js/jquery00.js?ver=4.1.1'></script>
<script type='text/javascript' src='http://localhost/site_old/wp-content/themes/site_old/js/jquery-u.js?ver=4.1.1'></script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://localhost/site_old/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://localhost/site_old/wp-includes/wlwmanifest.xml" />
<meta name="generator" content="WordPress 4.1.1" />
</head>
...........


Объясните, пожалуйста, что я не так сделал???
...
Рейтинг: 0 / 0
1 сообщений из 1, страница 1 из 1
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / Как в wordpress правильно подключить файлы?
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]