Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

difimon on "Include and use PHP class into a wordpress page"

$
0
0

Dear all,

I have a class in PHP named sample.class.php which I want to include in a wordpress page to exploit its functions. I am using the template twentytwelve and I have installed the plugin exec PHP to write php code into wp pages. I tried to do this until now with bad results:

- I've created a folder called "includes" into this path wordpress/wp-content/twentytwelve and then:

- I've tried to do this in a wordpress page (but doesn't work)

<?php require_once('includes/sample.class.php');

and its error is the following:

Parse error: syntax error, unexpected ‘<’ in /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 11

...and also this:

include(get_bloginfo('twentytwelve').'/wp-content/twentytwelve/sample.class.php');

Anything works here. Can you explain me what I have to do in order to solve this mistake?

Thank you in advance.
Marco


Viewing all articles
Browse latest Browse all 8245

Trending Articles