Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
488 views
in Q2A Core by
Hello man!

When I use "Custom HTML at bottom of every page" I want to include a code with php, but php isn't executed. How should I do?

1 Answer

+3 votes
by
selected by
 
Best answer

Well, it is called "Custom HTML..." and not "Custom PHP...", right? :)

In order to include PHP code it is best to modify whatever theme you're using. So open the qa-theme/<your_selected_theme>/qa-theme.php file. As you are talking about "bottom of every page" then you will need to override the body_footer function.

If it is there, edit it, if it isn't add it:

public function body_footer() {
    if (isset($this->content['body_footer']))
        $this->output_raw($this->content['body_footer']);
    $somethingToOutput = "Bleh, I'm in the bottom";
    $this->output_raw($somethingToOutput);
}
 
And that's it.
by
Thank you very much man, I've solved it thanks to you. ;)
Take care!
...