Inspect Element – Dev Tools
The Chrome Inspect Element function is instrimental in making these changes to your WordPress theme.
Let’s say for example, that you want to change the main header on the homepage of your WordPress theme – then right click and choose “Inspect Element”.
Then click on the arrow icon on the top left of the window that opens, and your arrow should automatically select whatever you hover over.
Use a Text Document To Track Changes
Copy and paste code that you want to make changes to.
Make your changes in your notepad document and add a comment so that you can easily identify what you have changed.
Paste Changes into the Appearance>Customize>Additional CSS window
Once you have selected your code from the text/notepad document, you can go to the WordPress admin section /wp-admin and the Appearance menu and then “Customize”, then near the bottom, you should be able to paste in your new CSS.
To Preview CSS Changes
In inspect element, click the “+” icon on the top right.
You can then add styles to different elements.
Be aware that you may need to edit the parent element, to see any changes (rather than the specific element)
To Remove Elements on a Webpage
In CSS, if you change the “Display:” value to “none”, from inline-block etc.
You’ll need to copy & paste the whole block of code from inspect element’s CSS window, into the Custom CSS menu’s window in WordPress’s (Appearance>Customize>Custom CSS)
The video below has more details on how to do this:
To Change the Colour of Elements
Use the same method as above – i.e. select the element with the inspect element tool.
- Select the item that you want to choose using the arrow in the Inspect Element window (arrow is on top left)
- Then change the colour using the panel on the right:
- Finally, paste the new code for that element, into the Custom CSS window in WordPress (go to Appearance>Customize – wait for the Customize menu to load and then click either “Customize CSS” or “Additional CSS” which is normally located near the bottom left
Change the Colour of Font-Awesome Icons
This is easily done, the same way as shown above.
Select the icon, then change the colour in the CSS panel of inspect element on the right.
Select all the CSS in that window and then paste it into the Custom CSS/Additional CSS window on the left:
Changing the Fonts on Your WordPress Theme
Go to fonts.Google.com to see all the available fonts (well, most of them)
Open Inspect-Element – click the arrow on the top left of the window
Then, again just select the text that you want to change and this time change the font-family value to the one you want
Remember to add all the code/CSS from the window precise window that you edit on the right, to the Customize/Additional CSS panel on the left.
Using this method you can also change:
Padding & Margins
Background Image, Position etc.
By adding !important to your CSS, you can ovveride all other rules relating to that element. Use this sparingly though as it will get confusing.
More info on !important here – https://css-tricks.com/when-using-important-is-the-right-choice/