php - WordPress widget outside installation folder -
so valid reason not going particulars on here and/or debate about, taking content controlled wordpress sub folder not part of wordpress install post content id:
<head> <?php // include wordpress define('wp_use_themes', false); require('../wp-blog-header.php'); query_posts('showposts=10'); ?> </head> <body> <?php $post_id = 21; $queried_post = get_post($post_id); $title = $queried_post->post_title; echo $queried_post->post_content; ?> </body> and others similar this, issue facing trying take widget content in 1 of posts, when use shortcode such as:
[do_widget id=gce_widget-2] when outputs using post_content displays shortcode plain text. i've done quite bit of searching around , having difficulties finding how grab widget well. great!
edit: should mention widget plugin widget not wp core widget .
try using do_shortcode instead of echoing content.
change
echo $queried_post->post_content; to
$content = $queried_post->post_content; echo do_shortcode($content);
Comments
Post a Comment