How to add a PHP scripts into WordPress

You could basically create a simple plugin, that will generate a shortcode. The function of this shortcode would be displaying the required images. You can choose between Ajax or maybe using the embedded PHP timer to trigger Ajax to retrieve the images. Then you embed this shortcode in your post or page (wherever you wish … Read more

Setting wp_enqueue_script correctly

Your add_action has incorrect parameters. Use this code add_action( ‘wp_enqueue_scripts’, ‘custom_scripts’, 10 ); Also, you must prefix filename with /, so correct function code is function custom_scripts() { wp_enqueue_script(‘custom_js’, get_stylesheet_directory_uri() . ‘/custom_js.js’, array(‘jquery’), ‘1.0.0’, false ); }