I can’t load my images from a js file using wp_localize_script

You’re not accessing the value correctly. The 2nd argument of wp_localize_script is the name of a JavaScript object that your data will be added to. In your case it’s wpa_data. This means that the image_path is accessed at wpa_data.image_path: $(function(){ jQuery(document).ready(function() { $(‘#home’).backstretch([ wpa_data.image_path+”home-bg-slideshow1.jpg”, wpa_data.image_path+”home-bg-slideshow2.jpg”, wpa_data.image_path+”home-bg-slideshow3.jpg”, ], {duration: 2000, fade: 750}); }); })

I’m including a html file in my plugin, but it can’t find its css or js files

you must use enqueue script and style commands to include wp. for it, look at these links: https://developer.wordpress.org/reference/functions/wp_enqueue_script/ https://developer.wordpress.org/reference/functions/wp_enqueue_style/ also dont use hard php commands like this : <?php echo(__DIR__) ?> there are wp commands for these jobs. you can use below: plugin_dir_path plugins_url plugin_dir_url plugins_url

Apply function.php filter only if url not has /amp/

What is amp? Is it tag or category or page? You should use standard wordpress functions like is_page() is_category() is_tag(). You can also use $wp->request. It will return the request URI. If the address is “http://example.com/slug1/slug2” it will return slug1/slug2 then use explode() function to split it. <?php $uri = $wp->request; $slugs = explode(“/”,$uri);//variable $slugs … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)