I’d like to add a specific .php code into my posts and pages, for that I’ve installed the plug-in of “Allow PHP in posts and pages” from Hit Reach.
(Didn’t get an answer on the Plug-ins author’s page).
Here is what I’m trying to do:
(1) Under my Theme’s folder - created file called config.php
Config.php contains the following:
$test='This is Test Text';
(2) Then, I’ve updated my Theme’s ‘Single Post’ page (single.php) to be:
(Note: config.php and single.php are hosted in the same folder)
(2) Then, I opened a sample post -> Clicked “HTML” tab and entered:
Nothing happens…it won’t call that data from config.php…
If I went to single.php and manually added the following:
<?php echo $test?>
Just to see if that works, so it works that way, but the problem is I want it to work from within post’s content.
What am I doing wrong and is there a simple way for me to add PHP codes into WP posts and pages? (I'm not a php expert...).