The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group

Slack Signup
Newsletter Optin
Help Desk

Using shortcodes in non WP pages

Labels

This Discussion is public

Notifications

How do I get a Formidable shortcode to work on a Non WP page so I can create a stripped down custom page for user log-in?
I researched this a few months back but was not able to get it to work.

What do you mean by a Non WP Page? Are you saying that you're trying to get a WordPress plugin to work on a page that isn't part of a WordPress site, like HTML? If that's the case, you can't. As a WordPress plugin, Formidable's shortcodes depend on the WordPress plugin API being available. Shortcodes simply execute PHP functions. You could always trace through Formidable's source code, find the PHP functions and copy the code to the non WP pages, but the level of effort is enormous.

Well I stated that wrong, Not out side of WP but out side of the Theme. Like the example for the Registration add-on. Clean, no headers, footers, Nav bar, etc....

I tried this but was not able to get it to work.

<?php echo do_shortcode( '[your_shortcode]' )'; ?>

or

<?php echo apply_filters( 'the_content', '[your_shortcode]' ); ?>

Was hoping someone here has done this and could offer a suggestion.

Thanks for replying

When you use do_shortcode, you don't use the square brackets. The syntax is do_shortcode('my_shortcode');

Great, will try that. Nothing like getting the wrong info from the WP forums....

For this simple page this code worked. Without the [ ] it displays the shortcode as text.

<?php
require( '/home/xxxxx/public_html/wp-load.php' );

echo do_shortcode('[formidable id=81]');

?>

However, there is no css formatting applied. At least it's displaying the form, more work needed.

Thanks for the help

I'm sorry. My bad. I actually was thinking about another shortcode and gave you the wrong advice. If you're not seeing the form styling, go to the Formidable/General Settings page and make sure load form styling is set to "on every page on your site".

NP. Yes, setting styles to every page worked, thanks

Discussion closed.