Hi @nilsondias,
is the “learning management system” system a plugin? Does this also happen on regular posts? If it happens everywhere, it’s usually because the jquery handle is not registered. However most themes do use jquery and this is rarely a problem. If it only happens inside another plugin, it’s probably a conflict and I need to test it.
Regards,
Blaz
Hi,
can you please share a link to a page on your website where I can find the rating widget. It’s hard to debug this without seeing the actual website 🙂
Regards,
Blaz
yes
this link : https://upmusics.com/?p=23954
-
This reply was modified 4 years ago by Ali BZ.
@blazk I think the problem is with jQuery
Hi Blaz, how are you? WPLMS is a complete theme with many plugins and Buddypress, I can ask the auhtor about Jquery.
@upmusic, on your website rate-my-post.js is not loaded. This almost always happen because jquery handle is missing. The plugin lists jquery as a dependency in wp_register_script function and WordPress simply doesn’t add the script if the dependency is not present on the website.
Nevertheless, your website uses jQuery and thus I recommend checking what’s going on with the jquery handle. I had a similar ticket here a while ago and we figured out that the theme was deregistering jquery and then enqueueing the script under a different handle.
To be sure that this is causing the issue you can edit public/class-rate-my-post-public.php on line 50 from:
wp_register_script( $this->rate_my_post, plugin_dir_url( __FILE__ ) . 'js/rate-my-post.js', array( 'jquery' ), $this->version, true );
to
wp_register_script( $this->rate_my_post, plugin_dir_url( __FILE__ ) . 'js/rate-my-post.js', array(), $this->version, true );
Let me know what you figure out.
Blaz
@nilsondias, I answered you via email 🙂
@blazk I don’t know why it doesn’t call the file
I replaced the new code in line 50, but the problem was not solved
dear @blazk
I used the code by coding 5 years ago
Now I run another template on the same site that had new coding, the problem was solved
Glad to hear that @upmusic! 🙂 I’m closing this topic as we solved the issues and with @nilsondias we are in touch via email.
Blaz
Hello, Blaz K. Could you please give advice on a similar error.
My site has the following code (it is needed for the work of the library SOUNDJS:
in head:
<script>
jQuery.noConflict();
jQuery(document).ready(function($) {
init();
});
</script>
and in functions.php:
function add_my_scripts() {
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'my_init_script', SCRIPTSRC, 'jquery', '1.0' );
}
add_action( 'init', 'add_my_scripts' );
If delete <script></script>, then plugin works fine but the library SOUNDJS stops working. Is it possible for the plugin «RateMyPost» to work without removing this code?
Hi @hoakinn25,
Rate my Post relies heavily on jQuery, although this will be changed in future versions. You can read more about noConflict here: https://www.w3schools.com/jquery/jquery_noconflict.asp
I guess, it would be easier to figure out why soundjs is not working without noConflict. I checked their documentation and haven’t noticed anything about noConflict being required.
Blaz