How to use custom class in WordPress theme?

Posted by Prem Tiwari | Updated on

Want to use custom class in WordPress theme?

Step 1. Use following code in your theme’s functions.php file OR in site specific plugin.

Step 2. Create a new directory in your themes folder, something like /includes. Put your class in there. Then wherever in your theme where you need your class and it’s functions, just include it in your template:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers