WHAT'S NEW?
Loading...

How to use a custom php class in a Wordpress theme

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:
<?php
  require_once('includes/MyClass.php');
  $class = new MyClass();
  $class->showConstant();
?>

0 comments:

Post a Comment