Hello Kelvin and thank you for contacting the Toolset support.
Can you provide more details about this code?
- Can you provide the whole code? Is this code inside a function?
- Can you tell me where(what file) this code is added?
It seems that your code tries to load WordPress with this line:
require_once('wp-load.php');
This use is not supported by WordPress, so we, Toolset, do not support it either.
Jamal is on Vacation. This is Minesh here and I'll take care of this ticket. Hope this is OK.
Looking at your requirement, the question you raised is a pure WordPress question and nothing related to Toolset. I suggest you should raise this question in public forum like: https://wordpress.stackexchange.com
As per our support policy, we do not support such custom code, its beyond the scope of our support policy. If you need custom programming help for your site, you can always contact our certified partners:
=> https://toolset.com/contractors/