Сайт не работает после добавления - PullRequest
0 голосов
/ 25 января 2020

У меня есть премиум-тема bootstrap с несколькими таблицами стилей и js файлами. Я хочу преобразовать его в WordPress сайт, ссылки на мою страницу css выглядят так:

        <link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <!-- THEME CSS -->
        <link href="assets/css/essentials.css" rel="stylesheet" type="text/css" />
        <link href="assets/css/layout.css" rel="stylesheet" type="text/css" />
        <!-- PAGE LEVEL SCRIPTS -->
        <link href="assets/css/color_scheme/blue.css" rel="stylesheet" type="text/css" />
        <link href="assets/css/header-1.css" rel="stylesheet" type="text/css" />
        <link href="assets/css/pack-realestate.css" rel="stylesheet" type="text/css" />
        <link href="assets/css/custom-forms-v2.css" rel="stylesheet" type="text/css" />```

                        After populating my funtion script:
```<?php 
  function new2w_theme_styles(){
     wp_enqueue_style( 'bootstrap_css', get_template_directory_uri() . '/css/bootstrap.min.css');
     wp_enqueue_style( 'essentials_css', get_template_directory_uri() . '/css/essentials.css');
     wp_enqueue_style( 'layout_css', get_template_directory_uri() . '/css/layout.css');
     wp_enqueue_style( 'scheme_css', get_template_directory_uri() . '/css/color_scheme/blue.css');
     wp_enqueue_style( 'custom_forms', get_template_directory_uri() . '/css/custom-forms-v2.css');
     wp_enqueue_style( 'pack_css', get_template_directory_uri() . '/css/pack_realestate.css');
     wp_enqueue_style( 'header-1', get_template_directory_uri() . '/css/header-1.css');
     wp_enqueue_style( 'style_css', get_template_directory_uri() . '/style.css');    
  }

I  get the following error from the browser "Fata error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes). I notice this issue while adding <?php wp_head(); to my template, but when I remove it the error disappears. Please I need help, check out my theme folder structure below.
[![enter image description here][1]][1]
  [1]: https://i.stack.imgur.com/ds3mk.jpg

1 Ответ

1 голос
/ 25 января 2020

Я бы создал новую тему и поместил все необходимые файлы css / js в заголовок. php file. Включить темы по умолчанию css файл

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">

Включить другие необходимые файлы:

<link href="<?php echo get_template_directory_uri();?>/phone.css" rel="stylesheet" type="text/css" media="only screen and (max-device-width:900px)">

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...