Tell us what you are trying to do?
I would like to create separate php files that contain one or more cred forms and include these files in my wordpress page;
for example the php file will include "<?php echo do_shortcode('[cred_form form="news-story-form-add"]'); ?>"
What do I need to do to make this work?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Felix,
Thank you for getting in touch.
This external php file is it linked to wordpress? Or is wordpress loading this file?
If this php file is not on a wordpress site then our Forms plugin won't work.
Thanks,
Shane
The file is on the WordPress site, it is in my root directory.
I wrote my own plugin on this file and it works ( IE: echo do_shortcode('[cred_form123 default_1="ddd"]'); )
When I try to use the Toolset shortcode cred_form (IE: echo do_shortcode('[cred_form form="news-story-form-add"]');) IT DOES NOT WORK.
Do I need to include certain toolset files? (The form works fine when I include directly in my page).
FYI: I am using w3IncludeHTML(); to include the php file. Everything in the file gets executed properly except for the Toolset shortcode.
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Felix,
Is there a specific reason why you are adding the file to the root directly ?
I did some checks and are you including the following lines in your custom php file ?
require( './wp-load.php' );
Thanks,
Shane
No particular reason why it has to be in the root.
If it needs to be somewhere else, that will be ok. Let me know where.
Is there a problem with "require( './wp-load.php' );" ?
Should I be doing something else?
How can I get this done?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Felix,
Ideally I wouldn't recommend this.
You mentioned that when you created the file as a plugin, the code works. I suspect that this is because it is loading all the scripts and files that wordpress requires to work.
So if it is possible given that you've said that there isn't any particular reason for the file to be in the root then I would recommend creating your file as a plugin.
Thanks,
Shane
My issue is resolved now. Thank you!