Using custom stylesheets

This topic contains 4 replies, has 2 voices, and was last updated by shaone shaone 8 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1806
    shaone
    shaone
    Participant

    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!
    Sean

    #1807
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    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 :)


    #1808
    shaone
    shaone
    Participant

    Thanks 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 8 years, 1 month ago by shaone shaone.
    #1810
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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 :)


    #1811
    shaone
    shaone
    Participant

    Aha, 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…

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.