How to code

  • Author
    Posts
  • #1103754

    I’m adding a script that offers the use of JavaScript (ick, no) or this

    Dynamic Content Implementation optional
    Use a common include or template to paste the code above instead of manually adding it to every page

    How would I code the include?

    The blog I need help with is icollectmenus.wordpress.com.

    #1103862

    Not that blog. Just saw the tag line

    #1103906

    raincoaster
    Member

    Javascript cannot be added to a WordPress.com blog. If you tell us the result you intend to achieve, maybe we can come up with a workaround.

    #1103914

    I don’t want to use JS but will need to look up which blog later tonight. Will post then, thank you

    #1103974

    Found it. It is for the Google Analytics code. I want it on each page but don’t want to have to remember to try to include it. A script would help :)

    <script type=”text/javascrip”>

    var _gaq = _gaq || [];
    _gaq.push([‘_setAccount’, ‘UA-3XXXXXX7-1’]);
    _gaq.push([‘_trackPageview’]);

    (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’; : ‘http://www’;) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
    })();

    </script>

    Dynamic Content Implementation optional
    Use a common include or template to paste the code above instead of manually adding it to every page

    #1103976

    timethief
    Member

    We cannot use JavaScript for security reasons. The software strips the code out of free hosted WordPress.com blogs.
    http://en.support.wordpress.com/code/#javascript

    Can I use Google Analytics?
    No, Google Analytics cannot be used on WordPress.com blogs at this time. http://en.support.wordpress.com/stats/#additional-info

    Bottom line: If you think you must have Google analytics you will have to hire a web host and set up your own WordPress.org install. Read the comparison here > http://support.wordpress.com/com-vs-org/

    #1103980

    I do have my own hosted blogs. Sorry, i need the code for my own blogs not using JS. I don’t do JS (security risk) so want the code for the template or include

    #1103983

    timethief
    Member

    I do have my own hosted blogs.

    If this thread is about those blogs that are NOT being hosted by WordPress.com then you are posting to the wrong support forum. We don’t provide support here for WordPress.ORG software. If that’s the software you want help with you need to post to http://wordpress.org/support/

    #1103990

    Sorry. I did a search for WordPress help forums and this site is listed.

    #1103993

    timethief
    Member

    Heloo again,
    Many people get confused about this. I want to be sure you are clear.

    1. On this support forum we provide support for this blog which is hosted by WordPress.COM http://icollectmenus.wordpress.com/

    2. We cannot use JavaScript and we cannot use Google Analytics on WordPress.COM blogs.

    3. If you are referring to WordPress.ORG installs then know we cannot help you here. That support is provided at http://wordpress.org/support/

The topic ‘How to code’ is closed to new replies.