Eythan Fellous
Eythan Fellous

Reputation: 25

Error while loading ressource for a WebSite (wordpress)

I'm encountering an error like:

pageguide.min.css:1 Failed to load resource: the server responded with a status of 404 () pageguide.min.js:1 Failed to load resource: the server responded with a status of 404 ()

The folder that contains these files is already on my server. This how I apply (pastebin file).

This is the pastebin

<script src="pageguide-1.3.2/dist/js/pageguide.min.js"></script>
<link rel="stylesheet" href="pageguide-1.3.2/dist/css/pageguide.min.css">
<script>
$(document).ready(function () {
    tl.pg.init({});
});
</script>

Thanks for your help.

[EDIT] After trying all your solutions I got this :

GET https://crushonapp.com/wp-content/themes/bigcartpageguide-1.3.2/dist/css/pageguide.min.css net::ERR_ABORTED 404 pixel.js?id=feca3ba1b1545:1 poptin-start (index):139 GET https://connect.facebook.net/en_US/fbevents.js net::ERR_BLOCKED_BY_CLIENT (anonymous) @ (index):139 (anonymous) @ (index):139 (index):419 GET https://crushonapp.com/wp-content/themes/bigcartpageguide-1.3.2/dist/js/pageguide.min.js net::ERR_ABORTED 404 pixel.js?id=feca3ba1b1545:1 initiatePullPoptinsRequest() (index):420 GET https://crushonapp.com/wp-content/themes/bigcartpageguide-1.3.2/dist/css/pageguide.min.css net::ERR_ABORTED 404 (index):422 Uncaught TypeError: $ is not a function at (index):422

Upvotes: 1

Views: 1369

Answers (3)

Krishna Joshi
Krishna Joshi

Reputation: 315

Try to include stylesheet and js as below

<script src="<?php echo get_template_directory_uri().'/pageguide-1.3.2/dist/js/pageguide.min.js';?>"></script>

<link rel="stylesheet" href="<?php echo get_template_directory_uri().'/pageguide-1.3.2/dist/css/pageguide.min.css';?>">

Note: This will work if your files structure is like wp-content/themes/your-theme/pageguide-1.3.2/

Hope this helps

Upvotes: 1

Kenny Fox
Kenny Fox

Reputation: 24

"pageguide-1.3.2/dist/" doesn't look like a proper path. Check where your source lies on the server and copy the path into your code.

An absolute path should look something like this http://localhost/pageguide-1.3.2/dist/

Upvotes: 0

johnnyd23
johnnyd23

Reputation: 1705

If the pageguide-1.3.2 folder is in your root, you can use src="<?php bloginfo('url'); ?>/pageguide-1.3.2/dist/js/pageguide.min.js"

If the folder is within your theme you can use src="<?php bloginfo('template_directory'); ?>/pageguide-1.3.2/dist/js/pageguide.min.js"

Upvotes: 0

Related Questions