• So I basically have a wordpress single page application which loads content dynamically. But when I add the shariff to a page that get loaded this way, it is missing the footer information aka the css and js files which get injected. Is there any way to activate the .min.js and .min.css for every page without hardcoding it into the footer? Like an option to just say: include footer on all pages.

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

    (@starguide)

    Hi kiinasu,

    Shariff uses the WordPress functions to register its styles and scripts. So as long as your theme, as all themes should, has wp_footer() present, it will include the files. If you load content dynamically “by hand”, you want to make sure to fire wp_footer() at the appropriate times.

    https://codex.wordpress.org/Function_Reference/wp_footer

    This way you will not only fix this issue with Shariff and instead solve it for all plugins that register their scripts using the WordPress way.

    Cheers
    JP

    Thread Starter kiinasu

    (@kiinasu)

    The thing is my footer.php which is included on all pages calls <?php wp_footer(); ?>.
    The footers are identical on the page except the shariff.css and js part. But if you have a page without the shariff buttons, it doesn’t include it if I understand it correctly. And when I load in new content via AJAX that includes the shariff buttons, I can’t fire wp_footer again

    • This reply was modified 4 years, 11 months ago by kiinasu.
    Plugin Author Jan-Peter

    (@starguide)

    Hi kiinasu,

    I see. We can include an option in the next version to always load the scripts and styles. This might not solve all issues with loading content via AJAX only, but one thing at a time.

    Cheers
    JP

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Load min.css and min.js for every page’ is closed to new replies.