Cannot get custom javascript to execute on page

Try this. add_action ( ‘wp_head’, ‘custom_script_hook’); function custom_script_hook() { ?> <script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js”></script> <?php $output=”<script> jQuery(document).ready(() => { $(“div#tm-extra-product-options”).click(() => { console.log(“it working!”) }); }); </script>”; echo $output; }

wp_redirect() is not working

Add ob_start(); at the top of functions.php file and remove from your code. As WP is a combination of plugin and core files and we don’t know which code sends the throws the header sent warning. And we know that functions.php is called every time we made a request to server, so this is the … Read more

PHP or JS for header image rotator?

Using PHP sends less code to the end user. (a single img tag instead of all the javascript logic). If you enable browser caching settings correctly (try W3 Total Cache), once the end user has “seen” all the images, those will all be in their cache, so on the “long tail” JavaScript vs. PHP solution … Read more

How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites?

I would think that your best bet is option 3 (multisite) if possible. Once you’ve got your network of sites set up you can then specify which menu to use as described here. Doing the other solutions (a more rough and ready ‘hardcoded’ approach) will almost certainly give you headaches in the future. Having multisite … Read more

Warning: Cannot modify header information (with a twist)

Goin with @One Trick Pony… Change: <?php /* You really don’t want to touch this file if you don’t know what you’re doing. */ ?> <?php class WP_LESS_Styles extends WP_Dependencies { …. To: <?php /* You really don’t want to touch this file if you don’t know what you’re doing.*/ class WP_LESS_Styles extends WP_Dependencies {…

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