wordpress ajax hide post on click and show others

I am calling ajax inside wordpress which is a pain at the best of time, but what i am trying to do is when i click on a post it hides the one i clicked and the shows any other posts in that category

$category = $_POST['category'];
query_posts('category_name='.$category.'&posts_per_page=4&offset=1');
    if ( have_posts() ) {
        while ( have_posts() ) {
            the_post();
            $id = get_the_id();
            echo "<a data-show='$id' data-cat='$category' class='single'>";
            echo get_the_post_thumbnail( $post_id, 'medium' );
            echo "<p>";
            the_title();
            echo "</p>";
            echo "</a>";
        } 
    } 

This is my query post and gets the first for 4 with an offset of the first one..

Any ideas how i can hide the post i click on and get the next 4


Source: javascript

Leave a Reply