I'm using Isotope (JQuery) in my WordPress template and i would like to use the adding item option (prepend). You can see it here: http://isotope.metafizzy.co/demos/adding-items.html
The script that I use works:
$('#prepend a').click(function(){
var $newItems = $(<div>Hello World</div>);
$('#container').prepend( $newItems)
.isotope( 'reloadItems' ).isotope({ sortBy: 'original-order' });
});
When I click on this link:
<li id="prepend"><a href="#">More</a></li>
The script adds a Hello on my page.
The problem is that i don't want to add a div but i would like to add a Post.
Here is the Post code that i would like to use:
<?php query_posts('category_name=offers'); while (have_posts()) : the_post(); ?>
<a href="<?php echo get_permalink(); ?>" class="element <?php $posttags = get_the_tags();
if ($posttags) { foreach($posttags as $tag) { echo $tag->slug . " "; } } ?>">
<div>
<?php the_title("<h3>", "</h3>"); ?>
</div>
</a>
<?php endwhile;?>
Do you know a way to make it works?
(Excuse my terrible english…)