Forums › Forums › Search & Filter Pro › CSS
- This topic has 7 replies, 3 voices, and was last updated 10 years, 2 months ago by Ross.
-
Ross Moderator(Private) July 28, 2014 at 1:33 pm #2986
Hey David, you should be able to do this from your functions.php… let me have a think about it and I’ll try to get some code together – the problem with the CSS in general is that the plugin has no idea which pages the S&F form will appear on so it must be included – but I think if you know which pages yourself I can get some code to enable/disable CSS for certain pages 🙂
Thanks
Ross Moderator(Private) July 28, 2014 at 1:34 pm #2987Also, why does it break your tabs? All Search & Filter css is prefixed like
.searchandfilter
so there should be no conflict, or is this to do with the chozen css?Thanks
Anonymous(Private) July 28, 2014 at 1:57 pm #2990Hello,
It’s possible in functions.php but it seems there’s no handle when you enqueued your styles and scripts :
wp_enqueue_style( $this->plugin_slug . '-chosen-styles', plugins_url( 'assets/css/chosen.min.css', __FILE__ ), array(), self::VERSION ); wp_enqueue_style( $this->plugin_slug . '-plugin-styles', plugins_url( 'assets/css/search-filter.css', __FILE__ ), array($this->plugin_slug . '-chosen-styles'), self::VERSION );
Regards
Anonymous(Private) July 30, 2014 at 9:53 am #3069I’d like to reply on what you said there Ross; having an option to disable the entire CSS file from being loaded would be truly helpful! That way it’s up to the developer/designer to style the whole thing. Which, in my opinion, would be best.
Having the ability to enqueue the stylesheet and script files on ID-base (or whatever other method) would allow people to only load it on the pages they want. I guess this offers the most functionality. Plus it keeps PageSpeed in mind and all that. This way they can load it only when necessary. And I can stop the CSS from loading completely.
Maybe something like this for the config or functions file?
define('WPCF7_LOAD_JS', false); define('WPCF7_LOAD_CSS', false);
(Example taken from the contact 7 form plug-in way to enqueue.)
Ross Moderator(Private) July 31, 2014 at 1:39 pm #3080Hey Maarten, I’ll look in to Contact form 7 and see how they do it, might be the best way – always a good idea to see how the best plugins are doing it already 😉
Ross Moderator(Private) August 27, 2014 at 11:20 pm #4045Hopefully looking at doing this this weekend, but there are some essential bug fixes to do first :/
-
AuthorPosts