WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Klan1 Common WP Functions

Basic functions needed by our others plugins and templates.

This functions are for those needs to resize images on their templates or plugins all the time.

<?php echo k1_get_post_thumb_url($post_id = null); ?>

Get the URL for the FEATURED IMAGE (full sized) defined in a POST/PAGE. If not defined returns the FIRST image if there is at leat one. Returns NULL if no images (jpg,png,gif) attachments.

  • $post_id If is empty, we will try to get the POST ID from the global $post var
<?php echo k1_get_post_timthumb_img_url($post_id = null, $width = 80, $height = 50, $crop = 1, $align = "t"); ?>

Returns the full URL using timthumb script to resize the post featured image

NOTE: If you just define one height or width as zero (0) the other one will conserve image proportion, if is not defined it will be default value.

<?php echo k1_get_post_thumb_img_html($post_id = null, $resize = false, $width = 80, $height = 50, $crop = 1, $align = "t"); ?>

return the FULL IMG HTML tag for the post featured image using TIMTHUMB or not as desired

NOTE: If you just define one height or width as zero (0) the other one will conserve image proportion, if is not defined it will be default value.

TODO: Get the attachment metadata to make the longdesc="" and alt="" IMG properties.

Requires: 2.7 or higher
Compatible up to: 3.7.1
Last Updated: 2014-1-27
Downloads: 240

Ratings

0 stars
0 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1