• Hello,

    I’m finding with your plugin in place alot of the admin panels on my side have odd styling. I’ve isolated it to the fgstyle.css file and the margin:0 applied to the p paragraph tag. This makes several admin panels look terrible.

    To resolve I’ve updated your enqueue’s to use the proper hooks and in the admin one ensure it’s only enqueued when on the fg_page settings.

    Original Code;

    function fg_add_style() {
        wp_enqueue_style('form_style_sheet1', plugins_url('css/formstyle.css', __FILE__));
    }
    
    add_action("init", "fg_add_style");
    if (is_admin()) {
    
        function fg_option_style() {
            wp_enqueue_style('form1_style1_sheet1', plugins_url('css/fgstyle.css', __FILE__));
        }
    
        add_action("init", "fg_option_style");
    }

    New Code;

    function fg_add_style() {
        wp_enqueue_style('form_style_sheet1', plugins_url('css/formstyle.css', __FILE__));
    }
    add_action("wp_enqueue_scripts", "fg_add_style");
    
    function fg_option_style($hook) {
    	if ( $hook != 'toplevel_page_fg_page')
    		return;
        wp_enqueue_style('form1_style1_sheet1', plugins_url('css/fgstyle.css', __FILE__));
    }
    add_action("admin_enqueue_scripts", "fg_option_style");

    Can you please include this fix in your next release so as not to revert this change on update.

    Thank you

  • The topic ‘CSS in Admin conflicting with other panels’ is closed to new replies.