Affiliate content won't load in Fluida – defer code?

  • Author
    Posts
  • #38660

    First of all: good job and thanks for the great theme Fluida!
    We’ve just upgraded our website http://www.projectsucces.nl to this theme and love it.

    Except for one thing: We earn a few bucks with affiliate content and this won’t work with Fluida.
    So far we only see a ‘defer’ code being added to the content, which we didn’t have before. So the old – working code goes like this (other site then where it doesn’t work):

    
    <script type='text/javascript' src='http://www.intellegus.nl/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
    <script type='text/javascript' src='http://www.intellegus.nl/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script>
    <script type='text/javascript' src='http://www.intellegus.nl/wp-content/plugins/bolcom-partnerprogramma-wordpress-plugin/resources/js/bol-partner-frontend.js?ver=<removed by me>'></script>

    And this works – the content loads. Then we use Fluida on our other site and it doesn’t work, but shows like this:

    
    <script type='text/javascript' src='http://www.projectsucces.nl/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
    <script type='text/javascript' src='http://www.projectsucces.nl/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script>
    <script type='text/javascript' defer src='http://www.projectsucces.nl/wp-content/plugins/bolcom-partnerprogramma-wordpress-plugin/resources/js/bol-partner-frontend.js?ver=<removed by me>'></script>

    As u can see: defer is added. We cannot find why, nor are we sure our issue with not loading content is caused by this – but we think it does.

    Page where the plugin is loaded, but does not show content is for example: http://www.projectsucces.nl/methoden/agile/
    -> At the bottom you see a part from ‘Bol.com’ and no products are loaded, although the plugin does load and shows this square.

    • This topic was modified 8 years ago by Nigel. Reason: Clarifications made
    • This topic was modified 8 years ago by Nigel.
    • This topic was modified 8 years ago by Nigel.
    • This topic was modified 8 years ago by Nigel.
    #38674
    Kay
    Cryout Creations mastermind

    Hi Nigel,

    Thanks a lot for the detailed info. We do user ‘defer’ for loading scripts in our theme but the strange thing is we make sure we only use it for 3 specific theme scripts. It’s strange that the jQuery script doesn’t get the ‘defer’ attribute but the bol plugin does.

    Anyway, in the next theme version we’ll include an option to disable JS scripts loaded with the ‘defer’ attribute.

    Until then you can edit line 123 in the fluida/includes/styles.php file. It currently looks like this:

    add_filter( 'script_loader_tag', 'fluida_scripts_filter', 10, 2 );

    All you have to do is comment it out like this:

    //add_filter( 'script_loader_tag', 'fluida_scripts_filter', 10, 2 );

    Commenting this line will prevent Fluida from adding ‘defer’ tags to our scripts. Let us know if it fixes it for you.


    Before posting consider reading our short theme debugging instructions.
    Please read the FAQs: MantraNirvanaParabolaTempera
    Tutorials: custom menustranslating themeinstalling themecategory page with introdisabling comments Wordpress: child themescategories/posts
    Before making any modifications to your theme we strongly recommend using Child Themes.
    #38684

    Thank you so much for your swift and complete reply!

    Yesterday we found another work around using an optimizer plugin which enabled us to change the behavior of WordPress with JavaScript, so it worked again. We will try your workaround too, since the less plugins needed the better.

    The plugin we used it called ‘autoptimize’.

    We have also changed some of the code to change behaviour with images on the frontpage etc, is this something you would like us to share with other users here?

    • This reply was modified 8 years ago by Nigel.
    #38709
    Zed
    Cryout Creations mastermind

    We’re always open to suggestions on improving things.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Affiliate content won't load in Fluida – defer code?’ is closed to new replies.