WordPress widget outside installation folder

So for a very valid reason I am not going to get into the particulars on here and/or debate about, I am taking content controlled by WordPress into a sub folder not part of the WordPress install like post content by ID:

// Include WordPress
define('WP_USE_THEMES', false);



$post_id = 21;
$queried_post = get_post($post_id);
$title = $queried_post->post_title;
echo $queried_post->post_content;


and others similar to this, the issue I am facing now is I am trying to take a widget as the content in one of the posts, when I use a shortcode such as:

[do_widget id=gce_widget-2]

When that outputs using post_content it displays the shortcode as plain text. I’ve done quite a bit of searching around and am having difficulties finding how to grab the widget as well. Any help would be great!

Edit: I should mention the widget is a plugin widget not a WP core widget .

Read more here: WordPress widget outside installation folder

Leave a Reply

Your email address will not be published. Required fields are marked *