Atma
Atma

Reputation: 29775

wordpress get_template_directory_uri function doesn't return template directory

I have the following function accessing a javascript file:

<script src="<?php echo get_template_directory_uri(); ?>/js/plugins.js"></script>

It should return: http://example.com/mytemplate/js/plugins.js

Instead it returns: http://example.com/_templates/default_site/js/placeholder.js

What am i doing wrong?

Upvotes: 0

Views: 900

Answers (1)

Mohamed Salem Lamiri
Mohamed Salem Lamiri

Reputation: 6077

Try this :

<script src="<?php echo get_stylesheet_directory_uri(); ?>/js/plugins.js"></script>

Upvotes: 1

Related Questions