Post Snippet In a Subfolder
-
Hi,
I have 2 WordPress installations hosted in one server, and installed Post Snippets in both.
1. /home7/esoundsc/public_html/astrablog/wp_content/plugins/
2. /home7/esoundsc/public_html/lyrics-soundart/lyrics-news/wp_content/plugins/
Then, i have the following directory containing PHP and pictures :
/home7/esoundsc/public_html/client-system-albums/cpmfetch/
In No. 1, I have this PHP code inside a Post Snippet, for example:
include $_SERVER['DOCUMENT_ROOT'] . "/client-system-albums/cpmfetch/cpmfetch.php"; $objCpm = new cpm($_SERVER['DOCUMENT_ROOT'] . "/client-system-albums/cpmfetch/cpmfetch_config.php");
Works perfectly, in No. 1
I use the same PHP in No. 1 for No. 2 as well.
Now in No.2, DOCUMENT_ROOT is different and is “/home7/esoundsc/public_html/lyrics-soundart”.
So, I code the PHP inside a Post Snippet as :
include $_SERVER['DOCUMENT_ROOT'] . "/../client-system-albums/cpmfetch/cpmfetch.php"; $objCpm = new cpm($_SERVER['DOCUMENT_ROOT'] . "/../client-system-albums/cpmfetch/cpmfetch_config.php");
However it fails on the 2nd line in the code, the WordPress post will not completely load and just shows hte heading. I tried a test by echoing Hello World as the first line and it works. It just fails on $objCpm = new cpm($_SERVER[‘DOCUMENT_ROOT’] . “/../client-system-albums/cpmfetch/cpmfetch_config.php”);
I tried to hardcode the path like below, but didn’t work.
/home7/esoundsc/public_html/client-system-albums/cpmfetch/cpmfetch_config.php
What am I missing ? Sorry, I am no PHP expert.
Thanks
The page I need help with: [log in to see the link]
- The topic ‘Post Snippet In a Subfolder’ is closed to new replies.