Support » Plugins » An AJAX function doesn't recognize mi plugins

  • I have this function on functions.php on my theme:

    add_action('wp_ajax_get_single_post', 'single_post_callback');
    function single_post_callback(){
    if (isset($_POST['postName'])) {
    $postName = $_POST['postName'];
    $queryargs = array('showposts' => 1, 'name' => $postName);
    $myquery = new WP_Query($queryargs);
    if ($myquery->have_posts()) {
    while ($myquery->have_posts()) : $myquery->the_post();
     ?> <h2> <?php the_title(); ?> </h2> <?php
    else {
    	echo "No post with name " . $postName;
    else echo "No postName";

    The problem is that the_content() function show this when I have shortcodes on my post instead of the plugin functionality that mus display:


    [contact-form 6 “Name of form”]

    Any ideas?

  • The topic ‘An AJAX function doesn't recognize mi plugins’ is closed to new replies.