Load post image as wordpress masonry container background

Jeje93

New Member
Goal: Fetch post's first "img src" (featured or not) and use it as the background for it's relative masonry container background.What I don't know is how to get the post's since it hasn't been loaded into the ajax container.Anyone have any tips?Thanks in advance!(also, if you see any problems or ways to improve this code feel free to let me know)Scripts put into header.php are as follows:\[code\] <!-- masonry container --> <script>jQuery(document).ready(function($){ $('#container').masonry({ itemSelector: '.masonry', isAnimated: true, columnWidth: 200 });}); </script> <?php wp_head(); ?> <!-- load ajax query container --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script type="text/javascript">$(document).ready(function(){$.ajaxSetup({cache:false}); $(".miniLoader").click(function(){ var post_link = $(this).attr("href") $("#miniLoader").html("loading..."); $("#miniLoader").load(post_link + " #content"); return false;}); }); </script>\[/code\]
 
Back
Top