• Resolved GregW

    (@gwmbox)


    I note that the stylesheets for the map are loaded at the bottom, is there a way I can move them to the top, especially above my child theme stylesheet?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author 100plugins

    (@100plugins)

    Hi @gwmbox ,

    This is not adjustable by the plugin itself. I would recommend to make use of the !important flag to ensure your styling rules will override the default ones.

    Best regards,
    Daniel

    Thread Starter GregW

    (@gwmbox)

    This is why they need to be at the top so a website theme can over-ride styles without the need for the !important tag.

    Surely this can be done, at least just for the stylesheets, again like other plugins do.

    BTW why do you mark topics solved when they have not been by the poster (me)?

    • This reply was modified 9 months, 2 weeks ago by GregW.
    Thread Starter GregW

    (@gwmbox)

    OK I was able to fix this. I used wp_enqueue_scripts and then wp_enqueue_style for each stylesheet. This then moved them to the top of the page and removed them from the default location at the bottom. I then added the plugin version number via the $plugin_data and removed the WP version number for those specific stylesheets.

    For Example;

    add_action( 'wp_enqueue_scripts', function() {
    
    $plugin_data = get_plugin_data( ABSPATH . '/wp-content/plugins/open-user-map-pro/open-user-map.php' );
    
    wp_enqueue_style('oum_frontend_css', '/wp-content/plugins/open-user-map-pro/assets/frontend.css?ver=' . $plugin_data['Version'], array(), null , 'all' );
    }, 99 );

    So that worked and I can use my child theme to override the styles for OUM without having to !important everything.

    My enqueued stylesheet is set as 999, so after these.

    • This reply was modified 9 months, 1 week ago by GregW. Reason: updated code
    Plugin Author 100plugins

    (@100plugins)

    I’m glad you’ve found a way to make this possible on your page. The reason for OUM not to do it this way is, that the plugin styles need to reset some theme styles to be widely compatible. However – the theme should still have the chance of overriding these resets with !important.

    Btw. I’ve marked this post as resolved as your question has been answered.

    Best regards,
    Daniel

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Move the OUM stylesheets to top’ is closed to new replies.