Viewing 15 replies - 1 through 15 (of 20 total)
  • Is part of your theme or a plugin?

    Thread Starter Sophiamolino

    (@sophiamolino)

    It is part of the theme, but created myself (with help obviously haha)

    Then all I can say that it sounds as if you have an issue in your custom javascript.

    Thread Starter Sophiamolino

    (@sophiamolino)

    Is it possible that the newest version of WordPress has changed something in the custom javascript of the marquees?

    No. WordPress core doesn’t do – and never has done anything with – custom javascript marquees.

    Thread Starter Sophiamolino

    (@sophiamolino)

    Hmmm so, the version renewal doesn’t have to be the cause of it. But it’s quite a coincident that they are gone since this afternoon when I updated WordPress. Don’t you have any other suspicions of what the cause could be?

    None – other than the issue is in your custom javascript. For example, are you using jQuery? If so, is it the version of jQuery that is bundled with WordPress?

    Thread Starter Sophiamolino

    (@sophiamolino)

    Yes Esmi, it contains a jQuery!

    <script type="text/javascript" src="https://blogandthecity.net/js/marquee-packed.js" ></script>
    <script type="text/javascript">
    jQuery(document).ready(function(){
    	jQuery("#marquee, #marquee2").css("display", "block");
    	jQuery("#marquee, #marquee2").css("width", jQuery(window).height() + "px");
    	//create instance and call method horizontal for horizontal scrolling
    	var horizontal = new marquee("marquee").horizontal(
    		{
    			step:1, //how many pixels to move per interval (default: 1)
    			interval: 40, //how often to move pixels in miliseconds (default: 10)
    			stop_on_hover: true, //should marquee stop on mouse hover (default: true)
    			backwards: false, //rotate elements in opposite direction
    		});
    	//create instance and call method horizontal for horizontal scrolling
    	var horizontal = new marquee("marquee2").horizontal(
    		{
    			step:1, //how many pixels to move per interval (default: 1)
    			interval: 40, //how often to move pixels in miliseconds (default: 10)
    			stop_on_hover: true, //should marquee stop on mouse hover (default: true)
    			backwards: false, //rotate elements in opposite direction
    		});
    });
    </script>

    Where can I check if this jQuery is bundled with WordPress?

    Are you enqueueing the .js file correctly?

    Thread Starter Sophiamolino

    (@sophiamolino)

    I guess that’s what goes wrong. I don’t see any enqueue in the template.

    I copied this code in the head:

    <?php wp_enqueue_script("marquee-packed"); ?>

    But that still doesn’t work. Sorry, I really try to understand it, but I don’t have any knowledge about jQuery at all.

    You need to enqueue your script(s) in your theme’s functions.php file.

    Thread Starter Sophiamolino

    (@sophiamolino)

    Hope you are still here Esmi.

    So, if I understand it right, I’ve to include a code in the functions.php for the use of jQuery in general. Not specifically for the marquees, but for all the jQuery’s. Is that correct?

    I tried the following:

    // smart jquery inclusion
    if (!is_admin()) {
    	wp_deregister_script('jquery');
    	wp_register_script('jquery', ("https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false);
    	wp_enqueue_script('jquery');
    }

    Gained from: https://digwp.com/2010/03/wordpress-functions-php-template-custom-functions/

    But it doesn’t work.

    I really appreciate your help!
    Gained from:

    No! Never, ever, de-register core jQuery!

    Thread Starter Sophiamolino

    (@sophiamolino)

    Oh oops. Do you know where I can find an explanation of how to enqueue scripts in the functions.php?

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Marquees not showing in newest wordpress version’ is closed to new replies.