Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #887746
    milanzivanovic
    Participant

    Hi guys!

    I can’t login to Admin page. Please, help!

    #887754
    milanzivanovic
    Participant
    This reply has been marked as private.
    #887839
    milanzivanovic
    Participant

    Now I tried to remove this line from child themes’s function.php:

    add_action(‘init’, ‘modify_jquery’);

    and it works with no problems. But, than I can’t use custom JQuery code. How to call JQuery properly?

    #887913
    Christopher
    Moderator

    Hi there,

    Please provide with original code you want to add.

    Thanks.

    #889004
    milanzivanovic
    Participant

    The JS code is already in themes/x-child/framework/js/custom.js file.

    Here is:

    $(document).ready(function(){
    	$(".otvori_plejer").click(function(){
    		var w = 300;
    		var h = 450;
    		var left = Number((screen.width/2)-(w/2));
    		var tops = Number((screen.height/2)-(h/2));
    		window.open("/plejer", '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width='+w+', height='+h+', top='+tops+', left='+left);
    	});
    });

    This doesn’t work if I remove the line in function.php:
    add_action(‘init’, ‘modify_jquery’);

    #889636
    Paul R
    Moderator

    Hi,

    Please remove the code in your child theme’s functions.php that reads

    
    //Making jQuery Google API 
    function modify_jquery() {
        if (!is_admin()) {
            // comment out the next two lines to load the local copy of jQuery
            wp_deregister_script('jquery');
            wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3');
            wp_enqueue_script('jquery');
        }
    }
    
    add_action('init', 'modify_jquery');
    

    Then replace your code in your custom.js with this.

    
    jQuery(document).ready(function($){
    	$(".otvori_plejer").click(function(){
    		var w = 300;
    		var h = 450;
    		var left = Number((screen.width/2)-(w/2));
    		var tops = Number((screen.height/2)-(h/2));
    		window.open("/plejer", '', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width='+w+', height='+h+', top='+tops+', left='+left);
    	});
    });
    

    Hope that helps.

    #892056
    milanzivanovic
    Participant

    Thank you! This js code now works on all pages. But, I can’t run the other js code for the single page “Top 10”. Can you help me with this?

    Page is: http://www.radiomorava.rs/top-10-lista/
    JS code is in file: public_html/wp/wp-content/themes/x-child/framework/js/custom-top10.js

    Please, help me to fix this and I won’t bother you anymore. 🙂

    #892996
    Paul R
    Moderator

    Hi,

    Please replace the code in custom-top10.js that reads

    
    $(document).ready(function(){
    

    with this

    
    jQuery(document).ready(function($){
    

    It’s in (~ line no. 122)

    Hope that helps.

    #893520
    milanzivanovic
    Participant

    Yeah! Everything works fine now. 😉

    The greatest theme with the best support ever! There is a little serbian phrase: “If you didn’t exist, somebody would have to invent you!” I hope I’ve translated it correctly.

    Thank you!

    #894174
    Jade
    Moderator

    You’re welcome and thanks for the kind words. 🙂

  • <script> jQuery(function($){ $("#no-reply-887746 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>