Why does javascript works only if logged in?

Try: wp_enqueue_script( ‘nevermind-navigation’, get_template_directory_uri() . ‘/js/navigation.js’, array(‘jquery’) ); It is possible that jQuery is not enqueued, and you are not declaring it as a dependency for your script. Being logged in, automatically enqueues jQuery. EDIT: Console log says jQuery is not defined. Did you add a jQuery(document).ready($) function for the fixed-menu.js functions?

TinyMCE 4 remove/add attributes for all images

Assuming your TinyMCE4 container has an id of ‘tiny-mce-4’, you could add this js to your functions.php. function toArray (collection) { return Array.prototype.slice.call(collection); } var imgs = toArray(document.querySelectorAll(‘#tiny-mce-4 img’)); imgs.forEach(function(img){ img.setAttribute(‘style’, img.getAttribute(‘style’).replace(/((height:).*?(px;))/g, ‘max-width: 100%;’)); }); <div id=”tiny-mce-4″> <img src=”https://wordpress.stackexchange.com/questions/207673/img1″ style=”height: 500px; width: 800px;” /> <img src=”img2″ style=”height: 500px; width: 800px;” /> <img src=”img3″ style=”height: 500px; … Read more

show/hide div with simple jQuery script [closed]

Most likely, the cause of your problem is that jQuery is in compatibility mode. This means that you can’t use the ‘$’ shortcode. To get your Javascript code to work, replace all ‘$’ with ‘jQuery’ Or, wrap your code in an anonymous function, like this: jQuery(document).ready(function( $ ) { // Put your jQuery code here. … Read more

WordPress Comments – Rich Text

I have found a way by using nicEdit here’s the tutorial. In order to get this fully functioning, I had to amend my script slightly. jQuery(“.stickers img”).click(function(){ var img = jQuery(this).parent().html(); var text = jQuery(“#respond .nicEdit-main”).html(); jQuery(“#respond .nicEdit-main”).html(text + img); }); I hope this helps someone.

WordPress jquery files not being enqueued

I dont really see anything wrong on what I did previously. But in any case I changed the name of the file to navbar.js and then my functions.php looked like this: function scentology_scripts() { wp_enqueue_style( ‘scentology-local-fonts’, get_template_directory_uri() . ‘/fonts/raleway.css’ ); wp_enqueue_style( ‘scentology-style-fontawesome’, ‘https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css’ ); wp_enqueue_style( ‘scentology-style’, get_stylesheet_uri() ); wp_enqueue_script( ‘scentology-menu’, get_template_directory_uri() . ‘/js/navbar.js’, array(‘jquery’), ‘20151215’, … Read more

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