• joycegrace

    (@joycegrace)


    Hello, thank you for making this plugin available for everyone to use.

    I am finding it works perfectly and as directed on every page that I set its rules on. However, it doesn’t seem to want to ‘obey’ some rules on the blog page, which is set to the ‘static’ page to show blog posts, in our “Readings” settings. In other words, “home page” (i.e. front-page.php) and “posts page” (home.php) are set to use different WP “pages”.

    Do you know why this is?

    I have checked this page https://assetcleanup.com/docs/changes-applied-not-taking-effect/ but none seem to apply to us. I also looked through the settings over and over again, and nothing seems to be causing this. I also can’t figure out why it’s only happening on this one page.

    When I go to CSS & JS Manager here https://cloudup.com/cMoi74b_ISv –> I am told to set these settings in the page that is designated as “posts page.”

    When I go there, I see the settings look correct. But in the HTML itself, many (not all) rules are ignored. E.g. all our woocommerce rules don’t take effect. GTM4WP rules also don’t work. I have tried clearing cache, putting cloudflare in dev mode, disabling the home.php child theme template, etc. but nothing seems to change.

    Is there something about this page or template that it won’t ‘obey’ rules like this?

    Thank you very much for your help.

    • This topic was modified 4 years ago by joycegrace.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @joycegrace if you go to edit the page (clicking on that button from the print screen you provided) and on that page, it says “You are currently editing the page that shows your latest posts.“, then it should work fine. I’ve now tested this with both the Lite and the Pro versions and everything works fine. I need more information such as the rules you set (e.g. unloading, exceptions) and extra print screens.

    Are you saying that everything looks fine, but the HTML source says otherwise? I’ve checked your blog page, and clearly, preloading rules are applied, so I’m sure you’re referring to other rules.

    PS: [expand title=”Read more”] and [/expand] are both showing on the blog page. Perhaps you disabled a plugin that has this shortcode, just so you know, it looks unprofessional and needs to be cleaned or fixed ??

    Thread Starter joycegrace

    (@joycegrace)

    Hello Gabe,
    I think something is wrong with that page but I don’t know what. OR plugins are not interacting with it properly.

    Thank you very much for running this test.

    However, now I’m curious because I don’t see “You are currently editing the page that shows your latest posts.” on the page I’m trying to use Asset Cleanup on.

    An example would be this script which is correctly ‘unloaded’ on every page that has that rule (including the one in question). https://cloudup.com/c5tKPQpmwje –> on the /blog page it does load in the HTML, even though it should not, based on the rule I’ve set (yes, it looks fine on the back end, in the editor area).

    To easily copy/paste to find it in the source it’s this one: /wp-content/plugins/duracelltomi-google-tag-manager/js/gtm4wp-woocommerce-enhanced.js

    However, this happens with other rules as well.

    Another example: /wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/style.css

    Collapse-o-matic works EVERYWHERE except that one page. They have their own way of not loading their resources unless the shortcode is used. The shortcode issue you described is something I’m actively investigating. You can see the thread here if you care ??

    I’ve enabled debugging to a log based on this instruction https://www.ads-software.com/support/article/debugging-in-wordpress/#example-wp-config-php-for-debugging
    This is the only error that I get when I turn off cloudflare, hard refresh and load that page:”Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘my_custom_init’ not found or invalid function name in /nas/content/live/bclaser/wp-includes/class-wp-hook.php on line 287″

    I used this solution to show the archive intro https://robincornett.com/posts-page/

    However, I’m now wondering if this is somehow not playing nice with the Block Editor / Gutenberg. She says her code is meant for Classic Editor but will work with Gutenberg. Would your plugin then also not load properly if something is meant to be classic editor or Gutenberg editor?

    I tested by disabling Gutenburg everywhere using the following code:
    add_filter('use_block_editor_for_post', '__return_false', 5);

    I mean, I tried the following code which is apparently meant for the Block Editor, but it absolutely still shows a blank archive intro for us https://www.billerickson.net/code/genesis-blog-archive-intro-text/

    So then I thought, let’s just not try to have any archive intro, let’s disable the home.php template and see if Asset Cleanup still loads what it should not load. I did that, and it presents the same problem. The examples above still load.

    I’m really confused… I have tried so many tests of disabling and enabling things… it’s really perplexing. I hope it’s not that the answer is in front of me and I’m being blind.

    Thread Starter joycegrace

    (@joycegrace)

    Hi following up on this, can you let me know why your plugin ‘ignores’ rules on this page only, even without any customization at all on the blog page?

    I’m also getting this error in chrome console: “The resource https://www.bclaserandskincare.com/wp-content/themes/modern-portfolio-pro/fonts/BClaser-iconfont/fonts/BClaser-iconfont.woff was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it has an appropriate as value and it is preloaded intentionally.”

    This is how I set up the preload: https://cloudup.com/cFAaLphX1eK

    Is this why?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Not working on blog page home.php file?’ is closed to new replies.