WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Table Sorting not available (8 posts)

  1. TobeyY
    Member
    Posted 1 year ago #

    I am a volunteer with a non profit and I am having trouble with Table sorting. I have checked the box "Enable sorting of the table by the visitor." but the sorting feature does not appear on our page http://fortcollinslions.org/services/eye-glasses-drop-off-sites/

    What else do I need to do?

    Thanks,
    Tobey

    http://wordpress.org/extend/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Tobey,

    thanks for your post, and sorry for the trouble.

    The reason for this is that something on your site (most likely the theme, but another plugin is also possible) is changing the source from which the jQuery JavaScript library is loaded. Instead of using the jQuery version 1.8.3 that ships with WordPress, it loads the version 1.9.1 from a different server. That new version however is not compatible with the JavaScript code of another plugin on the site. Due to that, the browser stops executing JavaScript entirely and that also means that the sorting functionality will not be executed.

    To fix this, you will need to find out who is responsible for loading jQuery from http://code.jquery.com/jquery-latest.pack.js
    The best way to do this is to temporarily switch to the WordPress default theme TwentyTwelve and check if the sorting works then. If yes, the responsible code is in the theme, most likely in the "functions.php". If it still does not work, this means that a plugin is responsible for this, and you'll have to deactivate other plugins (except TablePress) one by one, until the sorting works.

    Regards,
    Tobias

  3. TobeyY
    Member
    Posted 1 year ago #

    Tobias,

    Thank you for your quick response and excellent instructions. The good news is that the problem is not our theme. The bad news is the problem is the plugin All-in-One Shortcodes by Lizatom.com. When it is deactivated, TablePress works as expected but many of our pages become messed up.

    Any ideas as to what to do next?

    Thanks,
    Tobey

    PS in the US, Tobey is a nickname for Tobias, small world!

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    great find! Thanks for checking that!
    Yes, I can confirm that "All-in-One Shortcodes" is responsible for this, as the same happens on their Live Preview page.

    The next step would be to contact their support (it's a paid plugin from what I can see?) and ask them to stop loading jQuery from the CDN, but instead use the jQuery that ships with WordPress.
    This is probably just a small change in the code, but as I can't see the code, I don't know where exactly that is...

    Regards,
    Tobias

    P.S.: Here in Germany, the most common nickname for Tobias is spelled Tobi, but I don't really like that one :-)

  5. TobeyY
    Member
    Posted 1 year ago #

    Hi Tobias,

    I wrote to Lizatom and was told that they will change to using the default jQuery provided by WordPress in their next major update.

    I am not a patient person! :-) Nor am I a programmer, so I ask for your help.

    I have done some research and I have pulled this section from the All-in-One Shortcode plugin code that I think must be causing the problem. Can you look at it and suggest changes? Is it OK to edit the plugin code or do you think it will crash everything? Do you need to see more of the code?

    Thanks,
    Tobey

    function ltsc_insert_js() {
    
    	global $lizatomic_path;
    
    	if(!is_admin()) {               
    
    		// jquery
    		wp_deregister_script( 'jquery' );
            wp_register_script( 'jquery', 'http://code.jquery.com/jquery-latest.pack.js', '', '', false );
            wp_enqueue_script('jquery');
            // jcycle
    		wp_enqueue_script('jquery=cycle',
                'http://malsup.github.com/jquery.cycle.all.js', array('jquery'), '', false);
            // nivo
    		wp_enqueue_script('ltsc_nivo', $lizatomic_path . '/js/jquery.nivo.slider.pack.js', array('jquery'), '', false);
            // custom
    		wp_enqueue_script('ltsc_custom', $lizatomic_path . '/js/ltsc-custom.js', array('jquery'), '', true);        
    
    	}
    
    }

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    great to hear that they will make the necessary changes in the next version!

    Meanwhile, it's indeed no problem to fix this yourself, and you already found the right code. Just add // to comment out two lines above, namely:

    // wp_deregister_script( 'jquery' );
    // wp_register_script( 'jquery', 'http://code.jquery.com/jquery-latest.pack.js', '', '', false );

    Regards,
    Tobias

  7. TobeyY
    Member
    Posted 1 year ago #

    Thank you so much. That was exactly the help I needed. You solved another plugins problems and our site now works as it should!

    Take care,
    Tobey

  8. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    no problem, you are very welcome!
    Great to hear that this change fixed it!

    Best wishes,
    Tobias

    P.S.: In case you haven't, please rate TablePress here in the plugin directory. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.