nivo slider + camera slideshow = conflict? - wordpress

Grateful for your help.
I'm experience a conflict (for lack of a better word) between nivo Slider and Camera slide show. (nivo Slider is native to the wordpress theme we use--and is our main navigational feature on the sites landing page. Camera is of course a plugin and gets inserted via shortcode [camera slideshow="my-slideshow"])
This thread seems to have a promising answer. But I'm novice enough to be at a loss as to where to place this script--or if the script is the right solution.
The script:
<script type="text/javascript">
var j = jQuery.noConflict();
j(window).load(function() {
j('#slider').nivoSlider({
Again, grateful for your help.

Check the js console in browser for errors or add a link to your site.
Possible reason: doubled call for jQuery. You may check in page source for (or similar)
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

Related

Facebook Pixel Issue

I've been pulling my hair out trying to get a facebook pixel firing from a Divi theme button on wordpress at https://www.hannahhumphries.com
I've followed the steps outlined on https://stonypeaksdigital.com/triggering_facebook_pixel_events_inline_action/ and set everything up as outlined within that tutorial but when I load pixel helper I still get a ! error (see screenshot)
I'm hoping this is just because it's hidden behind an onclick and that someone can verify that it's actually working for me as the client thinks it's still not functional.
If it isn't working any help would be appreciated, I am 'new' to facebook pixels so just worried I'm overlooking something...
I've pasted the code below and it's hooked into the button which has the id 'fb_pixel_initiatecheckout'
<script>
jQuery(function ($) {
$(document).ready(function() {
$(".fb_pixel_initiatecheckout").click(function(){
fbq('track', 'InitiateCheckout');
});
});
});
</script>

Redirection option for Mediaelement.js in WordPress 3.6

I'm using the new Mediaelement.js in the WP 3.6.1 core to embed H.264 video.
Now I'd like to add a redirect after the video has played.
I know there's this option (EventListener "played") in Mediaelement but don't know how to apply it.
I've done some research about the de-registration and re-registration of the .js-File but am stuck at this point.
Maybe someone can help me?
Thanks!
We did have the same problem. On our case the video started automatically. So we knew when the video ended. We therefore went over to do it like this:
<script type="text/javascript">
$( window ).load(function() {
window.setTimeout(function() {window.location = "/about-us";}, 6000);
});
</script>
In our case the video was 6 seconds long. Afterwards we redirect to /about-us. Maybe this solution would work in your case too. Even thou it is not the exact answer to your question.

Redirect Page to Mobile Version in Wordpress

I would like to setup mobile redirection using the htaccess in my Wordpress website.
I have a mobile site (mobile.domain.com) and regular site (domain.com) The permalinks will be the same for each site e.g. domain.com/page-one/ and mobile.domain.com/page-one/ so it seems like it should be fairly easy to redirect to the same page in the mobile site.
I've tried looking online and cant find what I need, can anyone help with this? I would be happy just using a plugin if one already exists.
I know this is an old post, but after figuring this out I think the solution I used is worth mentioning here.
Everyone knows that a simple Javascript redirect will work great, but what if you want the user to end up on a page that has the exact same path name? If you have this redirect, then "example.com/contact" will be redirected to "mobile.example.com" - notice how this is not the mobile version of the contact page.
The solution is to have a Javascript snippet in the main header that will tell each page to keep its same pathname when redirected, such as "/contact". The one caveat is that each mobile page must be named the same as the desktop version - /whatever and /whatever.
<script type="text/javascript">
<!--
if (screen.width <= 800) {
document.location = "https://mobile.example.com" + window.location.pathname;
}
</script>
you could do the following in javascript:
<script language="JavaScript" type="text/javascript">
if ((screen.width>=1024) && (screen.height>=768))
{
window.location.replace('example.html');
}
</script>
This would need to go in your header.php
Check this website http://detectmobilebrowsers.com/ for php or javascript code. You can use PHP or Javascript, that you have to paste within header.php
Solution:
Download and install plugin : CSS & Javascript Toolbox
(make sure to always backup before downloading and installing
plugins)
Add this javascript to the page you want to redirect from.
<script type="text/javascript">
<!--
if (screen.width <= 600)
{
window.location="http://www.yourmobilesite.com";
}
//-->
</script>

How to add code area css style to HTML

I am trying to create a blog in wordpress. Since I might need to add some code blocks to my posts, I was wondering if there is any CSS style to represent code block.
A very simple example would be stackoverflow code tag (shown below)
<script type="text/javascript">
alert('this is example of what i need to do ') ;
</script>
Since you are using wordpress, there are plugins to do that. Just by looking at http://wordpress.org/extend/plugins/tags/syntax-highlighting there seems to be quite a few to choose from.

Trying to use the swfobject.js youtube object inside of WordPress

I need to use the extra powers of the swfobject api. This object is a new way of embedding Youtube videos into web sites.
Pasting code that I found from Google's tutorial directly into the WordPress editor was in-effective. WordPress would not treat this as active code.
So, I created a new template file and inserted my code into that file. This worked relatively well. The code went live and I got the extra feature that I was looking for, which was that I am able to have the visuals of the video autoplay, and to have the sound muted by default.
However, this has messed up the layout and flow of my menus which where just above the video.
Can anyone tell me where to proper place to put this code is, or is this question too specific. If it will help you can see the messed up page at:
http://bestoftimesusa.com/home-mute-test/
and how it is supposed to look at:
http://bestoftimesusa.com
The fully functional code that got embedded is this:
<script type="text/javascript" src="/wp-includes/js/swfobject/swfobject.js"></script>
<div id="ytapiplayer">
You need Flash player 8+ and JavaScript enabled to view this video.
</div>
<script type="text/javascript">
var ytplayer = false;
var params = { allowScriptAccess: "always" };
var atts = { id: "myytplayer" };
swfobject.embedSWF("http://www.youtube.com/v/IBjstQceGBk?enablejsapi=1&playerapiid=ytplayer&version=3&autoplay=1",
"ytapiplayer", "370", "238", "8", null, null, params, atts);
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("myytplayer");
ytplayer.mute();
}
</script>
</div>
Unless you want the same youtube video to appear on all pages (of a certain type), I don't think putting that entire block in your template files makes sense. The only part that really makes sense for a template file is the first line. The lines after that are video-specific.
By default, WordPress filters out javascript from posts. You can disable that filtering with a plugin which would allow you to include javascript in your posts.
Using that plugin, you can set javascript filters on a global or per-post basis. It seems like a per-post basis would work for you so I'd go with that, just enabling it on the page I wanted.
Two last things:
You could put the first line in one of your template files to eliminate having to put that in every post
You have one opening <div> tag but two closing </div> tags, that could be expected, but I'd double check.

Resources