Site icon Hip-Hop Website Design and Development

admin ajax will not be working for non logged in customers

I do know that this problem has been mentioned many instances, however I believe I attempted many of the advises.

That is my code:

$.publish('<?php echo admin_url( 'admin-ajax.php' ) ?>', 
    {'motion': 'load_posts',
     'offset': offset,
     'creator' : <?php echo $uid?>,
     'cat'  : '<?php echo $category->title?>',
     'coloration': '<?php echo get_cat_color($category->cat_ID)?>' 
    },  perform(response){
        if (response.trim() == ""){$("#more_posts_<?php echo $catNoSpace?>").disguise();}
           $("#cat<?php echo $catNoSpace?>").append("<div class='newdiv'>" + response + "</div>");
        }

And I’ve these each strains:

add_action('wp_ajax_load_posts', 'ng_load_posts');

add_action('wp_ajax_nopriv_load_posts', 'ng_load_posts');

And a effectively working ng_load_posts() perform.

Additionally I attempted to disable all of my put in plugins.

What am I lacking?