Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Scripts are not called until I login from wordpress backend

You have to insert the code in functions.php not in header.php.

<?php

function my_script(){ 
// put wp_enqueue_script here 
?>
<?php wp_enqueue_script('bjqs-1.3', get_template_directory_uri().'/js/bjqs-1.3.js'); ?>
<?php wp_enqueue_script('bjqs-1.3.min', get_template_directory_uri().'/js/bjqs-           1.3.min.js'); ?>
<?php wp_enqueue_style('bjqs', get_template_directory_uri().'/bjqs.css'); ?>
<?php //wp_enqueue_style('demo', get_template_directory_uri().'/demo.css'); ?>
<?php wp_enqueue_script('jquery.secret-source.min',     get_template_directory_uri().'/jquery.secret-source.min.js'); ?>
<?php
}
add_action('wp_enqueue_scripts', 'my_script');

?>

See here for detail, http://codex.wordpress.org/Function_Reference/wp_enqueue_script.

Related Posts:

  1. How to Change the Default Home Page for the WordPress Dashboard?
  2. Allowing admin-ajax.php to receive “application/json” instead of “x-www-form-urlencoded”
  3. Cannot access admin panel
  4. Set Featured Image programmatically (in admin) with JavaScript?
  5. How can I include JavaScript that use jQuery on admin side
  6. Daily notices of failed login attempts for non-existent admin user
  7. Javascript not working in admin
  8. Setting Login with User Name and Password default option for Jetpack Admin Login
  9. I keep getting logged out in Firefox
  10. Error thrown. Cannot create references to/from string offsets
  11. Refreshing collections in the admin media manager
  12. wp.template() Not a function
  13. How to determine if an admin is logged in outside the loop
  14. wp-admin post.php JavaScript Links Not Working
  15. Unable to login, old site with previous developer gone
  16. Using shared SSL for login/admin
  17. Plugin admin panel JavaScript Broken
  18. wp-login behind nginx reverse-proxy inaccessible — bad redirect?
  19. Can’t access dashboard as administrator, login as any other level works though
  20. WordPress Admin Login Redirect Problem
  21. Activate Gallery Options in Media Uploader for Custom Usage
  22. Unable to Access WP Admin or Login buttons after Migration
  23. using rewrites to secure login page
  24. Client system for media review?
  25. WordPress administration Over SSL – To Force SSL Logins and SSL Admin Access
  26. Keep Logged in Users out of Admin Panel
  27. Unable to get to the admin panel
  28. I can’t access the login panel on my offline website
  29. Admin login not working
  30. admin_enqueue_scripts not rending JS file correctly
  31. Can’t login to my admin area
  32. Does deleting the table users prevent all logins?
  33. Locked out of WordPress website from wrong amount of login attempts
  34. current_user_can(‘administrator’) not working in custom login
  35. Why does Thickbox jQuery load on my site?
  36. Send admin to a different login than users?
  37. Add JavaScript in admin in custom plugin [duplicate]
  38. Want to know who is login Admin/User
  39. Remove iPhone detection on login page
  40. Any known plugins for master admin login to edit all on front end?
  41. Login to admin by frontend form?
  42. Error “Sorry, you are not allowed to access this page”
  43. I can’t access login page
  44. Admins loggin in to our wordpress site default to the admin page
  45. WordPress Admin Thickbox: Remove Margins/Padding
  46. WordPress login not working
  47. Login to Admin Dashboard Problem
  48. WordPress login process is hanging
  49. WordPress “Hide WP” Gives Me Error After Admin Login [closed]
  50. Enqueue script throws error in console
  51. Disable wp-admin log on lightbox overlay
  52. How to cancel redirection to admin side
  53. Can’t access my wp admin: captcha images invisible, gives me error message
  54. 2FA for admin login only, is it doable?
  55. What are the standard admin CSS id/class tags?
  56. Admin Ajax is returning 0
  57. Add custom column to Users admin panel
  58. wp_verify_nonce vs check_admin_referer
  59. Add a Separator to the Admin Menu?
  60. How to determine whether we are in add New page/post/CPT or in edit page/post/CPT in wordpress admin?
  61. how to know if admin is in edit page or post [duplicate]
  62. Modal window from within WordPress admin
  63. Where in WP can I check history or log of updates of plugins etc?
  64. Adding a custom admin page
  65. How does admin-ajax.php work?
  66. How to remove entire admin menu?
  67. How do I remove dashboard access from specific user roles?
  68. How can I speed up my WP admin section?
  69. How to pass parameters to admin_notices?
  70. Admin: very slow edit page caused by core meta query
  71. if admin is logged in
  72. Search posts by ID in admin
  73. Setting admin edit panels & metaboxes positions and visibility for ALL users and admins
  74. Find out which moderator approved comment?
  75. The website cannot display the page
  76. How To Remove WordPress Version From The Admin Footer
  77. Sort pages in loop by admin’s page attributes order field?
  78. Edit “thank you for creating with WordPress” in version 3.3.1
  79. Hide other users’ posts in admin panel
  80. Set Default Admin Colour For All Users
  81. Editor Styles and Typekit
  82. WordPress admin stylesheet
  83. This CSS Stuffing Works, But Is This A Good Practice?
  84. Is it possible to create a WordPress tour? V3.3.1
  85. Securing Admin Accounts – Username Discovery
  86. is_admin() returns true when using admin-ajax.php from front end script
  87. How to save dismissable notice state in WP 4.2?
  88. How do I optimize a custom post type admin page with 25,000 posts?
  89. Settings API – adding setting fields dynamically?
  90. Disable Media Uploads to non Admin Users
  91. How do I load a CSS style into WordPress admin area only?
  92. Can an admin check passwords of registered users?
  93. How can I target WordPress 3.8 new interface MP6 with CSS?
  94. Notification that the admin is online
  95. Does wordpress create activity, update logs?
  96. WordPress 5.5 – ReferenceError: commonL10n is not defined error
  97. sort child pages on admin
  98. How-to make the admin area mobile friendly [closed]
  99. How to remove list view from media library?
  100. How to disable the “Your site has updated to WordPress x.y.z” admin email?
Categories admin Tags admin, javascript, login
How to change value of $menu_class in ep_nav_menu?
hatom-feed entry-title error in the rich snippets tool

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress