• Hi Guys, the function the_title() – for example – displays the title of the current post, so it’s possible change its appaerance with css; but what about the image of a post?

    I would display the image inserted in a post with a particular style (or in a single <td> of a table), but I didn’t find any useful function.

    Any suggestion?

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • if you use the “upload/insert” function of wordress, your image
    will have a class “wp-image-*id*”
    <img width="***" height="***" alt="" src="****************.jpg" title="***" class="alignnone size-full wp-image-54">
    you can edit it into your css.

    Personally, I’m using metadatas to assign biggest images. (custom fields “image” where I put the url of the images)

    <?php if (get_post_meta($post->ID, 'image', true)){
    					?> <img src=<?php echo get_post_meta($post->ID, 'image', true) ;?> />
    				} ?>

    Thread Starter mm88

    (@mm88)

    Thanks for your useful suggestion.

    I’ve also tried the_attached_image plugin, because it represents another good way to call the first related image of a post.

    thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Functions to returns the image of a post?’ is closed to new replies.