• Hello,
    I only use wp-table-reloaded on one page, and would like to prevent it from loading on other pages (it slows down my home page load a bit).

    I’ve been told I can do something like this (for another plugin):
    How would I do this for wp-table-reloaded?

    Thanks,
    tacochamp

    put this in your wp-config.php

    define(‘CF7_DATE_PICKER_ENQUEUES’, false);

    then in your theme’s functions.php file you have two options:

    if (is_page(‘Form page’)) {
    if (class_exists(‘CF7DatePicker’))
    add_action(‘wp_enqueue_scripts’, array(‘CF7DatePicker’, ‘plugin_enqueues’));
    }

    or create an action

    function cf7dp_enqueues() {
    if (is_page(‘Form page’)) {
    if (class_exists(‘CF7DatePicker’))
    CF7DatePicker::plugin_enqueues();
    }
    }
    add_action(‘init’, ‘cf7dp_enqueues’);

    https://www.ads-software.com/extend/plugins/wp-table-reloaded/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yes, you are correct, the stylesheets for tables are added on all pages. The reason for that is, that the plugin does not yet know if there are tables on the page, when the CSS needs to be included in the head of the page. In other words, the plugin does not know in the head, if there are Shortcodes for tables or the template tags in the page. That’s why the CSS is included on all pages.

    If you really need to change this (although, due to caching, this generally is not a problem), I suggest to take a look at the HiFi plugin (https://www.ads-software.com/extend/plugins/hifi/), which allows you to add code to the page head. That way, you could load the CSS manually, on all pages that contain a table.

    Best wishes,
    Tobias

    Thread Starter tacochamp

    (@tacochamp)

    Thanks for the quick reply. My understanding is that I would deactivate the plugin and then only have it called on a specific page via HiFi? Is this correct?

    This raises two questions:
    1. If I deactivate the plugin, how can I access the admin screen for it?
    2. Exactly what code would I need to insert to have it execute on a specific page (Via header insertion?)

    Many thanks in advance

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no, you must not deactivate WP-Table Reloaded, as then the plugin would not work at all.

    Instead, you should deactivate the loading of the plugin’s Default CSS files (on the “Plugin Options” screen).
    Before you do that, take a look at the HTML source code of your page with the table and from the page head, copy the HTML code that has the loading commands for the CSS files. That’s what you will need to paste into the HiFi plugin.

    So, with HiFi, you are not loading WP-Table Reloaded just on one page, but your are loading the CSS only on one page.

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP-Table Reloaded] Only load on specific pages’ is closed to new replies.