- This topic has 16 replies, 2 voices, and was last updated 9 years, 6 months ago by
pab.
-
15th May 2014 at 2:13 pm #2635
I tried adding your code snippet for putting a Google+ like button in the header but pages only hang. I have used my ‘own’ js bits for copyright and Google Analytics which work OK.
-
15th May 2014 at 2:22 pm #2636
Not sure what you are referring to as “your code snippet for putting a Google+ like button in the header”. There are various ways to do it. But pages ‘hanging’ always mean you have malformed javascript, a very easy thing to happen. Let me look at your code, and perhaps explain further what you did with “my snippet”.
You should be using the custom_js module for it, otherwise you have the annoyance of needing to redo it at every upgrade if you put it in the theme code, which is unnecessary with the module.Nigel
My personal kiwitrees site is www.our-families.info -
15th May 2014 at 2:26 pm #2638
I copy/pasted the code from your kiwitrees FAQ pages http://kiwitrees.net/support/kiwitrees-faqs/
-
15th May 2014 at 2:29 pm #2639
Ah, I think I see the problem. Looks like the WP page mangled my code. You need to use this:
document.getElementById('header').innerHTML += '<div style="margin: auto; padding: 10px; width: 200px;"></div>'; (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/platform.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();
I’ve replaced each
& g t ;
with>
and each& l t ;
with<
and removed some< b r / >
Excuse spaces, the code gets mangled here too.
Nigel
My personal kiwitrees site is www.our-families.info -
15th May 2014 at 2:35 pm #2642
That would explain why I had trouble trying to understand how it worked! I should have realised that “>” was “>” and “<” was “<“. I’ll try again tomorrow.
-
15th May 2014 at 2:42 pm #2645
The code on the FAQ page is correct now.
Nigel
My personal kiwitrees site is www.our-families.info -
16th May 2014 at 12:31 am #2646
I tried the new code and the page loaded OK but I could see no button.
After looking on Google dev pages I changed the first line of code to:document.getElementById(‘header’).innerHTML += ‘<div class=”g-plusone” data-annotation=”inline” data-width=”300″></div>’;
and the button is there. It’s position isn’t great since Simpl_grey menus hide it when activated.
-
16th May 2014 at 1:03 am #2647
I’ve dropped the g+1 button into the footer but would it be best placed alongside the “Hit Count” number? I’m not a lover of social media but to get some feedback on whether anyone actually appreciates any pages might be useful/insightful?
http://bootsbootes.com -
16th May 2014 at 7:04 am #2648
It’s position isn’t great since Simpl_grey menus hide it when activated.
I can’t see how that would matter. Surely no-one would want / need to click the button at the same time as selecting a menu item.
I’m not a lover of social media but to get some feedback on whether anyone actually appreciates any pages might be useful/insightful?
Seeing as you asked – no I don’t see how it is either meaningful or useful. Surely all it tells you is that some unknown person for reasons only known to themselves clicked a pretty button?
Google Analytics is marginally better, as you can tell how long people stayed on pages and many other things.But ultimately all these toys are really designed for sites that need to generate income. A Family History site content is almost unique, and people interested in your family will find it. I don’t see how any other visitors matter. All you need is the bare basics (sitemap and well formed pages) so that search engines index them. End of story as far as I’m concerned.
Nigel
My personal kiwitrees site is www.our-families.info -
16th May 2014 at 7:45 am #2649
Yep – End of Story. I was only curious why it didn’t work for me. Your roadmap for kiwitrees suggests to me that you are a developer who seeks simplification and reliability and to cut out bloatware … and I will stand and salute to that! Perhaps there are too many options and modules which make people think “I should be doing something with that”?
And just to have the last word ,,, isn’t a Google “like” button with a value of 0 the most depressing thing ever to show on any web page!!!
Removing it as I send;-)
- The topic ‘Custom javascript’ is closed to new replies.