Two carousels on same page - javascript

I have a website that wasn't developed by me, it is a wordpress theme and I'm not sure how to do this, as I need to change the code.
The theme comes with one carousel on the homepage called from a php template part. What I need is to have two carousels instead of one.
This is the site: http://tehar.com.br/
As you guys can see, the website is actually with two carousels but they are not working, since I guess the usage of both in the same time causes the javascript to conflict.
I wasn't able to find any javascript call on the page file, and even the .js file that handles the carousel.
Any guess of what to do? I really don't have any clue on what to do.
Thanks!

Related

How to embed HTML5/CSS + js music player on single wordpress page?

I have an html 5, css, and javascript audio player that I'm trying to add to one page on my wordpress site.
I tried to paste the html into my page's text editor, while installing the JS and CSS folders for the player in my child theme's folder, which didn't work.
I tried placing the CSS for the player styling in my child themes CSS file, and that didn't work. I also tried linking to the style sheets and js scripts from the header.php file, which wasn't working for me.
My first thoughts are that because the html is showing up as it should, the css and JS files aren't being called. So I just need to figure out the path structure of how wordpress creates pages? Yet I know wordpress does something with a database to display the pages?
I saw some documentation about using I think it was either php or JS functions to call scripts or something and I don't understand enough of those languages to be able to make sense of it yet.
I'm still working with my developer, but he's 7 hours ahead of me and asleep. I just want to put the hardcoded version of the player and a few songs on my site for now so I can do some testing/see how it looks.
I hope that this question meets the SO req's. I tried to search on my own and I know the answer is out there, I just don't know enough to understand it yet. Trying to get a head start
The path to your Child theme's folder should be '/wp-content/themes/name-of-theme/'. You can use that in your header to call the files from wherever you might have placed them in your Child theme's folder.
To hard code the HTML, pasting it in the WordPress page editor should work fine unless there is another JS call or some weird iFraming going on.. if that's the case, you can simply create a Page Template (https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/#creating-custom-page-templates-for-global-use) and paste the code there. You'll likely want to just copy an existing page template from your Theme, take out the inner loop, and replace it with your video code.
Adding the links to your 'header.php' file would be considered bad practice. You would want to create a 'functions.php' file inside your Child theme and call the JS/CSS from there. You can also find this within the WordPress codex (they literally give examples you can copy/paste and change your file names).

js corrupt file only working on some pages

I am making a magento webshop, but i have run into some problems with the theme i am using.
I bought it on themeforest, and i have asked the developer for help, but it takes ages for them to answer and come with a real solution to fix the problems, so now i am seeing if someone here can help me solve the problem.
The webshop: http://new.webhipster.dk/index.php/home-left
When i add items to basket ("Læg i kurv"), it only works on the front page (the link listed above). When i go to another page, it won't add the item to basket. (e.g. http://new.webhipster.dk/index.php/roedvin.html)
So my guess is that there is a corrupt js file, but what i don't understand is, that it is the same code which is generated in header on both pages - but still it doesn't work on any other page but the frontpage.
How do i figure out what js file is corrupt and isn't loaded properly?
I have gone trough each one to see if they load, and it seems like they all load exactly like they do on the frontpage.
I guess you are missing a library required for it or might be css. As error in your console window say that it could not found css property.
Because when I tried accessing url directly from browser it's adding items into cart
For Example you are calling -
setLocation('http://new.webhipster.dk/index.php/checkout/cart/add/uenc/aHR0cDovL25ldy53ZWJoaXBzdGVyLmRrL2luZGV4LnBocC9ob21lLWxlZnQ,/product/2/form_key/1Tfx79G6V33Q7l2Q/')
Now try accessing it from the url something like
http://new.webhipster.dk/index.php/checkout/cart/add/uenc/aHR0cDovL25ldy53ZWJoaXBzdGVyLmRrL2luZGV4LnBocC9ob21lLWxlZnQ,/product/2/form_key/1Tfx79G6V33Q7l2Q/
and this will add item in your cart.
Now you debugging should start from function setLocation(). Try doing file search for setLocation function. and check where it is failing.
Hope this will help you atleast for debugging.

How to make more than two jQuery scripts work in a single webpage

-Test link for the problematic webpage-
This webpage is a landing page to a parent website. There are several javascripts that are required to run. Unfortunately, not all work simultaneously. I have tried various combinations but cannot find a way to make the webpage work.
The functions taking place in the webpage are:
Revolutionary Slider
Multiplication calculator
tabs toggler
smooth scroll-to-section menu
back-to-top button
Fancybox (lightbox)
Please help . Thankyou
Errors generated by your page
indicate that jQuery library is not the first script you are loading.
Looking into source show that you are loading jQuery in line 75.
Move this line to very top of your page.
I think this is your primary problem. Your scripts may not necessarily require different jQuery versions.

How to reduce number of js and css load time in my magento site poup

Folks,
I am opening a popup through ajax in my magento site. The issue is the page which i am calling need lot of js and css files to get loaded to make that page work properly. But in turn it is increasing the load time of my popup.
I thought of loading loading all css /js on main page itself.But as you guys know that once the popup opens it doesn't know the content of main page as it is just an different entity.
And ajax approach is required because i am sending product id.
Please suggest.
You should also have a look at the content which you are requesting using AJAX.
Following things you can do -
Minify CSS and JS
Optimize your code which prepares the data for Ajax response.
Optimize Magento Collecions (if exist in response code)
It may help to decrease the load time.
Please refer the below links ,
http://developer.yahoo.com/performance/rules.html
https://developers.google.com/speed/docs/best-practices/caching

jQuery 1.7.1 slider not working except on homepage

I have tried to place the slider on every page on this website: http://atripathi.com
It works on the homepage, but doesn't work on any of the other pages (About, Services, etc.)
I know it's probably an easy fix, but I can't get it at the moment.
Thank you for any help or suggestions!
Looks like the original suggestion above is correct. I'm seeing slider javascript includes at the top of your homepage that aren't on the other pages.
Generally, a good way of troubleshooting is to make copies of both pages, index-c.php and about-c.php perhaps, and start removing everything that isn't pertinent to the trouble you're having (other HTML, css includes, etc.) until you get down to only the slider on the page. Once you've done that, you might notice that the one page is slightly different than the other, making it work. You can copy back and forth until it does.
The other possibility is that there's a relative path problem somewhere, because your one page is inside a folder (though I'm guessing you have a .htaccess redirect to a root folder page)? So if all else fails, move the reduced about-c.php to the root folder and see if that then works. If so, you know it's a path problem.
Hope these suggestions help.
I see that jQuery is being included on all your pages but the cycle plugin is only included on the home page. You should be able to update your template(s) to fix this.

Categories

Resources