Good morning
I have programmed my own WordPress plugin. But I don’t like the output in the backend. For example, I want a heading not in black but in white and I want it to be larger.
Since I don’t want to write the styles directly into the code, I need my own CSS file.
The problem is, I don’t know how to integrate a CSS file into my plugin so that it makes my heading bigger in the backend.
Can you give me some tips?
So far I have entered the CSS styles directly into the code.
But I can’t change tables created by WordPress.
For example the style table.widefat
2
Answers
you can call back your function in wordpress hook, given example below
my-plugin is handle, its always change for entering new file
plugin_url(), is wp built in function where you specify your css file directory/file-name.css
you can also use the below code
To integrate your own CSS file into your WordPress plugin for the backend, you need to enqueue the CSS file properly using the admin_enqueue_scripts action hook. Here’s how you can do it:
Create a CSS file (e.g., custom-admin-styles.css) and place it in your plugin folder.
In your main plugin PHP file, use the following code to enqueue your CSS file:
Example for CSS (custom-admin-styles.css):