Mobile: Days of week in month view

Home Forums Calendar Products Events Calendar PRO Mobile: Days of week in month view

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #923547
    Neil
    Participant

    Hi

    When I use the month view on my mobile, the days of the week are still written in full, so inevitably overlap. Is there a way of shortening them?

    Thanks
    Neil

    #923717
    Brian
    Member

    Hi Neil,

    Sorry for the issues you are having.

    There is a script that runs in the mobile site to reduce the Weekday names so they fit, but there is a conflict causing that script to throw an error.

    Can you please follow our testing for conflicts guide:

    Testing Conflicts With Themes and Other Plugins

    And see if that can help narrow down the issue.

    Let me know what you find out and we can go from there.

    Thanks

    #923810
    Neil
    Participant

    Hi, really helpful, thanks, and this seems to link to a separate conflict I reported with the paging not working in the calendar list view, as that and the calendar day problem seem to go together (they are both faulty or both OK):

    – plugins no issue
    – I cleared my Firefox cache – no effect
    – my custom theme is the problem, and deleting <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> in my header.php corrects both problems.
    – If I look at the Firebug console, I am getting a javascript error:

    GET https://public-api.wordpress.com/rest/v1/notifica...amp%2Ctype%2Cunread%2Cstatus%2Csubject&trap=true
    200 OK		412ms	??/wp-i...267974j (line 5)
    ParamsHeadersResponseJSONCookies
    {"code":403,"headers":[{"name":"Content-Type","value":"application\/json"}],"body":{"error":"authorization_required","message":"An active access token must be used to retrieve notifications."}}

    … and I haven’t the expertise to know if this error could also be causing a conflict.

    Any suggestions?

    #923859
    Brian
    Member

    WordPress already loads a copy of jQuery and that coding you are adding loads a second copy of it. I would try removing it and seeing if that fixes the issue.

    It is usually been recommend to use the WordPress copy of jQuery from your site and not an external source.

    The error you are seeing in the console looks related to the WordPress API, not sure why it is saying that.

    I saw you other thread, but it does look related to this so I assigned it to myself, but we can work on both here.

    Let me know what you find out.

    Thanks

    #923899
    Neil
    Participant

    Thanks. OK, I think I’ve solved it, or rather hacked it, and I’d appreciate any insight you have.

    So the complete set of scripts loaded in the header.php are:

    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script src="<?php bloginfo('url');?>/wp-content/themes/iscience/js/subscribe.js" type="text/javascript"></script>
    <script type="text/javascript" src="<?php bloginfo('url');?>/wp-content/themes/iscience/js/jquery.sticky.js"></script>
    <script type="text/javascript" src="<?php bloginfo('url');?>/wp-content/themes/iscience/js/unslider.js"></script>
    <script>
        $(window).load(function(){
          $("#headwrap").sticky({ topSpacing: 0 });
        });
    </script>
        <!--[if lte IE 8]>
        <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <!--[if lt IE 9]>
        <script>
          document.createElement('header');
          document.createElement('nav');
          document.createElement('section');
          document.createElement('article');
          document.createElement('aside');
          document.createElement('footer');
        </script>
        <![endif]-->
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-23698805-4']);
      _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>

    If I remove the first script line as you suggest, all looks OK except the home page main image disappears. Now this is the ‘unslider’ jquery slider, which can show different images in rotation, although at present we show just 1 image. This only applies to the home page, so there is some need to reload jquery there.

    My solution is to incorporate the header into the homepage.php – with the extra jquery – and remove it from header.php for all other pages. Seems to work, and both mobile calendar days and paging work now. 🙂

    I always prefer to know why, so if you have any thoughts about that unslider issue I’d like to hear it. Otherwise we can just close the ticket.

    I appreciate your help.
    Neil

    #923908
    Brian
    Member

    Glad you have it working.

    I am not sure why it is broken without digging into the coding.

    I would suggest using wp_enqueue_script instead of directly putting in links to the scripts as you have in the first 4 lines.

    http://codex.wordpress.org/Function_Reference/wp_enqueue_script

    That could be the issue, but would have to test to find out.

    Also, although it looks like it is working you really should load jQuery once on the home page, it is already loading before the unslider.js script.

    One thing that might be causing the break and loading jQuery twice is fixing on accident is this code:

    $(window).load(function(){
    $("#headwrap").sticky({ topSpacing: 0 });

    You should change the $ to jQuery as that is throwing errors now as WordPress runs jQuery in noconflict mode so needs jQuery instead of $.

    That is about all the help we can provide on this, but if you have one more question I can try to help out.

    Thanks

    #923935
    Neil
    Participant

    I think you are saying I should change it to:

    <script>
        jQuery(window).load(function(){
          jQuery("#headwrap").sticky({ topSpacing: 0 });
        });
    </script>

    … and that seems indeed to resolve the conflict on the homepage. I appreciate your help – that may also reduce other potential conflicts with your plugin, so might save us both time in the future!.

    Many thanks
    Neil

    #923938
    Brian
    Member

    Yep that was it.

    Glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Mobile: Days of week in month view’ is closed to new replies.