Support for Envato Buyers Forums DGWork Optimizing CSS/Javascript

Viewing 19 reply threads
  • Author
    Posts
    • #10912
      cwhlin
      Member

      Hi. In an effort to optimize my site performance, Google Pagespeed keeps saying that I utilize too many rendering-block external CSS/JS files. I’ve tried several plugins to minify them but it’s not really working. Should I create one large CSS file in the child-theme instead? Can you optimize the use of external CSS/JS in the next version? Thank you so much. I love your theme, just trying to make it as perfect as possible!

    • #10917

      Hi

      Those css/js files are generated by some plugins(revolution slider, visual composer), I can’t control it by changing theme files and I haven’t enqueued any external files into the theme, except a google font css file. But if you use any other google font for the text in these plugins, they will enqueue the new google font CSS files into your page. So, I activated Better WordPress Minify plugin for you, it will minify multiple CSS/JS files into one file automatically, and you can remove those unneccessary external CSS/JS files via BWP Minify > Manage enqueued files tab.

      By the way, I deactivated two plugins ‘Autoptimize’ and ‘Fast Velocity Minify’ which you use to optmize the page speed, because your page was broken by those plugins.

      Thanks

    • #10924
      cwhlin
      Member

      Thank you so much!

    • #10925
      cwhlin
      Member

      I don’t know what’s going on… I just checked the site and it looks completely off. Can you please check?

      littlechinesereaders.com

      I’ve disabled all the CSS-related plugins.

      • #10926
        cwhlin
        Member

        I think I found the mistake. I downloaded the latest version of the theme but I clicked on “download only wordpress files” and it gave me a .zip file that I think is incomplete. When I downloaded “All Files” and uploaded the zip files there, it went back to working just fine.

        Only issue that the logo is not showing up…

        • #10928
          cwhlin
          Member

          Custom Logo for each page is saving, but the global Logo is not replacing the default logo. Thanks!

    • #10932

      Hi

      Maybe that’s because the first time you update the theme was interrupted by the incomplete file, then you installed and activated the theme again, WordPress will clear the customize settings as a new theme setup, so you have to set the LOGO again in the customize.

      A small tip, you can install WP Envato Market plugin which is developed by Envato, https://github.com/envato/wp-envato-market connect your Envato API, then you will able to automatically one click to update the theme such as you update some plugins.

      By the way, Also I checked your page with google page speed, I noticed that almost all render-blocking CSS files are google font files which are imported by Visual Composer and Revolution Slider, you can remove the repeat fonts via BWP Minify, but I found Revolution slider enqueued the google fonts again without handle string so that the user can’t manually remove or manage the external CSS files, I will give them a feedback for this issue.

      Thanks

    • #10935
      cwhlin
      Member

      Thank you for the great tips. I still can’t get the global logo to save. I also notice the themevan shortcodes aren’t showing up so there must be something wrong with my last update. I will install the theme again.

    • #10936
      cwhlin
      Member
      This reply has been marked as private.
    • #10940

      I’m so sorry for the LOGO issue, this is my mistake. Please download this changed file https://www.dropbox.com/s/kehmczcstppcblp/template-tags.php.zip?dl=0 , upload it to the parent theme folder “dgwork/inc/functions/”, override the old file.

    • #10941

      I see the themevan shortcodes is display normal, right? I tested themevan shortcode 1.1.1 on my demo site, it works properly http://demo.themevan.com/dgwork/

      Am I missing anything?

    • #10944
      cwhlin
      Member

      Logo is resolved. Themevan shortcodes are displaying fine on the frontend but cannot be edited via visual composer in the backend.

    • #10948

      So much sorry, now you can reinstall themevan-shortcodes plugin here http://www.themevan.com/repo/plugins/themevan-shortcodes.zip , it will work properly in backend.

    • #10952
      cwhlin
      Member

      Works perfectly now. Thanks!

    • #10953
      cwhlin
      Member

      I take it back… the new themevan-shortcodes crashed my site (I had to move my site because the previous one also crashed)…

    • #10956

      Have you got any error message when your site was crashing? Because this time I tested the new themevan shortcodes with dgwork theme on my test site, it was working fine. Not sure anything I missed?

    • #10958
      cwhlin
      Member

      No. I moved the site and installed everything anew but still cannot see themevan shortcodes with visual composer. I can use the shortcodes directly, just cannot see them in visual composer (which I believe just updated also.. maybe that’s the problem)?

      If I may give a small suggestion, I also use the plugin EDD Sale Price to show items are on-sale. It would be cool if the FREE badge would also show up if the sale price is $0 (I tried changing the template, but haven’t figured out a solution because I think the sale price, if left empty, is read as equal to 0).

    • #10960

      Maybe because Visual Composer issue, the new version of ThemeVan Shortcodes doesn’t display properly in VC editor, so I have rebuild those ThemeVan Shortcodes for you, they are working in Visual Composer now.

      For second issue, did you actually mean you want to change $0.00 to 0? It’s not the theme issue, Easy digital downloads plugin controls the price format displaying, so may be you have to ask this question to the plugin developer.

      Thanks

    • #10961
      cwhlin
      Member

      1. THemevan shortcodes working in Visual Composer. Thank you.
      2. I meant I modified the template for product grid slightly so that the free badge would also show up when I use the EDD Sale Price plugin and set the sale price to $0. Example — http://www.littlechinesereaders.com/books/
      3. I had to turn off BWP Minify because it breaks the post/page templates. I guess I will see if I can minify the CSS/JV manually.

      Thank you for everything! You’ve been a great support.

    • #10967

      Whenever the price is set to $0, the free badge will show up, I still don’t understand how the template you want it to display as, sorry, could you let me know more details? Because I don’t familiar with the third-party plugin you used, it’s a little out of the theme issue support.

      • #10997
        cwhlin
        Member

        No worries. I modified the Themevan Shortcode product grid as follows so that the free badge will show up when the sales price is 0 (and not just when the product price is 0).

        $sale_price = get_post_meta($post->ID, ‘edd_sale_price’, true);
        $preview=esc_attr(get_post_meta($post->ID, “_dgwork_preview_url”, true));
        $short_description=esc_attr(get_post_meta($post->ID, “_dgwork_short_description”, true));
        if (!empty($sale_price)){
        $price = $sale_price;
        }
        else{$price=esc_attr(get_post_meta($post->ID, “edd_price”, true));}

        if($price == 0){
        $freelabel = ‘<div class=”freeLabel”>’.esc_attr__(‘Free!’,’tvms’).'</div>’;
        }else{
        $freelabel = ”;
        }

        I do have another quick question. Currently the two buttons (when hovering over the featured image) in the product grid shows Details and Add to Cart). What’s the href link if I would like the Add to Cart change the link to Download? Thank you!

        <i class=”fa fa-eye”></i>’.esc_attr__(‘Details’,’tmvs’).’
        ID.'” class=”button add_to_cart”><i class=”fa fa-shopping-cart”></i> ‘.esc_attr__(‘Buy Now’,’tmvs’).’

    • #11001

      Hi

      You should also edit the Themevan Shortcode product grid function, you can find the following codes

      <a href="'.esc_url(get_permalink()).'" class="button details"><i class="fa fa-eye"></i>'.esc_attr__('Details','tmvs').'</a>
      <a href="checkout?edd_action=add_to_cart&download_id='.$post->ID.'" class="button add_to_cart"><i class="fa fa-shopping-cart"></i> '.esc_attr__('Buy Now','tmvs').'</a>
      

      The second is the add to cart button, you can change the link there “checkout?edd_action=add_to_cart&download_id=’.$post->ID.'”

      Don’t forget that don’t modify the plugin, copy the function to your child theme.

      Thanks

      • #11020
        cwhlin
        Member

        Sorry.. I don’t think I was clear. I want to change “Add to Cart” link to “Download” (product download link). How do I do that?

    • #11022

      I’ve added the ‘download link’ feature in the next version and I will release it today or tomorrow.

      In the new version, I added external checkout/download link option that you can set the file download link, and when the price is 0, the add to cart button will changed to ‘download’.

      Also, new product templates and predefined section templates is added in the new version, so after I finish to test the product template, I will release it soon!

      Thanks

Viewing 19 reply threads
  • You must be logged in to reply to this topic.