Turn a URL into an Attachment / Post ID

Massively improved function developed for plugin heavy on images: if ( ! function_exists( ‘get_attachment_id’ ) ) { /** * Get the Attachment ID for a given image URL. * * @link http://wordpress.stackexchange.com/a/7094 * * @param string $url * * @return boolean|integer */ function get_attachment_id( $url ) { $dir = wp_upload_dir(); // baseurl never has a … Read more

Horizontal ListView in Android?

As per Android Documentation RecyclerView is the new way to organize the items in listview and to be displayed horizontally Advantages: Since by using Recyclerview Adapter, ViewHolder pattern is automatically implemented Animation is easy to perform Many more features More Information about RecyclerView: grokkingandroid.com antonioleiva.com Sample: survivingwithandroid.com Just add the below block to make the … Read more

Changing image sizes proportionally using CSS

This is a known problem with CSS resizing. Unless all images have the same proportion, you have no way to do this via CSS. The best approach would be to have a container, and resize one of the dimensions (always the same) of the images. In my example I resized the width. If the container … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)