How do i add this to wordpress theme

Hi Guys.

I’m looking for a little help, Im looking to, Im looking to learn how to do thing in wordpress and learn a little instead always turning to someone for every little thing.

I want to add this to wordpress and later add a online/offline icon and message count option to it but i’ve never do anything beyond the basic of css change or just copy and space code in the stated section.

So I could really do with a little help.

I’m assuming I need to add the html in the correct header php but do i add the css to the style.css or some other file ?
also where do i add the JS Code ?

Hi,

So if you are going to change anything within a wordpress theme the first thing you need to do is to ensure you are using a child theme: https://developer.wordpress.org/themes/advanced-topics/child-themes/

Doing this will mean that if an update comes out for the theme you are using you can get the update and it won’t remove the custom changes you have made to that theme.

The wordpress dev docs are very helpful so I suggest having a read of them and it should give you an idea of how to go about making these changes.

I hope this helps you a little bit.

2 Likes

Yes, You can add this code into your WordPress theme easily. Most of the designers and developers does the same thing because its the smart way to do the code. We can edit the code according to our requirements of the clients.

You can put the html code into header.php file but it will be more accurate if you put that code into your template file.
For css: You can add into your current working style.css with proper commenting that means describing the code where to relate.

You can put this into footer.php file under <script> tag.

Cheers…!!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.