WP Plugin: Print javascript in header

To only insert code into the header section in the admin area on single plugin pages you need to alter your add_action()function. add_action(‘admin_head-pageof_thisplugin/thisplugin’, ‘thisplugin_adminhead’); function thisplugin_adminhead() { // here goes your content echo ‘<script>’ .’/* … */’ .'</script>’; } where pageof_thisplugin/thispluginis the hook slug that returns out of the function that creates your page like … Read more

Form is not getting submitted [closed]

First of all you are doing everything wrong as a WordPress developer. Make a habit of using wp_nonce and other security steps. When possible try to avoid inline JavaScript or JavaScript on the same file. Important: why you are creating new database connection..? Why you are writing database queries in your own way? Why don’t … Read more

Insert Plugin on a custom page

do_shortcode Is a function which executes shortcodes in WordPress In your case you should use it in your header.php file as the following: <?php echo do_shortcode(‘[huge_it_gallery id=”4″]’); ?>