WordPress.org

Ready to get started?Download WordPress

Forums

Add style to wordpress plugin (3 posts)

  1. girll
    Member
    Posted 1 year ago #

    Hi all.

    I have such a problem.
    I have a wordpress project where I have a few plugins that add menus to admin panel.
    Now I want to add styles to that plugins.

    in my plugin's index.php file I write

    function my_admin_theme_style() {
        wp_enqueue_style('my-admin-theme', plugins_url('style.css', __FILE__));
    }
    add_action('admin_enqueue_style', 'my_admin_theme_style');

    But this adds style.css's style on every admin-page, but I need to add only on that one menu page that this plugin creates.

    How to do it?
    Thanks.

  2. gr8whitenorth
    Member
    Posted 1 year ago #

    You can't modify theme style and affect a plugin. I would do a search for plugin css, or edit the plugin css directly.

  3. girll
    Member
    Posted 1 year ago #

    OK, I did it. Thanks for reply.

Topic Closed

This topic has been closed to new replies.

About this Topic