• solutho

    (@solutho)


    Hey there, I’m adding the TimThumb plugin to my theme, but i got into an issue.

    I’m adding this just before the_content tag:

    <?php if ( get_post_meta($post->ID, 'thumb', true) ) { ?>
    
    		<img class="postthumb" src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=150&w=150&zc=1" alt="<?php the_title(); ?>" width="100" height="57" />
    
    <?php } ?>

    It works great, but since that html tag is outside the <p> of the the_content, the text of the post cant get wraped around the image – if I add an image the normal way, it gets wrapped, the text is being justified.

    I’m thinking about adding that initial code for the TimThumb image inside the <p> that is inside the the_content, but obviously I cant do it. So, I guess that the_theme tag is like an include, but where’s located the code to be included?
    Or even better, I’d like to replace the the_content tag by the code it represents.

    I’d really like some help 🙂

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Michael

    (@alchymyth)

    since that html tag is outside the <p> of the the_content, the text of the post cant get wraped around the image …

    probably caused by a style of the paragraph tag…

    link to your site?

    Thread Starter solutho

    (@solutho)

    Exactly :s
    Here:

    Thread Starter solutho

    (@solutho)

    It seems like I cant post the link:

    79.143.184.10/blog2

    Michael

    (@alchymyth)

    the post-thumb does not have any alignment css classes;

    if you want the text to wrap the image, try to add the css class .alignleft to the image code:

    <img class="postthumb alignleft" src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=150&w=150&zc=1" alt="<?php the_title(); ?>" width="100" height="57" class="alignleft" />

    Thread Starter solutho

    (@solutho)

    Wow, I had no idea it could be done having the image outside the paragraph tag.

    Thank you very much!

    Thread Starter solutho

    (@solutho)

    I had no idea you could wrap a paragraph with an image ouside.

    thank you very much!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘the_content – native code’ is closed to new replies.