Load only on recipe pages

[ad_1]

Plugin Author
Brecht

(@brechtvds)

Hi there,

What are your settings on the WP Recipe Maker > Settings > Performance page set to?

Is “Only load Assets when needed” enabled there?

@brechtvds Yes, “Only load Assets when needed” was enabled. I also enabled “Default Snippet Templates in Footer” and “Default Recipe Templates in Footer”. As a consequence, I can’t see the CSS anymore, but I can still see a lot of <use xlink:href=”#wprm-star-empty-0 code in the comments section. Obviously, there’s nothing to rate on posts without recipes so no stars show on the front end. But it seems like the code for the star ratings still loads in code.

Plugin Author
Brecht

(@brechtvds)

That’s normal. The comment ratings feature does load in the comment by default and then stays hidden if there’s no recipe on the page. It’s not that much code, so the impact should be minimal. The alternative is to check the entire post content for a recipe first, which also has implications.

And in some cases the recipe isn’t actually part of the post content, but rather some custom field, and the comment stars still need to be there.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer