Serg10
Serg10

Reputation: 1

wordpress migration: problems with functions

I have migrated my wordpress blog to another server and now I find a problem ...

Some functions do not work.

For example the function of showing the thumbnail of each posts or category listing.

No errors, just does not show anything in the html code.

Example:

<?php the_post_thumbnail ();>

Output = ""

Upvotes: 0

Views: 55

Answers (1)

Anjana
Anjana

Reputation: 499

Use This code

if ( have_posts()  ) :  
      $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID) );
      $url = $thumb['0'];
endif;
     <img src="<?php echo $url;?>"/>

Upvotes: 1

Related Questions