do_shortcode() outside loop not working

I’m trying to use a the function do_shortcode() outside the loop of WordPress.
I required wp-load.php and shortcodes.php on top of the file, but when i use do_shortcode('[converter']); the function only outputs the text [converter], not the function of the shortcode.

Does anyone know how to make the shortcode work?

Read More

Thanks in advance

Related posts

1 comment

  1. wp-load.php wasn’t the right file to require, the solution was to require the following:

    define( 'WP_USE_THEMES', false );        
    require($_SERVER['DOCUMENT_ROOT'] .'/wp-config.php');
    

Comments are closed.