Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
630 views
in Plugins by
I need to add custom php code for the facebook pixel and analytics. I need to be able to add variables using php.

1 Answer

+3 votes
by

Firstly, read the plugin creation guideline: http://docs.question2answer.org/plugins/tutorial/

Then, read the layers documentation: http://docs.question2answer.org/plugins/layers/

You just need to override the body_footer function or, even better, just set the layer's content array for the key 'body_footer'. E.G.:

if (!isset($this->content['body_footer'])) {
    $this->content['body_footer'] = '';
}
$this->content['body_footer'] .= '<script> ... </script>';

...