0

ok, so I have created a plugin in Wordpress. I want to be able to use some values I have created in a function within my template but I just don't seem to be able to get it to work.

I have created my plugin within a class the structure is:

class foo_class {

    public  $foo;

    public function __construct() {   

         $this->foo = 'hello';

    } 

    public function wordpress_test() {
        echo $this->foo;
    }
}

$foo_class = new foo_class ();

Soooooo my thinking is within a theme file I should just be able to go...

var_dump($foo_class->wordpress_test());

but this seems to just stop loading the page when I hit the var_dump call. Am I hooking into this wrong?

David
  • 35
  • 2
  • 11

0 Answers0