So I have a single.php wich contains this.
$('#ajax').load('<?php echo get_template_directory_uri(); ?>/test.php?choices=<?php echo $post_id; ?>');
This loads test.php into this
<div id="ajax"></div>
The test.php loads in perfectly. But I want to use a function from functions.php In single.php i can perform any function from functions.php. Since this is the wordpress standard.
But when I try to use a function from it in test.php I get an error. This is the error
Fatal error: Call to undefined function add_theme_support() in /customers/9/9/c/papercraftplaza.com/httpd.www/wp-content/themes/papercraftplazaV2/functions.php on line 2
This is everything that is in test.php. The functions I want to use are currently a comment. How would i include it so I can use my function?
<?php
include "functions.php";
$_GET['choices'];
$passedvar = reset($_GET);
//setPostDownloads($passedvar);
//echo getPostDownloads($passedvar);
?>
<p>You downloaded papercraft: <?php echo reset($_GET); ?></p>