Answer the question
In order to leave comments, you need to log in
Why is the shortcode not working when displaying content?
I'm trying to get the content of the page via ajax request... but it doesn't process shortcodes, no matter how hard I try. What am I doing wrong?
function post_information() {
$args = array(
'post_type' => 'video',
'posts_per_page' => -1,
);
$myposts = get_posts($args);
foreach( $myposts as $post ){
echo apply_filters('the_content', $post->post_content);
}
die();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question