javascript - Wordpress load-scripts.php not loading

Am currently using WordPress 4.6.1 with a custom theme created by me. Am using Theme My Login plugin for front-end user

Am currently using WordPress 4.6.1 with a custom theme created by me. Am using Theme My Login plugin for front-end user profile page. The scripts needed for generating passwords are not loading with my custom theme.

When I switch the theme to default theme the below script loads

<script type='text/javascript' src='http://localhost/priya/wordpress/wp-admin/load-scripts.php?c=1&amp;load%5B%5D=admin-bar,password-strength-meter,underscore,wp-util,user-profile,wp-embed&amp;ver=4.7.2'></script>

and generate password works.

But switching to my custom theme does not load the above script.

Am currently using WordPress 4.6.1 with a custom theme created by me. Am using Theme My Login plugin for front-end user profile page. The scripts needed for generating passwords are not loading with my custom theme.

When I switch the theme to default theme the below script loads

<script type='text/javascript' src='http://localhost/priya/wordpress/wp-admin/load-scripts.php?c=1&amp;load%5B%5D=admin-bar,password-strength-meter,underscore,wp-util,user-profile,wp-embed&amp;ver=4.7.2'></script>

and generate password works.

But switching to my custom theme does not load the above script.

Share Improve this question edited Feb 17, 2017 at 9:04 Max Yudin 6,3882 gold badges26 silver badges36 bronze badges asked Feb 17, 2017 at 6:50 user113539user113539 11 silver badge1 bronze badge 1
  • Thank you for your answer TrubinE, I already tried adding the scripts using wp_enqueue, but the feature is not working. The script has to be loaded in the below way. <script type='text/javascript' src='localhost/priya/wordpress/wp-admin/…> – Priyadarshni Commented Feb 20, 2017 at 5:53
Add a comment  | 

1 Answer 1

Reset to default 1
/**
 * add script
 *
 * https://developer.wordpress/reference/functions/wp_enqueue_script/
 */
function youplugin_add_frontend() {
    // js
    wp_enqueue_script('youplugin-js', get_template_directory_uri() . '/js/scripts.js', array('jquery'), 0.1, true);

}

// add script
add_action('wp_enqueue_scripts', 'youplugin_add_frontend');

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745574401a4633875.html

相关推荐

  • javascript - Wordpress load-scripts.php not loading

    Am currently using WordPress 4.6.1 with a custom theme created by me. Am using Theme My Login plugin for front-end user

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信