/ Published in: PHP
We set a custom field named "thumbnail" and its value to "http://mydomain.com/img/img.jpg". And then we add the following code in our template where we want the thumnail to appear.
As this, we could use this code to show anything we want, not only thumnails. Just set a key and a value different.
As this, we could use this code to show anything we want, not only thumnails. Just set a key and a value different.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//in our template, we put this code wherever we want the thumbail to appear <a class="myThumbClass" href="<?php the_permalink(); ?>"> <img src="<?php echo get_post_meta($post->ID,'thumbnail',true); ?>"> </a>