Page 1 of 1

Embed thumbnail in external website and wrap text?

Posted: Thu Jan 26, 2012 11:44 am
by Leanna
Hi,
Please help me. I embedded my Wordpress blog's feed on my home page (non-wordpress but hosted in the same place) but can't get the text to wrap around the thumbnails. Please show me how to do this, I've tried EVERYthing...
Website: http://www.tellasia.org
Code:
In header:
<?php
// Include WordPress
define('WP_USE_THEMES', false);
require('./blog/wp-load.php');
query_posts('showposts=4');
?>

In body:
<?php while (have_posts()): the_post(); ?>
<strong><?php the_title(); ?></strong>
<p align="left"><?php add_image_size('custom-thumbnail-size', 125, 125); ?>
<?php the_post_thumbnail('custom-thumbnail-size'); ?></p>
<?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>">Read more...</a>
<?php endwhile; ?>

THANK YOU!!!
Leanna

Re: Embed thumbnail in external website and wrap text?

Posted: Thu Jan 26, 2012 12:59 pm
by Celauran
Don't put paragraph tags around your images and use float: left

Re: Embed thumbnail in external website and wrap text?

Posted: Thu Jan 26, 2012 11:06 pm
by Leanna
Please show me an example of code. Do you mean put the image portion of the Php in a CSS style in the Style sheet so I can use float:left? Sorry... I'm an amateur.
Leanna

Re: Embed thumbnail in external website and wrap text?

Posted: Fri Jan 27, 2012 6:34 am
by Celauran

Code: Select all

<?php while (have_posts()): the_post(); ?>
<strong><?php the_title(); ?></strong><br />
<?php add_image_size('custom-thumbnail-size', 125, 125); ?>
<?php the_post_thumbnail('custom-thumbnail-size', array('class' => 'imgfloat')); ?>
<?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>">Read more...</a>
<?php endwhile; ?>
Then add this rule to your stylesheet:

Code: Select all

img.imgfloat
{
    float: left;
    margin: 0 10px 10px 0;
}

Re: Embed thumbnail in external website and wrap text?

Posted: Sun Jan 29, 2012 10:21 am
by Leanna
THANK YOU, IT WORKED!! I REALLY appreciate your help!
Leanna