Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Using custom stylesheets
This topic contains 4 replies, has 2 voices, and was last updated by shaone 9 years, 4 months ago.
- AuthorPosts
- May 13, 2014 at 4:07 pm #1806
Is there a simple and advisable way to disable the stylehseets used and written by the plugin, including the options like colors in admin.
Basically I just want the raw markup and database stuff and would like to rewrite the stylesheet entirely for my template.
Preferably I’d like to do this in a extendable way, ie, when I update the plugin or settings in admin I don’t want to repeat this excercise each time.
Many thanks!
SeanMay 13, 2014 at 4:17 pm #1807Hi!
Most likely the best way to do this is by disabling the code, that is responsible for the stylesheet addition.
Open up the wp-content/plugins/ajax-search-pro/includes/shortcodes.php file. On the line 50 you should see this:
add_action('wp_print_styles', 'search_stylesheets');
Comment out that line, and the complete styling should disappear:
//add_action('wp_print_styles', 'search_stylesheets');
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 14, 2014 at 9:12 pm #1808Thanks Ernest!
That seems to do the trick : )
One last question on CSS, I notice there are a lot of inline styles present, I’m sure there is a good reason, but if I wanted to remove those for any reason is there a similar simple php adjustment?
And on another note entirely… do you ever do custom builds and specific requests along the lines of the search plugin, paid obviously!
If this is something you’d be interested in helping with and earning some new income let me know and I’ll send you further details to consider.
All the best!
Sean-
This reply was modified 9 years, 4 months ago by
shaone.
May 15, 2014 at 9:38 am #1810Hi Sean!
If by inline stylesheets you mean the “style=..” on some nodes, then I would not recommend doing anything about it. Some of them are coming from the php code, some of them from the javascript. I’m highly against inline stylesheet solutions, but there was a very solid reason to implement them – compatibility. The plugin also uses 3rd party javascripts, some of them are also doing the same, it’s the cross browser, cross javascript madness and only if there was a better way to deal with it. By trying to remove some of them will most likely cost you an unexpected error, which you may not even notice.
Also, if you examine the stylesheets, you will notice that each of the search instances are marked with an id, like “#ajaxsearchpro1 .proinput etc…”, and this is also a highly unadvised way of making css files. However following the conventional class, sub-class selectors I was facing so many support tickets for various layout problems, that I couldn’t deal with them. There was no way to prevent other plugin/theme stylesheets from overriding my selectors but to use id-s. As you probably know id selectors in CSS have a precedence over classes, thus putting a code under id-s will fix most of these problems. I’m on the way of releasing a new product and it looks like I may have found a better solution, but it needs to be tested first 🙂
I whish I could join your project, however my timetable is full for the next couple of months. Besides that I promised myself I would only focus my energy exclusively on envato products.
If you have more questions I’m happy to help you, I usually answer in 24 hours (except for weekends).
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 15, 2014 at 11:19 am #1811Aha, I knew there would be a good reason, thanks for the insights and depth of reply, very useful to know about when customising and much appreciated!
Oh, and I fully understand sticking to your decision to focus your time/efforts, if you happen to have any other WP/Ajax ninjas in your network who could easily tackle this then please do feel free to forward on the request, there is some reaosnable gain to be had and its an inetresting project/puzzle to solve : )
All the best Ernest, and thanks so much for the plugin and great support, I’ve left you a top rated review, naturally!
Looking forward to checking out what you release next…
-
This reply was modified 9 years, 4 months ago by
- AuthorPosts
You must be logged in to reply to this topic.