Answer the question
In order to leave comments, you need to log in
Why don't shortcodes work after AJAX load?
Good afternoon) Question for connoisseurs! We are setting up the topic, the question arose, the shetcodes from CF7 work when unloading AJAX, but the shetcodes from Visual Composer do not work.
AJAX handler:
<?php
function handler_get_work() {
global $post;
$args = array(
'posts_per_page' => 1,
'post_type' => 'portfolio',
'p' => (int) $_POST['id']
);
$single_work = get_posts( $args );
foreach ( $single_work as $post ) : setup_postdata( $post );
echo '<h1>' . get_the_title() . '</h1>';
the_content( __( 'Read More', 'atrium_theme_core' ));
wp_link_pages();
endforeach;
wp_reset_postdata();
die();
}
add_action('wp_ajax_get_work', 'handler_get_work');
add_action('wp_ajax_nopriv_get_work', 'handler_get_work');
?>
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