Plugin Author
tuxlog
(@tuxlog)
Please recheck with version released this morning. Should be partly better.
Thread Starter
yezzz
(@yezzz)
Ah I totally missed the update. Will have a look. thanks.
Thread Starter
yezzz
(@yezzz)
I’m seeing the following script src on non-card pages:
http://example.com/wp-content/plugins/wp-greet/smilies_tinymce.js
Maybe you removed one of the other smiley scripts?
Plugin Author
tuxlog
(@tuxlog)
should be resolved with v4.5
Thread Starter
yezzz
(@yezzz)
Thanks! Will check it out.
Thread Starter
yezzz
(@yezzz)
Sorry for the late reply.
It’s working fine and looks like my site got a little speed boost. Great job!
The only improvement would be if you also stop wp-greet.css from being added to every page.
Thread Starter
yezzz
(@yezzz)
Could you please make wp greet only output its stylesheet only where it’s needed?
It’s all over the place and my cardstyler is using it, making it rather large.
I could use the feature to turn of the css, but I don’t want to put it as inline style, so I would have to go scripting to add it. Can it be done with php inside the templates, or would that be outside the scope of the page/header?
Plugin Author
tuxlog
(@tuxlog)
Well, I tried before but wasn’t succesful.
How to manage this if you are on a start page showing several post excerpts and one post has the form in it?
Any ideas?
Thread Starter
yezzz
(@yezzz)
Thread Starter
yezzz
(@yezzz)
I’m no php programmer at all, but I got “the sensible method” on that mikejolly.com page working, with enqueue style. Took about 10 minutes to set up.
Note to others reading this: do not hardcode the url like I do below. Read the function reference in the codex on how to do it properly.
Anyway, here’s what I did for testing:
Added this to my functions file:
add_action( 'wp_enqueue_scripts', 'add_wpgreet_stylesheet' );
function add_wpgreet_stylesheet() {
wp_register_style( 'some-unique-name', 'http://example.com/testsheet.css' );
}
Then added this to the form template, within php tags:
wp_enqueue_style('some-unique-name');
Then placed a stylesheet with some basic styling on http://example.com/testsheet.css
And that’s all. Opened the form page and the stylesheet is present on the form page only.
I guess then you should be able to make it work on all templates via the shortcode.
Thread Starter
yezzz
(@yezzz)
On second thought, it would be useful if the plugin would only do the the registering part, and I could do the enqueueing manually via the templates. I’m considering to use a single url for the ecard “frontpage” and the ecard form/preview/display page, and would be preferable to only load the css with the form etc.
I think that should work with the following code in the form template:
<?php if(!count($_GET)) {
//or maybe only exclude wpgreet url parameters
?>
//place frontpage html here
<?php
}else{
// enqueue style + all template code here
}
?>
Then also enqueue style in the other templates.
Hope you can make this possible, perhaps with the disable css rules option.
Plugin Author
tuxlog
(@tuxlog)
Great to hear hear you have found a solution. I am not convinced of putting this kind of code in the template. Looks like it will produce lots of support mails when someone changes the templates.
But it seems to be perfect for you.
Thread Starter
yezzz
(@yezzz)
Well, my suggestion is: change the plugin to register the stylesheet like above, then where you currently enqueue the css, use the above enqueue method if “disable wp-greet css rules” checkbox is not ticked. Then it will simply behave the same way it does now, ie. it outputs the css on every page.
If that css checkbox is ticked, don’t enqueue the stylesheet, which is also the same way the plugin behaves now, ie. not output the css anywhere. The only difference is that the stylesheet is registered.
The webmaster then has a choice of how to put css on the page, eg. enqueue as above, add via script, style-tags, or whatever. And rookies don’t have to figure out stuff about functions files, manually adding things etc. Best of both worlds.
Thread Starter
yezzz
(@yezzz)
I had hoped you would release v4.7, even without the feature request above. The last v4.7 you sent worked great, and I could have installed it, but I prefer to use WP built-in updater.