• Hi,

    I’m having trouble adding the css code to my site: http://www.cookmorphosis.com

    I tried to add this button code to my site:

    [ Moderator note: Code fixed, please wrap code in backticks or use the code button. ]

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
    <script type="text/javascript" src="http://arrow.scrolltotop.com/arrow86.js"></script>
    <noscript>Not seeing a <a href="http://www.scrolltotop.com/">Scroll to Top Button</a>? Go to our FAQ page for more info.</noscript>
    
    <strong>It works fine, however, if I added these code into Footer section, the slideshow on top of my homepage will disappear. I added the slides.php code below (this is the code that included in the theme)</strong>
    
    <?php $slideshow_delay = of_get_option('bdesign_slideshow_delay'); ?>
    <?php $autoPlay = ($slideshow_delay != "0") ? 1 : 0; ?>
    
    <script type="text/javascript">
    //<![CDATA[
    jQuery(document).ready(function(){
    	jQuery('.flexslider').imagesLoaded(function() {
    		jQuery('.flexslider').flexslider({
    			slideshowSpeed: <?php echo $slideshow_delay . '000'; ?>,
    			directionNav: true,
    			slideshow: <?php echo $autoPlay; ?>,
    			animation: 'fade',
    			animationLoop: true
    		});
    	});
    });
    //]]>
    </script>

    Any idea that why this happened? Why the add on code is conflicted with my current theme? Please help

Viewing 12 replies - 1 through 12 (of 12 total)
  • “I’m having trouble adding the css code to my site”

    Is that just a typo? You didn’t post any CSS. =)

    It looks like your back-to-top and slider are both working on my end. Did you get this resolved already?

    Also, I would recommend using wp_enqueue_script() to load your js.

    Thread Starter cookmorphosis

    (@cookmorphosis)

    Hi,

    Right now what you saw on my site is the plug in “roll to top” I activated. I could not use the plug in for my site because I added Google Adsense code on Post page, and some how Adsense deactivates my “roll to top” Plugin. So it can only work on my homepage, but I really want the ‘roll to top’ button on every pages within my site.

    So long story short, i decided to manually add the code (above) to the footer.php. It works fine however will disable my slideshows on top of my homepage (code included above too). And I really don’t know how to fix it.

    Can you help me with either issue?

    Can you check the Console tab using developer tools (F12 in Chrome) while these items are breaking and post any error messages that are showing up?

    It’s likely a jQuery conflict which is another reason it’s good practice to enqueue your scripts rather than just drop them in template files.

    Thread Starter cookmorphosis

    (@cookmorphosis)

    Here is the error message I got from console tab

    project_filtered_navigation.js?ver=4.2.2:68 Uncaught TypeError: container.isotope is not a function
    http://cookmorphosis.com/wp-content/uploads/2015/05/2015-05-04-09.33.04-1_wm@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/04/resize-50@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/04/resize-271@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/05/2015-05-04-09.33.04-1_wm-686x457@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/05/2015-05-06-08.31.23-1_wm-686x457@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/04/resize-25@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/04/resize-60-686x457@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/05/resize-1-686x457@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/04/resize-54-686x457@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/04/2015-04-24-08.04.42-1_wm-686x515@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/wordpress-popular-posts/1264-featured-15x15@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/wordpress-popular-posts/1332-featured-15x15@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/wordpress-popular-posts/1434-featured-15x15@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/wordpress-popular-posts/1299-featured-15x15@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/wordpress-popular-posts/1316-featured-15x15@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/wordpress-popular-posts/1245-featured-15x15@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/wordpress-popular-posts/1454-featured-15x15@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/03/cloud3-190x190@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/03/cloud2-190x190@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/03/20141002_013901-e1427260967791-190x190@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/03/cloud1-190x190@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-content/uploads/2015/03/cloud-190x190@2x.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
    http://cookmorphosis.com/wp-admin/admin@2x.php?page=stats&noheader&proxy&chart=admin-bar-hours-scale Failed to load resource: the server responded with a status of 404 (Not Found)

    Thread Starter cookmorphosis

    (@cookmorphosis)

    I can’t post the error message here for some reasons, but i just added the code to the footer and the slideshows disappeared again. Can you help me to check that on your side?

    It said on the first two rows:
    Uncaught typeerror: jQuery(…) imagesloaded is not a function
    uncaught typeerror: container.isotope is not a function

    Ok, so that clears a few things up.

    Can I ask the reasoning behind pulling that flexslider jQuery out of the plugin and placing it in your footer? That script has dependencies and needs to be loaded at a certain point, which is why it is complaining the imagesLoaded() function isn’t defined. I am sure the plugin makes sure that function is defined before trying to run it, and you pulling that code out and dropping it somewhere else is throwing a wrench in that process.

    I just noticed you have the jQuery ready() function in two locations on your homepage.

    One is inside your #primary container and one is down in your footer. Are you adding these all manually to template files?

    Thread Starter cookmorphosis

    (@cookmorphosis)

    Oh, the code is not from the plugin, i used the code from an open source website.

    The reason I did that because, as stated above, whenever I add the ad-code (either from yahoo or google) the ‘roll-to-top’ plugin would stop working on.

    Moreover, the ad-code also makes the slideshow disappeared if I put it on homepage, so for now, to resolve this weird matter, I decided not to put any ad code on my homepage for a flawless look.

    So I thought that find the ‘roll-to-top’ source code and paste it directly into the footer would solve the problem. It does appear on every page, but makes the slides show disappeared from the home page.

    Hope I explain myself clearly.

    Thread Starter cookmorphosis

    (@cookmorphosis)

    the only code that I added manually is the ‘roll-to-top’ code that was found from an open source. Others codes are already included in the original css file from the theme I bought.

    You mentioned this is a commercial theme, have you tried contacting the theme author(s)? I am also seeing issues with the testimonials slider on your homepage.. It looks like you have multiple jQuery conflicts going on and it is difficult to troubleshoot without seeing the themes code.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @cookmorphosis Your error log was caught by the spam filter, it’s been released.

    Thread Starter cookmorphosis

    (@cookmorphosis)

    Yeah, I did contact the theme developer but they do not consider this type of matter in their free theme support package. This was what I received: “I would recommend that you double-check the code that you’re attempting to add to make certain that it is the proper code. If you find that something you’ve added to your site is causing a conflict with the site and other plugins, you may need to find an alternate way to achieve that functionality.

    You were right about the testimonials slider on my homepage, it does have the same problem too as soon as I added the ad-code or this ‘roll-to-top’ code to the site.

    I guess I have to live with these issues until I find out the way to smooth everything out. For now, I might just accept the fact that the roll-to-top button only works on my homepage.

    I really appreciate your time and effort that you spent to trouble shoot these matters with me. Thanks a lot.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Css edior troubleshooting’ is closed to new replies.