I am trying to replace the default Add Media icon in my WordPress site. I searched for the same on the web and got this:
How to replace default icon on “Add Media” button?
This seems to work for the OP, and ofcourse should’ve worked for others too. But, I am getting confused as the answer contains words like Child Theme and all. I could understand the first part of the answer, but I lost the track when the answer talked about this:
wp_enqueue_style('my-css', get_stylesheet_directory_uri().'/css/my-admin.css'
From where did this part of the url came: '/css/my-admin.css. I searched in my database at the backend but couldn’t find this particular file anywhere. I know this might be a silly thing to ask, but this is it. Can someone help in this regard?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
this function get_stylesheet_directory_uri() return URI to current theme’s stylesheet directory and /css/my-admin.css is path to their file which you can create in your theme directory
example :
<link rel="stylesheet" type="text/css" id="my-css" href="https://yourdomain.com/wp-content/themes/yourtheme/css/my-admin.css">
this is the output of the code in your source
Method 2
/css/my-admin.css is located in the current theme directory as specified from the return value of get_stylesheet_directory_uri() prepended to this path.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0