I
I
Iossarian2019-08-20 18:00:07
open server
Iossarian, 2019-08-20 18:00:07

Why doesn't the local server see the included styles and scripts?

Good afternoon. I myself work very little with VP, but it is the local server that delivers the main difficulty. Often, when opening a site, I am redirected to wordpress.org, but this is half the trouble - the VP refuses to see the included style files and scripts every other time. I connect like this:

add_action('wp_enqueue_scripts', 'style_theme');
add_action('wp_footer', 'scripts_theme');

function style_theme()
{
    wp_enqueue_style('style', get_stylesheet_uri());
    wp_enqueue_style('album', get_template_directory_uri() . '/assets/css/album.css');
    wp_enqueue_style('docs', get_template_directory_uri() . '/assets/css/docs.min.css');
    wp_enqueue_style('bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css');

}

function scripts_theme()
{
    
    wp_enqueue_script('jquery', get_template_directory_uri() . '/assets/js/jquery-slim.min.js');
    wp_enqueue_script('bundle', get_template_directory_uri() . '/assets/js/bootstrap.bundle.min.js');
    wp_enqueue_script('jquery', get_template_directory_uri() . '/assets/js/jquery-slim.min.js');
    wp_enqueue_script('docs', get_template_directory_uri() . '/assets/js/docs.min.js');
}

Everything is ok on the hosting, at the very time the styles are connected. It gives a 500 error in the console with an exact link to my files, but he allegedly does not see them.
Cleared caches and restarted servers. I think there is some subtlety of working with VP. Tell me who knows.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tuxfighter, 2019-08-21
@tuxfighter

I think there is some subtlety of working with VP. Tell me who knows.

The main subtlety - no need to use local servers

L
Lord_Dantes, 2019-08-21
@Lord_Dantes

Check the paths and file names again, try using it via https://wp-kama.ru/function/get_template_directory
And discard what errors it shows in the console and + your path to the files

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question