Viewing 10 posts - 1 through 10 (of 17 total)
Author
Posts
  • #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.

    Penguins Are  Boss

    https://bootesgowland.kiwitrees.net

    Happy to be hosted by kiwitrees.net

  • #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
  • #2638

    I copy/pasted the code from your kiwitrees FAQ pages https://kiwitrees.net/support/kiwitrees-faqs/

    Penguins Are  Boss

    https://bootesgowland.kiwitrees.net

    Happy to be hosted by kiwitrees.net

  • #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
  • #2642

    That would explain why I had trouble trying to understand how it worked! I should have realised that “&gt” was “>” and “&lt” was “<“. I’ll try again tomorrow.

    Penguins Are  Boss

    https://bootesgowland.kiwitrees.net

    Happy to be hosted by kiwitrees.net

  • #2645

    The code on the FAQ page is correct now.

    Nigel
    My personal kiwitrees site is www.our-families.info
  • #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.

    Penguins Are  Boss

    https://bootesgowland.kiwitrees.net

    Happy to be hosted by kiwitrees.net

  • #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

    Penguins Are  Boss

    https://bootesgowland.kiwitrees.net

    Happy to be hosted by kiwitrees.net

  • #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
  • #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;-)

    Penguins Are  Boss

    https://bootesgowland.kiwitrees.net

    Happy to be hosted by kiwitrees.net

Viewing 10 posts - 1 through 10 (of 17 total)
  • The topic ‘Custom javascript’ is closed to new replies.