PDA

View Full Version : Issues loading Social Gallery Manually in Own Header



dtm_mathew
01-31-2013, 10:46 AM
Hello,

I'm having some issues getting the Social Gallery plugin to actually load. I did have a look on the forum for similar threads but couldn't find any (I admit, it was a quick and brief search), so I apologise if this is a duplicate or similar post.

When inspecting the page using Safari Inspection Tool the CSS loads at the end of the page, but there's no JavaScript. I do have an issue with enqueue scripts not working as I'd expect them to, so most of the JavaScript I have on the page is loaded manually in the head of the page, but I don't see it as a huge problem as I'm not going to be distributing the theme so I can monitor it and fix it when it breaks.

I tried loading the 2(?) JavaScript files directly in the head of the document (socialGalleryPlugin.js & socialGalleryPluginMobile.js), but I get a Type Issue, 'undefined' is not an object (evaluating 'window.sgp_config.sgp_selT'), I did have a read of your upcoming fixes and saw that you intend to include a fix for "undefined" when no social elements included, is what I've got happening here that? Or is it something else. Are there any other scripts that should be loaded?

In terms of using it, and settings, I only want to use it on one page (Gallery page), and would like to use it with the WordPress gallery system, as a test though I inserted one image thumbnail and added a class of 'socialGallery' to the A element surrounding the image and changed the Social Gallery Mode to Specific CSS Selector (Class or ID) and then set the css selector to .socialGallery.

Any help that you can give me on getting this to word would be greatly appreciated as it looks like a fantastic plugin, but unfortunately I haven't been able to get it to work yet.

woods
02-06-2013, 05:40 AM
Hi Matthew,

Thanks for stopping by and explaining what you've done in detail.

There's a few things Social Gallery does which means you can't just manually include the script in the header, and while it does use enque script/css it doesn't use it for what's important, it just puts that out via wp_head.

If you take a look at socialgalleryplugin.com's source you'll see what it does - you will need to let it output naturally for it to pass the options you've selected via settings so it can run without issue.

What were the problems you were having with scripts? WordPress's setup for queueing script's is pretty strong...?




W

dtm_mathew
02-06-2013, 10:31 PM
Hi Woods,

Thanks for the reply, I gave up trying to get it to work in the theme I had started as WordPress was having none of it. I tested it with the Twenty Twelve theme, and it worked, so what I've done is duplicated the Twenty Twelve theme and taken out everything I didn't need and built my theme around that, making sure that the gallery still worked. I'm pretty sure I'd done something wrong somewhere with the Enqueuing of the scripts, but it's the same code that I'd used for other themes which worked.

But that's neither here nor there, I've got it working now, and I'm very happy with it.

Kind regards,
Mathew.

woods
02-11-2013, 04:46 PM
Hi Woods,

Thanks for the reply, I gave up trying to get it to work in the theme I had started as WordPress was having none of it. I tested it with the Twenty Twelve theme, and it worked, so what I've done is duplicated the Twenty Twelve theme and taken out everything I didn't need and built my theme around that, making sure that the gallery still worked. I'm pretty sure I'd done something wrong somewhere with the Enqueuing of the scripts, but it's the same code that I'd used for other themes which worked.

But that's neither here nor there, I've got it working now, and I'm very happy with it.

Kind regards,
Mathew.


Mathew, glad to hear you have it working and are happy. Themes can be tricky & complex!

Thanks for posting.



W