Monday, 30 September 2013

Load Tweets in random places in Wordpress posts loop

Load Tweets in random places in Wordpress posts loop

I am trying to incorporate tweets in a masonry layout in random places. I
don't know how to incorporate it into a Wordpress loop without breaking
the loop though... Here is a fiddle of the code I am using (code too long
for here). For reference, here is the code for the query.
<?php
define('WP_USE_THEMES', false);
require('wp-load.php');
query_posts('cat=technology');
if ( have_posts() ) : while ( have_posts() ) : the_post();
$feat_image = wp_get_attachment_url(
get_post_thumbnail_id($post->ID) );
?>
<div class="masonryImage" style="width: 300px; height:250px;">
<img width="300" height="250" src= "<? echo $feat_image ?>" alt="<?
echo the_title(); ?>" />
</div>
<?php endwhile; endif; ?>
Any ideas how to put tweets in between posts in a Wordpress loop? Here is
an example of what I am ultimately trying to achieve.

No comments:

Post a Comment